Skip to content

refactor(service-worker): make SwPush and SwUpdate tree-shakable - #61937

Closed
arturovt wants to merge 1 commit into
angular:mainfrom
arturovt:fix/service-worker-providers
Closed

arturovt wants to merge 1 commit into
angular:mainfrom
arturovt:fix/service-worker-providers

Conversation

@arturovt

@arturovt arturovt commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

In this commit, we mark the SwPush and SwUpdate classes as root providers. As a result, they are no longer statically referenced in the provideServiceWorker providers list, which previously forced them to be explicitly bundled into the main file. These classes might never be used—some consumers may use the service worker only for prefetching and caching assets.

Currently, some users work around this by using patch-package to modify the service worker code and remove these classes from the providers list.

@angular-robot angular-robot Bot added the area: service-worker Issues related to the @angular/service-worker package label Jun 6, 2025
@ngbot ngbot Bot added this to the Backlog milestone Jun 6, 2025
@thePunderWoman
thePunderWoman removed the request for review from pkozlowski-opensource July 3, 2025 11:28
@pullapprove
pullapprove Bot requested a review from thePunderWoman July 3, 2025 11:29
In this commit, we mark the `SwPush` and `SwUpdate` classes as root providers. As a result, they are no longer statically referenced in the `provideServiceWorker` providers list, which previously forced them to be explicitly bundled into the main file. These classes might never be used—some consumers may use the service worker only for prefetching and caching assets.

Currently, some users work around this by using `patch-package` to modify the service worker code and remove these classes from the providers list.
@arturovt
arturovt force-pushed the fix/service-worker-providers branch from 440a90d to 028ccaa Compare July 29, 2025 19:34
@JeanMeche

Copy link
Copy Markdown
Member

With #63364 we've announced that the service-worker package in now in maintenance mode and will not receive feature PRs and feature requests.

The message is also visible here: https://angular.dev/ecosystem/service-workers

@JeanMeche JeanMeche closed this Aug 27, 2025
@arturovt
arturovt deleted the fix/service-worker-providers branch August 27, 2025 15:49
@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 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: service-worker Issues related to the @angular/service-worker package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants