Skip to content

feat(aio): provide noop service worker file#17032

Merged
petebacondarwin merged 1 commit into
angular:masterfrom
petebacondarwin:aio-noop-sw
May 26, 2017
Merged

feat(aio): provide noop service worker file#17032
petebacondarwin merged 1 commit into
angular:masterfrom
petebacondarwin:aio-noop-sw

Conversation

@petebacondarwin

Copy link
Copy Markdown
Contributor

Use this file if we need to turn off the service worker in deployed sites
in an emergency where the worker has a bug that is blocking the application
from working.

Closes #16897

@petebacondarwin petebacondarwin added comp: aio action: review The PR is still awaiting reviews from at least one requested reviewer labels May 26, 2017
@petebacondarwin petebacondarwin requested a review from alxhub May 26, 2017 05:27
@mary-poppins

Copy link
Copy Markdown

The angular.io preview for 7b3c46528205134c97c546a7f130e3c10088bd96 is available here.

@gkalpak gkalpak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread aio/src/noop-worker-basic.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure if it makes any difference in practice, but MDN seems to suggest using event.waitUntil(self.skipWaiting()).

Comment thread aio/src/noop-worker-basic.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If reloading feels too drastic, we can just "claim" the clients:

self.addEventListener('activate', function(event) {
  event.waitUntil(self.clients.claim());
});

@petebacondarwin

Copy link
Copy Markdown
Contributor Author

Happy to follow MDN. I was just copying someone else's code anyway.

Use this file if we need to turn off the service worker in deployed sites
in an emergency where the worker has a bug that is blocking the application
from working.

Closes angular#16897
@petebacondarwin petebacondarwin added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 26, 2017
@mary-poppins

Copy link
Copy Markdown

The angular.io preview for f4a6d82 is available here.

@petebacondarwin petebacondarwin merged commit 6949510 into angular:master May 26, 2017
@petebacondarwin petebacondarwin deleted the aio-noop-sw branch May 26, 2017 13:25
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aio: option to blow away the service worker

4 participants