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(service-worker): introduce the @angular/service-worker package #19274

Merged
merged 1 commit into from Sep 28, 2017

Conversation

Projects
None yet
7 participants
@alxhub
Copy link
Contributor

commented Sep 19, 2017

Status

This is an in-progress PR, made to facilitate review of the rather large merge to angular/angular.

Remaining tasks before this PR should be merged:

  • Unit tests for companion library
  • Integration test between companion lib and SW
  • Public API generator
  • Passing Travis/CircleCI/etc
  • ngsw-cli tool in package.json

Remaining tasks that could wait until future PRs, in no particular order:

  • Debugging page
  • Check for obsolete configuration version (SW internal version or app provided version) on update, and clear prior cache state if discovered
  • Check for invalid SW config version
  • Kill switch when manifest 404s
  • More unit tests for CLI tool
  • Integration test for CLI tool
  • refreshAhead behavior for data caching
  • Update mode for asset caching, including marking resources as unused
  • Ensure full vs path-only URL matching works correctly
  • Support optimizeFor behavior

PR Description

This service worker is a conceptual derivative of the existing @angular/service-worker maintained at github.com/angular/mobile-toolkit, but has been rewritten to support use across a much wider variety of applications.

Entrypoints include:

@angular/service-worker: a library for use within Angular client apps to communicate with the service worker.
@angular/service-worker/gen: a library for generating ngsw.json files from glob-based SW config files.
@angular/service-worker/ngsw-worker.js: the bundled service worker script itself.
@angular/service-worker/ngsw-cli.js: a CLI tool for generating ngsw.json files from glob-based SW config files.

@googlebot googlebot added the cla: yes label Sep 19, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 19, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from d243f79 to 8895fa3 Sep 20, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 20, 2017

You can preview 8895fa3 at https://pr19274-8895fa3.ngbuilds.io/.

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 8895fa3 to 6a75ff4 Sep 20, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 20, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 6a75ff4 to d48a1d6 Sep 20, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 20, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch 4 times, most recently from b07d702 to 5316479 Sep 21, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 21, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 21, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 5316479 to 453bd2a Sep 21, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 21, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 453bd2a to c22cd1d Sep 21, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 21, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch 2 times, most recently from e344b98 to b64dc8b Sep 22, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 22, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from b64dc8b to 5e13eb2 Sep 22, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 22, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 5e13eb2 to 65684b8 Sep 22, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 22, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 65684b8 to 9d6b0ea Sep 22, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 22, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch 2 times, most recently from 6d4fecc to 8768567 Sep 22, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 22, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 25, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 402f6a3 to 7806264 Sep 27, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 27, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 7806264 to 68e11a2 Sep 27, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 27, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 68e11a2 to bda0cf5 Sep 28, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 28, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from bda0cf5 to bd4a36b Sep 28, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 28, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch 2 times, most recently from e75303e to 9e8ab68 Sep 28, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 28, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 9e8ab68 to ae1cebf Sep 28, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 28, 2017

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from ae1cebf to 632a4c4 Sep 28, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 28, 2017

* found in the LICENSE file at https://angular.io/license
*/

import 'rxjs/add/operator/take';

This comment has been minimized.

Copy link
@IgorMinar

IgorMinar Sep 28, 2017

Member

we should not be using these because they could affect other tests

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 632a4c4 to 6df0930 Sep 28, 2017

@mary-poppins

This comment has been minimized.

Copy link

commented Sep 28, 2017

feat(service-worker): introduce the @angular/service-worker package
This service worker is a conceptual derivative of the existing @angular/service-worker maintained at github.com/angular/mobile-toolkit, but has been rewritten to support use across a much wider variety of applications.

Entrypoints include:

@angular/service-worker: a library for use within Angular client apps to communicate with the service worker.
@angular/service-worker/gen: a library for generating ngsw.json files from glob-based SW config files.
@angular/service-worker/ngsw-worker.js: the bundled service worker script itself.
@angular/service-worker/ngsw-cli.js: a CLI tool for generating ngsw.json files from glob-based SW config files.

@alxhub alxhub force-pushed the alxhub:new-service-worker branch from 6df0930 to 2e70e77 Sep 28, 2017

@vicb vicb merged commit d442b68 into angular:master Sep 28, 2017

2 of 5 checks passed

ci/circleci: build CircleCI is running your tests
Details
ci/circleci: lint CircleCI is running your tests
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
cla/google All necessary CLAs are signed
code-review/pullapprove Approved by all reviewer groups.
Details
@alexjlockwood

This comment has been minimized.

Copy link

commented Dec 6, 2017

Hi @alxhub, is there any documentation anywhere that explains how to upgrade the older beta service-worker package to the newer 5.0.0+ version?

@Ploppy3

This comment has been minimized.

Copy link

commented Jan 27, 2018

@alxhub We need more info on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.