Skip to content

Conversation

mil7
Copy link

@mil7 mil7 commented Apr 2, 2025

Hi there,

I try to feed some learnings from this discussion vite-pwa/vite-plugin-pwa#847 into the documentation.

docs: approach to simplify chapter
Copy link

netlify bot commented Apr 2, 2025

Deploy Preview for vite-pwa-org ready!

Name Link
🔨 Latest commit 0978a99
🔍 Latest deploy log https://app.netlify.com/sites/vite-pwa-org/deploys/67ed22ec0980eb0008fb173c
😎 Deploy Preview https://deploy-preview-180--vite-pwa-org.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 configuration.

::: 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**:
Copy link
Author

Choose a reason for hiding this comment

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

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 })
Copy link
Author

Choose a reason for hiding this comment

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

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.

Copy link
Author

Choose a reason for hiding this comment

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

Question is, should we mention that flag anywhere?

@mil7 mil7 marked this pull request as ready for review April 2, 2025 11:50
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.

1 participant