-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Default Service Worker (in demo app or/and docs) #2246
Comments
|
|
ok, I agree with 1 and 2... about 4, I wrote it in time when adapter-auto didn't exist,... it's good it's added. It's why I checked it. about 3. agree, docs with link to demo service-workers or including one in demo app would be really good. |
Just adding my two cents. No idea if it's valuable, but I'm just going through all the 1.0 issues and try to help where I can. Maybe these links can help with adding the sample service workers? Wrote an article about a service worker implementation a year ago: https://jochemvogel.medium.com/how-to-cache-dynamic-pages-on-demand-with-a-service-worker-in-sveltekit-4b4a7652583d Also implemented one lately in another project: https://github.com/jochemvogel/ictmethods.nl/blob/development/src/service-worker.ts Please let me know if I can help with anything. |
Documentation for configure the SSR call for server side only is also missing. We can add that also. |
Stumbled across this while looking for guidance on service workers in kit, agree that the current documentation is pretty lacking and assumes a high bar of knowledge for configuring service workers given what the |
Was using Workbox Modules like This could make it easier for the reader, as we aren't coding the caching ourselves. Example implementation for precaching the app shell: import { build, files, prerendered, version } from '$service-worker'
import { cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching'
const precache_list = ['/', ...build, ...files, ...prerendered].map((s) => ({
url: s,
revision: version,
}))
precacheAndRoute(precache_list) It almost works out of the box, we'd just have to define: {
'process.env.NODE_ENV': '"production"',
} |
Describe the problem
Let think about default configs and options and some features for svelte-create. I think, now configuring svelte takes a little more steps than is necesary. (mainly point 3 and 4 below)
Describe the proposed solution
Today we have:
1. Demo app as default template, I think Skeleton one would be better (as is more often used)2. app.html as default template html file, why it's not index.html (index.html is "standard")"start": "node ./build"
to package.json scripts. Include a default adapter for the demo project #2459Alternatives considered
Let it be as it is now.
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: