-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Revisit service worker modules #16159
Copy link
Copy link
Closed
Labels
breaking changeneeds-decisionNot sure if we want to do this yet, also design work neededNot sure if we want to do this yet, also design work neededservice workerStuff related to service workersStuff related to service workers
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
breaking changeneeds-decisionNot sure if we want to do this yet, also design work neededNot sure if we want to do this yet, also design work neededservice workerStuff related to service workersStuff related to service workers
Describe the problem
In SvelteKit 2 we have
$app/*,$lib/*,$env/*and$service-worker. In SvelteKit 3 we're getting rid of$env/*. I think we should consider getting rid of$service-workeras well, since it's a bit of an anomaly. Doing so would leave just$app/*(generated modules specific to your app) and$lib/*(your stuff) alongside the@sveltejs/kitmodules, which feels a bit friendlier and easier to explain.Describe the proposed solution
It exports
base,build,files,prerenderedandversion.basecould presumably be imported from$app/paths. At present this module can't be imported into the service worker but that feels like an unnecessary restriction. There might be some Vite footwork involved in making it work but I'm pretty sure it's possible.build,filesandprerenderedcould perhaps be exported from a new$app/assetsor$app/manifestmodule. They're primarily intended for service worker caching but it's not inconceivable that they could be useful in other contexts, so making it more generic feels like a win.versioncould be imported from$app/env. As with$app/paths, it's not currently available IIRC but I don't see why it shouldn't be.Alternatives considered
not doing this
Importance
nice to have
Additional Information
No response