openscad/openscad-wasm

openscad.js module can not be loaded in a worker

DSchroer opened this issue · 1 comments

In order to keep sites responsive during long computations its best practice to run within a worker. Due to the fact that this project builds an ES6 module its not possible to load it directly into a worker at the moment. Further investigation is needed in order to make it easy to load into a worker environment.

In order to fix worker support I removed the ES6 and Module compile flags. The module wrapper is now hand made from within the runtime library. It was nice to have it autogenerated but worker support is more valuable.

@t-paul There are two options here. With the runtime library build it is backwards compatible but that would require nodejs in your build pipeline. If not you can publish only the openscad.wasm and openscad.wasm.js files. It would be minimal but not backward compatible for existing uses.