Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various fixes and improvements #768
Various fixes and improvements #768
Changes from 1 commit
f8c0314
85a9623
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we document what these are/what their function is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could, but it's super standard Chrome extension stuff, which is common knowledge for anybody creating a Chrome extension.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background
The sample is really simple, anybody who is familiar with Chrome extensions should understand it right away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the main worker that does all of the program execution? If an extension builder wanted to spin up another - how would that be done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the SDK must be run in a Worker, so this runs the SDK code in a Worker. The SDK code is in the
worker.js
file.I don't know why an extension would want to have multiple workers running SDK code, but if they wanted to they would just create a new
worker2.js
file, add it into the Rollup config:And then spawn it in the
background.js
file:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aleo functions are compute heavy so they might need to run multiple workers to execute multiple functions concurrently (say multiple transfers at once). Some wallets need to open these workers in popup windows.
Also there is the opposite case where Aleo wasm can run in the main thread because no executions or compute heavy tasks are being done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this currently required or just an optimization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is currently required if you want to use minification. If you don't want minification then it's not required.
Note that terser is used by default in Webpack, this is just changing some settings for terser.