Open
Conversation
docs: approach to simplify chapter
✅ Deploy Preview for vite-pwa-org ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
mil7
commented
Apr 2, 2025
| ::: warning | ||
| In order to reload all client tab/window, you will need to import any virtual module provided by the plugin: if you're not using any virtual, there is no way to interact with the application ui, and so, any client tab/window will not be reloaded (the old service worker will be still controlling the application). | ||
|
|
||
| Automatic reload is not automatic page reload, you will need to use the following code in your application entry point if you want **automatic page reload**: |
Author
There was a problem hiding this comment.
I still do not understand this sentence, I admit. I aggressively dropped this sentence.
Without registering the SW in the application nothing is happening here. That the SW installs any new application caches as soon it is triggered to do so happens independently of the registerType.
| ```js | ||
| import { registerSW } from 'virtual:pwa-register' | ||
|
|
||
| registerSW({ immediate: true }) |
Author
There was a problem hiding this comment.
Another bold move because the flag is missleading and has nothing to do with the automatic reload itself but is only used in a very rare case.
Author
There was a problem hiding this comment.
Question is, should we mention that flag anywhere?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there,
I try to feed some learnings from this discussion vite-pwa/vite-plugin-pwa#847 into the documentation.