jtulach/bck2brwsr

Web Worker Support [Enhancement Request]

Closed this issue · 4 comments

bck2brwsr.js should be able to detect the web worker environment and run the code that does not need to interact with the DOM.

Bck2Brwsr is able to run in a worker environment. See http://dew.apidesign.org/dew/ - the Javac runs in a worker thread in that case. Should you have a problem running Bck2Brwsr code in a worker, you should report a detailed description of your problem.

'bck2brwsr.js' is a launcher code for the compiled code I presume. This script is still injected to the DOM by the 'DEW'. As a use case, we can not allow a foreign script on our main document. We prefer to run them in a worker instead.

The http://dew.apidesign.org/dew/js/app.js creates a worker and launches http://dew.apidesign.org/dew/compiler.js that then loads http://dew.apidesign.org/dew/bck2brwsr.js (a JavaC transpiled to JavaScript).

This all makes me believe Bck2Brwsr code can successfully run in a worker.

Awesome, thank you very much for the pointers