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

Recipe for service worker and workbox #69

Open
frederikhors opened this issue Aug 23, 2021 · 4 comments
Open

Recipe for service worker and workbox #69

frederikhors opened this issue Aug 23, 2021 · 4 comments
Labels
stale Issue or PR haven't be update for a while

Comments

@frederikhors
Copy link
Contributor

I think we need a recipe for service worker and workbox default precacheAndRoute code.

Some idea?

@userquin
Copy link

userquin commented Aug 24, 2021

@frederikhors I have a working example with vite-plugin-pwa plugin, see comment on issue here vite-pwa/vite-plugin-pwa#124 (comment), you have a link there to my main branch of my fork of this repo.

/cc @benmccann (sorry to bother you) I talk with patak (vite) on discord, seems your are working on align svelte-kit with vite. It seems the service worker module is too old (doesn't include scope a way to register the service worker scope). If you are interested to include vite-plugin-pwa as a replacement for service worker module we can work together: I'm not an svelte developer and some svelte-kit concepts are hard to understand.

I also have included on vite-plugin-pwa a vite virtual module to work with svelte: just go to the repo and take a look at examples directory, you have inside 3 example for svelte.

I'm Joaquín#7667 on discord, you can find me on Vite Lang or Svelte servers.

@benmccann
Copy link
Collaborator

benmccann commented Aug 24, 2021

I will start a thread with you on Discord about vite-plugin-pwa: https://discord.com/channels/457912077277855764/879717438185431090/879717440894943322

Setting scope will be implemented by sveltejs/kit#2281

Clearing build output is already done and we just need to update this repo: #75

For list of prerendered .html files we can track in this issue: sveltejs/kit#2271. It seems there is also a related issue sveltejs/kit#1664

@userquin
Copy link

userquin commented Aug 25, 2021

@benmccann I Will open an issue/discussion tomorrow on svelte kit repo to clarify all service worker stuff: I will link to all related issues you mention and an explanation.

Maybe I link some issues/discussions from external repos like vitesse template o vite-ssg.

@benmccann
Copy link
Collaborator

https://github.com/antfu/vite-plugin-pwa now has docs for Svelte and SvelteKit: https://vite-plugin-pwa.netlify.app/frameworks/sveltekit.html

I think there's still more we can do to make that integration easier and better support it. I don't know if a recipe is the best solution as much as just making the plugin really easy to install. Maybe we should close this issue?

@MacFJA MacFJA added the stale Issue or PR haven't be update for a while label Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue or PR haven't be update for a while
Projects
None yet
Development

No branches or pull requests

4 participants