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: Unregister preact-cli's service worker if active #802

Merged
merged 2 commits into from
Aug 29, 2021

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Aug 26, 2021

Related to #800

It's come up a few times now in our tracker as well as the Slack that Preact-CLI's debug service worker will cause issues if still active when using WMR. As there's going to be a fair bit of overlap between Preact-CLI and WMR's users, I think this is a common enough situation to justify handling. Even for those that recognize this issue and know how to handle it, this should save opening the dev tools and unregistering manually.

Hopefully this approach isn't too naive, though I'm not sure if there's any better way to target it.

Preact-CLI also uses sw.js and sw-esm.js, though no one has brought up issues with them yet as far as I'm aware (they'd only attach when running the prod-like server with CLI's built output) so I'm thinking they're safe to ignore for now.

@changeset-bot
Copy link

changeset-bot bot commented Aug 26, 2021

🦋 Changeset detected

Latest commit: 4e37369

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 Aug 26, 2021

Size Change: +176 B (0%)

Total Size: 769 kB

Filename Size Change
packages/wmr/wmr.cjs 731 kB +176 B (0%)
ℹ️ View Unchanged
Filename Size
examples/demo/dist/about/index.html 712 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 137 B
examples/demo/dist/chunks/class-fields.********.js 213 B
examples/demo/dist/chunks/compat.********.js 15.3 kB
examples/demo/dist/chunks/hoofd.module.********.js 1.47 kB
examples/demo/dist/chunks/index.********.js 266 B
examples/demo/dist/chunks/json.********.js 238 B
examples/demo/dist/chunks/meta-tags.********.js 298 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.6 kB
examples/demo/dist/env/index.html 778 B
examples/demo/dist/error/index.html 707 B
examples/demo/dist/files/index.html 738 B
examples/demo/dist/index.********.js 7.65 kB
examples/demo/dist/index.html 770 B
examples/demo/dist/json/index.html 710 B
examples/demo/dist/lazy-and-late/index.html 713 B
examples/demo/dist/meta-tags/index.html 781 B

compressed-size-action

@marvinhagemeister marvinhagemeister merged commit f5a55c4 into main Aug 29, 2021
@marvinhagemeister marvinhagemeister deleted the fix/unregister-cli-sw branch August 29, 2021 12:17
@github-actions github-actions bot mentioned this pull request Aug 29, 2021
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.

2 participants