You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 12, 2021. It is now read-only.
main is set to bundle.index.js for a reason I'll go in to later. However trying to import the browserified bundle in vegaprotocol/console doesn't work. Because it's browserified, which isn't what we need over there.
Our current problem
We're trying to remove our usage of the prepareX endpoints. Previously we had no way of making protos for the wallet server to sign, but this api repo gives us that, so we're doing a spike to try it out
In that example above, Intellij / VSCode / etc will correctly show the types and autocomplete. However when we get to actually running it in the browser, it won't bundle (will paste the error in a second)
Importing from '@vegaprotocol/vega-grpc/index' does work though?
Easy! Just remove that main declaration
Yes. This will fix it. The reason that Browserify bundle is there at all is when it comes to signing code using Tweetnacl to sign stuff, we turned out to need Buffer from node. Which leads to other issues (e.g. dchest/tweetnacl-js#59). However we're not using this functionality at the moment - so removing the main declaration is probably the way to go
Related
Also the weird mix of Typescript & JS is a little odd. We should fix that - but that's a separate issue.
The text was updated successfully, but these errors were encountered:
Closes#159 by stopping setting the bundled, browserified output as the `main` script
- Remove `browserify` dep
- Noop `build:browser`
- Remove `build:browser` from `build`
- Update `main` to `index.js`
Our current packaging up of the JS is poor in a number of ways. First and foremost: the
main
script.api/js/package.json
Lines 5 to 10 in d9e0eda
main
is set tobundle.index.js
for a reason I'll go in to later. However trying to import thebrowserified
bundle in vegaprotocol/console doesn't work. Because it's browserified, which isn't what we need over there.Our current problem
We're trying to remove our usage of the prepareX endpoints. Previously we had no way of making protos for the wallet server to sign, but this api repo gives us that, so we're doing a spike to try it out
Works fine, and
In that example above, Intellij / VSCode / etc will correctly show the types and autocomplete. However when we get to actually running it in the browser, it won't bundle (will paste the error in a second)
Importing from '@vegaprotocol/vega-grpc/index' does work though?
Easy! Just remove that
main
declarationYes. This will fix it. The reason that Browserify bundle is there at all is when it comes to signing code using Tweetnacl to sign stuff, we turned out to need
Buffer
from node. Which leads to other issues (e.g. dchest/tweetnacl-js#59). However we're not using this functionality at the moment - so removing themain
declaration is probably the way to goRelated
Also the weird mix of Typescript & JS is a little odd. We should fix that - but that's a separate issue.
The text was updated successfully, but these errors were encountered: