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

Hash website build so service worker can detect changes #1526

Closed
wants to merge 1 commit into from

Conversation

brandonpayton
Copy link
Member

Motivation for the change, related issues

We need some way to detect whether the app has been updated since we last cached app resources. This may not be the way, but it can kick off discussion. This PR starts by adding the website hash to a standalone file, but to avoid a network request, we may prefer to embed it in a file like the service worker script. cc @bgrgicak @adamziel

Related to #133

Implementation details

We need to decide where to put the hash.

The hash itself is derived from a list of hashes of all website files sorted by path.

Testing Instructions (or ideally a Blueprint)

TBD

We need some way to detect whether the app has been updated since we last cached app resources. This may not be the way, but it can kick of discussion.
@brandonpayton
Copy link
Member Author

I spoke with @bgrgicak, and it sounds like we get something similar for free from Vite builds. Let's close this for now.

@bgrgicak
Copy link
Collaborator

We can use this code for getting the version

import { buildVersion } from 'virtual:website-config';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants