You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caching is great, it makes things fast. But using a cached page after an app deploy means all the script references are wrong and "bad things". So some form of "app version" needs to be part of any cache key.
There is a generated version string, used for the update checks. That could be read from build/client/_app/version.jsonexcept ... it won't be there during the build if pre-rendering.
So you have to check if running in dev or prerendering mode before reading the file.
Describe the proposed solution
I would like to be able to access the version string from $app/environment
Alternatives considered
Maybe it's already exposed from '$service-worker'?
But I don't know if that only works if using a service-worker, and it feels odd importing it from there when it isn't really anything todo with a service-worker.
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered:
In the meantime, I also needed some form of app versioning for quick (mostly) client-side checks (to automatically clear some outdated localStorage objects), and until kit's appVersion is exposed as proposed, we could resort to defining a basic version key using a vite global var:
Describe the problem
Caching is great, it makes things fast. But using a cached page after an app deploy means all the script references are wrong and "bad things". So some form of "app version" needs to be part of any cache key.
There is a generated version string, used for the update checks. That could be read from
build/client/_app/version.json
except ... it won't be there during the build if pre-rendering.So you have to check if running in
dev
orprerendering
mode before reading the file.Describe the proposed solution
I would like to be able to access the version string from
$app/environment
Alternatives considered
Maybe it's already exposed from '$service-worker'?
But I don't know if that only works if using a service-worker, and it feels odd importing it from there when it isn't really anything todo with a service-worker.
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: