transcend-io / penumbra

Encrypt/decrypt anything in the browser using streams on background threads.
https://penumbra-example.vercel.app/
Apache License 2.0
145 stars 19 forks source link

Inline worker script for easier library usage #153

Open eligrey opened 4 years ago

eligrey commented 4 years ago

We should inline our worker script so that the entry bundle can instantiate penumbra workers without any external URL references.

We can do this by adding a build step to compile the worker script and expose this through process.env (or similar) for embedding by Webpack. This embedded minified worker script could be allocated to a Blob URI at runtime and used for worker instantiation.

michaelfarrell76 commented 4 years ago

potential solutions invole https://webpack.js.org/loaders/worker-loader/ or https://github.com/GoogleChromeLabs/comlink-loader

eligrey commented 3 years ago

This seems best solved with Module Blocks.