Skip to content
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

Provide esbuild-wasm build that does not require workers or dynamic code instantiation #2081

Closed
lucacasonato opened this issue Mar 4, 2022 · 1 comment

Comments

@lucacasonato
Copy link
Contributor

lucacasonato commented Mar 4, 2022

Currently when using esbuild-wasm you have two options:

  • either you enable worker: true in the setup options, which means your environment requires support for web workers,
  • or you don't enable workers, in which case the esbuild code will call new Function(...) with the code originally destined for the web worker

The latter case does not work on platforms like Deno Deploy or Cloudflare Workers, which limit dynamic JS evaluation for security/introspectability.

It would be great if the second option (not using a worker), did not require the use of dynamic code evaluation. Could the source code always be a "real" function in source, and then .toString()'d for the worker?

@evanw evanw closed this as completed in 536ebd3 Mar 4, 2022
@lucacasonato
Copy link
Contributor Author

Thanks a lot @evanw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant