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

fix: Worker detection #948

Merged
merged 2 commits into from
Jan 4, 2023
Merged

fix: Worker detection #948

merged 2 commits into from
Jan 4, 2023

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Jan 3, 2023

Workers must have .worker in their name yet this regex didn't test for it. So new URL('./foo.js', import.meta.url) is (incorrectly) treated as a worker.

This behavior is still super sketchy and flawed, as a simple console.log(new URL('./foo.worker.js', import.meta.url)) will trigger (in prod, in dev the user will just get errors) WMR to emit another file, but this at least reduces the chances of users running into it.

@changeset-bot
Copy link

changeset-bot bot commented Jan 3, 2023

🦋 Changeset detected

Latest commit: a232cea

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

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

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 Jan 3, 2023

Size Change: +5 B (0%)

Total Size: 806 kB

Filename Size Change
packages/wmr/wmr.cjs 767 kB +5 B (0%)
ℹ️ View Unchanged
Filename Size
examples/demo/dist/about/index.html 720 B
examples/demo/dist/alias-outside/index.html 696 B
examples/demo/dist/assets/Calendar.********.css 694 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 210 B
examples/demo/dist/chunks/compat.********.js 17 kB
examples/demo/dist/chunks/hoofd.module.********.js 1.47 kB
examples/demo/dist/chunks/index.********.js 200 B
examples/demo/dist/chunks/json.********.js 238 B
examples/demo/dist/chunks/meta-tags.********.js 297 B
examples/demo/dist/chunks/prerender.********.js 294 B
examples/demo/dist/class-fields/index.html 708 B
examples/demo/dist/compat/index.html 1.64 kB
examples/demo/dist/env/index.html 786 B
examples/demo/dist/error/index.html 713 B
examples/demo/dist/files/index.html 742 B
examples/demo/dist/index.********.js 8.19 kB
examples/demo/dist/index.html 774 B
examples/demo/dist/json/index.html 719 B
examples/demo/dist/lazy-and-late/index.html 722 B
examples/demo/dist/meta-tags/index.html 785 B

compressed-size-action

@rschristian rschristian merged commit 3c5672e into main Jan 4, 2023
@rschristian rschristian deleted the fix/worker-detection branch January 4, 2023 02:08
@github-actions github-actions bot mentioned this pull request Jan 4, 2023
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.

3 participants