Skip to content

feat(service-worker): introduce the @angular/service-worker package#19274

Merged
vicb merged 1 commit intoangular:masterfrom
alxhub:new-service-worker
Sep 28, 2017
Merged

feat(service-worker): introduce the @angular/service-worker package#19274
vicb merged 1 commit intoangular:masterfrom
alxhub:new-service-worker

Conversation

@alxhub
Copy link
Member

@alxhub alxhub 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.

@mary-poppins
Copy link

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

@mary-poppins
Copy link

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

@mary-poppins
Copy link

You can preview 6a75ff4 at https://pr19274-6a75ff4.ngbuilds.io/.

@mary-poppins
Copy link

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

@alxhub alxhub force-pushed the new-service-worker branch 4 times, most recently from b07d702 to 5316479 Compare September 21, 2017 22:06
@mary-poppins
Copy link

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

@mary-poppins
Copy link

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

@mary-poppins
Copy link

You can preview 453bd2a at https://pr19274-453bd2a.ngbuilds.io/.

@mary-poppins
Copy link

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

@alxhub alxhub force-pushed the new-service-worker branch 2 times, most recently from e344b98 to b64dc8b Compare September 22, 2017 15:26
@mary-poppins
Copy link

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

@mary-poppins
Copy link

You can preview 5e13eb2 at https://pr19274-5e13eb2.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 65684b8 at https://pr19274-65684b8.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 9d6b0ea at https://pr19274-9d6b0ea.ngbuilds.io/.

@alxhub alxhub force-pushed the new-service-worker branch 2 times, most recently from 6d4fecc to 8768567 Compare September 22, 2017 17:02
@mary-poppins
Copy link

You can preview 6d4fecc at https://pr19274-6d4fecc.ngbuilds.io/.

@mary-poppins
Copy link

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

@mary-poppins
Copy link

You can preview 68e11a2 at https://pr19274-68e11a2.ngbuilds.io/.

@mary-poppins
Copy link

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

@mary-poppins
Copy link

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

@alxhub alxhub force-pushed the new-service-worker branch 2 times, most recently from e75303e to 9e8ab68 Compare September 28, 2017 17:40
@mary-poppins
Copy link

You can preview 9e8ab68 at https://pr19274-9e8ab68.ngbuilds.io/.

@mary-poppins
Copy link

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

@mary-poppins
Copy link

You can preview 632a4c4 at https://pr19274-632a4c4.ngbuilds.io/.

Copy link
Contributor

Choose a reason for hiding this comment

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

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

@vicb vicb added the target: major This PR is targeted for the next major release label Sep 28, 2017
@mary-poppins
Copy link

You can preview 6df0930 at https://pr19274-6df0930.ngbuilds.io/.

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.
@alexjlockwood
Copy link

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
Copy link

Ploppy3 commented Jan 27, 2018

@alxhub We need more info on this.

@angular-automatic-lock-bot
Copy link

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 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants