Revert "refactor(service-worker): make SwPush and SwUpdate tree-shakable (#61670)" (#61923)

This reverts commit f8c1b6e779.

PR Close #61923
This commit is contained in:
Jessica Janiuk
2025-06-06 10:00:58 +02:00
committed by Andrew Kushnir
parent 6097184711
commit 29e892a35e
4 changed files with 9 additions and 3 deletions
+3 -1
View File
@@ -9,11 +9,13 @@
import {ModuleWithProviders, NgModule} from '@angular/core';
import {provideServiceWorker, SwRegistrationOptions} from './provider';
import {SwPush} from './push';
import {SwUpdate} from './update';
/**
* @publicApi
*/
@NgModule()
@NgModule({providers: [SwPush, SwUpdate]})
export class ServiceWorkerModule {
/**
* Register the given Angular Service Worker script.
+4
View File
@@ -21,6 +21,8 @@ import {
import type {Observable} from 'rxjs';
import {NgswCommChannel} from './low_level';
import {SwPush} from './push';
import {SwUpdate} from './update';
import {RuntimeErrorCode} from './errors';
export const SCRIPT = new InjectionToken<string>(ngDevMode ? 'NGSW_REGISTER_SCRIPT' : '');
@@ -211,6 +213,8 @@ export function provideServiceWorker(
options: SwRegistrationOptions = {},
): EnvironmentProviders {
return makeEnvironmentProviders([
SwPush,
SwUpdate,
{provide: SCRIPT, useValue: script},
{provide: SwRegistrationOptions, useValue: options},
{
+1 -1
View File
@@ -92,7 +92,7 @@ import {ERR_SW_NOT_SUPPORTED, NgswCommChannel, PushEvent} from './low_level';
*
* @publicApi
*/
@Injectable({providedIn: 'root'})
@Injectable()
export class SwPush {
/**
* Emits the payloads of the received push notification messages.
+1 -1
View File
@@ -25,7 +25,7 @@ import {
*
* @publicApi
*/
@Injectable({providedIn: 'root'})
@Injectable()
export class SwUpdate {
/**
* Emits a `VersionDetectedEvent` event whenever a new version is detected on the server.