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: unregister pwa support #323

Merged
merged 8 commits into from
Jul 7, 2022
Merged

Conversation

userquin
Copy link
Member

@userquin userquin commented Jul 6, 2022

This PR also fixes the race condition, using HMR to register the SW once the entry point loads: it seems we have the race condition back with registerSW and dev server with dev mode enabled.

Also included a new vanilla-ts example to test the sw in dev server with dev options enabled not importing any virtual: using only injectRegister.

closes #281

@netlify
Copy link

netlify bot commented Jul 6, 2022

Deploy Preview for vite-plugin-pwa ready!

Name Link
🔨 Latest commit 8706794
🔍 Latest deploy log https://app.netlify.com/sites/vite-plugin-pwa/deploys/62c6ce6d9ed7b80008b4d1a2
😎 Deploy Preview https://deploy-preview-323--vite-plugin-pwa.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@userquin userquin changed the title feat: add unregister pwa support feat: unregister pwa support Jul 6, 2022
@userquin userquin marked this pull request as ready for review July 6, 2022 21:46
@userquin userquin requested a review from antfu July 6, 2022 21:48
"dev-auto-destroy": "rimraf dev-dist && cross-env DEBUG=vite-plugin-pwa:* SW_DEV=true SW_DESTROY=true SW_INLINE=auto vite --force",
"dev-inline-destroy": "rimraf dev-dist && cross-env DEBUG=vite-plugin-pwa:* SW_DEV=true SW_DESTROY=true SW_INLINE=inline vite --force",
"dev-script-destroy": "rimraf dev-dist && cross-env DEBUG=vite-plugin-pwa:* SW_DEV=true SW_DESTROY=true SW_INLINE=script vite --force",
"build": "rimraf dev-dist && cross-env DEBUG=vite-plugin-pwa:* vite build",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the rimraf from build script or remove the dist folder

@userquin userquin merged commit b10b121 into main Jul 7, 2022
@userquin userquin deleted the userquin/feat-self-destroying branch July 7, 2022 12:25
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.

feature suggest: out of the box support for unregister
2 participants