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

Add built-in support for web-workers #827

Merged
merged 7 commits into from Sep 2, 2021
Merged

Add built-in support for web-workers #827

merged 7 commits into from Sep 2, 2021

Conversation

marvinhagemeister
Copy link
Member

@marvinhagemeister marvinhagemeister commented Sep 1, 2021

This PR adds native support for Web Workers in WMR. It leverages native browser APIs and only requires the worker file to have .worker as a suffix in the filename.

Initially the plan was to use https://github.com/surma/rollup-plugin-off-main-thread instead, but that turned out tricky to wire up if we want to support bundling the worker by default. This is necessary because Firefox doesn't support module workers yet.

Fixes #825

@changeset-bot
Copy link

changeset-bot bot commented Sep 1, 2021

🦋 Changeset detected

Latest commit: 5f89737

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wmr Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2021

Size Change: +597 B (0%)

Total Size: 806 kB

Filename Size Change
packages/wmr/wmr.cjs 767 kB +597 B (0%)
ℹ️ View Unchanged
Filename Size
examples/demo/dist/about/index.html 713 B
examples/demo/dist/alias-outside/index.html 692 B
examples/demo/dist/assets/Calendar.********.css 702 B
examples/demo/dist/assets/style.********.css 624 B
examples/demo/dist/chunks/alias-outside.********.js 138 B
examples/demo/dist/chunks/class-fields.********.js 211 B
examples/demo/dist/chunks/compat.********.js 15.3 kB
examples/demo/dist/chunks/hoofd.module.********.js 1.48 kB
examples/demo/dist/chunks/index.********.js 303 B
examples/demo/dist/chunks/json.********.js 238 B
examples/demo/dist/chunks/meta-tags.********.js 297 B
examples/demo/dist/chunks/prerender.********.js 2.43 kB
examples/demo/dist/class-fields/index.html 703 B
examples/demo/dist/compat/index.html 1.55 kB
examples/demo/dist/env/index.html 779 B
examples/demo/dist/error/index.html 708 B
examples/demo/dist/files/index.html 741 B
examples/demo/dist/index.********.js 7.69 kB
examples/demo/dist/index.html 770 B
examples/demo/dist/json/index.html 711 B
examples/demo/dist/lazy-and-late/index.html 714 B
examples/demo/dist/meta-tags/index.html 782 B

compressed-size-action

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.

HMR attempts to call location.reload() inside a worker
1 participant