Skip to content

WIP: delegate SW registration to the user#1081

Open
kosciolek wants to merge 1 commit intoAxaFrance:mainfrom
kosciolek:standalone-sw
Open

WIP: delegate SW registration to the user#1081
kosciolek wants to merge 1 commit intoAxaFrance:mainfrom
kosciolek:standalone-sw

Conversation

@kosciolek
Copy link
Copy Markdown
Contributor

@kosciolek kosciolek commented Jul 3, 2023

just an exploratory PR, feel free to close it at will

return await registration.unregister();
};

registration.addEventListener('updatefound', () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this code reloads the page if an update to a service worker is detected, is it really needed? if the user manages the service worker on his own, it probably should be on his side

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, I know,

may be another property to disable this default behavior would be a nice idea.
The difficulty, is link to the time to leave request which maintain the old service worker to life and block updates.

I does not found a cleaner default behavior way. Many people does not understand well service worker so I prefer a default page realoard in production than all production page broken.

May be a clean defaut and safer way can be found.

@guillaume-chervet
Copy link
Copy Markdown
Contributor

Please continue You PullRequest.
I like it ! and thank you very much for your help :)

@guillaume-chervet
Copy link
Copy Markdown
Contributor

hi @kosciolek ,

I'am very sorry @kosciolek for the delay. I was too busy :'(
I very like your PullRequest. Do you have time to update it?

@darkowic
Copy link
Copy Markdown

darkowic commented Jun 3, 2024

Hi @guillaume-chervet! This PR was discontinued as we deprioritized this functionality on our side. Feel free to close this and we will eventually continue if we find this feature needed.

@esomore
Copy link
Copy Markdown

esomore commented Oct 29, 2024

I would like to have this PR functionality for my PWA using Vite. I am forced to use the library without the service worker functionality since it is breaking my Periodic SW Updates (https://github.com/vite-pwa/vite-plugin-pwa/blob/main/docs/frameworks/react.md#periodic-sw-updates)

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.

4 participants