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

feat: update service worker when new version is detected #12448

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

dumbmoron
Copy link
Contributor

@dumbmoron dumbmoron commented Jul 7, 2024

this patch adds a function that tries to update the service worker (if it exists), and calls it when sveltekit detects that a new version has been deployed.
i'm not sure if this is the right place to put this -- i considered putting it in the body of check(), but it feels wrong to me. if you think it's a good idea, let me know and i'll update it.

closes #3667


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

Copy link

changeset-bot bot commented Jul 7, 2024

🦋 Changeset detected

Latest commit: 1720934

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@eltigerchino eltigerchino added service worker Stuff related to service workers feature request New feature or request labels Oct 9, 2024
Co-authored-by: Tee Ming <chewteeming01@gmail.com>
@eltigerchino
Copy link
Member

I don't have much knowledge about service workers but it looks good to me. cc: @dummdidumm what do you think?

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dummdidumm dummdidumm merged commit 8aa95b4 into sveltejs:main Oct 10, 2024
12 checks passed
@github-actions github-actions bot mentioned this pull request Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request service worker Stuff related to service workers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update service worker when new version is detected
3 participants