forked from nulligun/solc-js
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
@todo
- fix solcjs compiler to use webworker
- https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
- https://github.com/ethereum-play/editor-solidity/blob/master/src/editor-solidity.js#L63
- https://www.youtube.com/watch?v=HcSqj1apNHI
Currently we have 1 module (solc-js) and we need is 2 more modules:
- solc-js-webworker (which does
require('solc-js'))- and it get's loaded in a web worker
- listens to messages like:
onmessage = event => { const [msgID, from, path, ref, type, body] = event.data }
- and it receives messages and calls solc-js methods
- solc-js-proxy
- it loads a web worker with solc-js-webworker
- it offers the same methods as solc-js
- it forwards method calls to the webworker
solcjs_worker.postMessage([msgID, from, path, ref, type, body])
- it listens for responses from the webworker
solcjs_worker.onmessage = event => { const [msgID, from, path, ref, type, body] = event.data }
- it responds to the original method call with the result, so
solc-jsmethods need to beasync/await
Metadata
Metadata
Assignees
Labels
No labels