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

feat(demo): Run js in worker in wat2wasm demo #2568

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spotandjake
Copy link

This pr moves execution of the user js and wasm module from the main page to a web worker. The benefit of this is if you write an infinite loop in either the js or wasm you won't crash the main page and can recompile. I also added a Run button as I noticed there wasn't one and it was useful for testing (when you edit the wasm the output doesn't update until you click run or edit the js).

NOTE

As the js is now running in a worker it is isolated so while before you could have worked with the dom from the js editor you can't really do this anymore. I feel like the old behaviour didn't make much sense anyways though.

@spotandjake spotandjake force-pushed the spotandjake-demo-worker branch from 91a8e44 to b67fde0 Compare March 22, 2025 00:42
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

Successfully merging this pull request may close these issues.

1 participant