diff --git a/aio/scripts/deploy-to-firebase/index.mjs b/aio/scripts/deploy-to-firebase/index.mjs index cb91169f207..293b252046d 100644 --- a/aio/scripts/deploy-to-firebase/index.mjs +++ b/aio/scripts/deploy-to-firebase/index.mjs @@ -241,10 +241,9 @@ function computeDeploymentsInfo( projectId: 'angular-io', siteId: 'rc-angular-io-site', deployedUrl: 'https://rc.angular.io/', - preDeployActions: [pre.disableServiceWorker, pre.redirectNonFilesToStable], + preDeployActions: [pre.redirectNonFilesToStable], postDeployActions: [ pre.undo.redirectNonFilesToStable, - pre.undo.disableServiceWorker, post.testNoActiveRcDeployment, ], }, @@ -256,12 +255,10 @@ function computeDeploymentsInfo( siteId: 'stable-angular-io-site', deployedUrl: 'https://angular.io/', preDeployActions: [ - pre.disableServiceWorker, pre.redirectNonFilesToVersion17, ], postDeployActions: [ pre.undo.redirectNonFilesToVersion17, - pre.undo.disableServiceWorker, ], } diff --git a/aio/scripts/deploy-to-firebase/index.spec.mjs b/aio/scripts/deploy-to-firebase/index.spec.mjs index f53f1931db8..0004889c4f6 100644 --- a/aio/scripts/deploy-to-firebase/index.spec.mjs +++ b/aio/scripts/deploy-to-firebase/index.spec.mjs @@ -299,10 +299,9 @@ describe('deploy-to-firebase:', () => { projectId: 'angular-io', siteId: 'rc-angular-io-site', deployedUrl: 'https://rc.angular.io/', - preDeployActions: ['function:disableServiceWorker', 'function:redirectNonFilesToStable'], + preDeployActions: ['function:redirectNonFilesToStable'], postDeployActions: [ 'function:undoRedirectNonFilesToStable', - 'function:undoDisableServiceWorker', 'function:testNoActiveRcDeployment', ], }, @@ -377,12 +376,10 @@ describe('deploy-to-firebase:', () => { siteId: 'stable-angular-io-site', deployedUrl: 'https://angular.io/', preDeployActions: [ - 'function:disableServiceWorker', 'function:redirectNonFilesToVersion17', ], postDeployActions: [ 'function:undoRedirectNonFilesToVersion17', - 'function:undoDisableServiceWorker', ], }, ]); diff --git a/aio/scripts/deploy-to-firebase/pre-deploy-actions.mjs b/aio/scripts/deploy-to-firebase/pre-deploy-actions.mjs index 1ab58e9fccc..8f941ae3df3 100644 --- a/aio/scripts/deploy-to-firebase/pre-deploy-actions.mjs +++ b/aio/scripts/deploy-to-firebase/pre-deploy-actions.mjs @@ -7,18 +7,14 @@ import u from './utils.mjs'; const BAZEL_DIST_DIR = '../dist/bin/aio/build'; const DIST_DIR = 'dist'; const FIREBASE_JSON_PATH = 'firebase.json'; -const NGSW_JSON_PATH = `${DIST_DIR}/ngsw.json`; -const NGSW_JSON_BAK_PATH = `${NGSW_JSON_PATH}.bak`; // Exports const exp = { build, checkPayloadSize, - disableServiceWorker, undo: { build: undoBuild, checkPayloadSize: undoCheckPayloadSize, - disableServiceWorker: undoDisableServiceWorker, }, }; Object.keys(u.ORIGINS).forEach(originLabel => { @@ -56,14 +52,6 @@ function checkPayloadSize() { u.yarn('payload-size'); } -function disableServiceWorker() { - u.logSectionHeader('Disable the ServiceWorker.'); - - // Rename the SW manifest (`ngsw.json`). This will cause the ServiceWorker to unregister itself. - // See https://angular.io/guide/service-worker-devops#fail-safe. - sh.mv(NGSW_JSON_PATH, NGSW_JSON_BAK_PATH); -} - function escapeForRegex(str) { return str.replace(/[.?*+\\|^$()[\]{}]/g, '\\$&'); } @@ -121,8 +109,3 @@ function undoBuild() { function undoCheckPayloadSize() { // Nothing to undo. } - -function undoDisableServiceWorker() { - u.logSectionHeader('Re-enable the ServiceWorker.'); - sh.mv(NGSW_JSON_BAK_PATH, NGSW_JSON_PATH); -} diff --git a/aio/scripts/deploy-to-firebase/pre-deploy-actions.spec.mjs b/aio/scripts/deploy-to-firebase/pre-deploy-actions.spec.mjs index d7e9a631d8d..e0b39bbf36f 100644 --- a/aio/scripts/deploy-to-firebase/pre-deploy-actions.spec.mjs +++ b/aio/scripts/deploy-to-firebase/pre-deploy-actions.spec.mjs @@ -84,17 +84,6 @@ describe('deploy-to-firebase/pre-deploy-actions:', () => { }); }); - describe('disableServiceWorker()', () => { - let mvSpy; - - beforeEach(() => mvSpy = spyOn(sh, 'mv')); - - it('should disable the ServiceWorker by renaming the `ngsw.json` manifest', () => { - pre.disableServiceWorker(); - expect(mvSpy).toHaveBeenCalledWith('dist/ngsw.json', 'dist/ngsw.json.bak'); - }); - }); - Object.entries(u.ORIGINS).forEach(([originLabel, origin]) => { [true, false].forEach(allRequests => { const redirectToFnName = `redirect${allRequests ? 'All' : 'NonFiles'}To${originLabel}`; @@ -168,17 +157,6 @@ describe('deploy-to-firebase/pre-deploy-actions:', () => { it('does not need tests', () => expect().nothing()); }); - describe('undo.disableServiceWorker()', () => { - let mvSpy; - - beforeEach(() => mvSpy = spyOn(sh, 'mv')); - - it('should undo `disableServiceWorker()`', () => { - pre.undo.disableServiceWorker(); - expect(mvSpy).toHaveBeenCalledWith('dist/ngsw.json.bak', 'dist/ngsw.json'); - }); - }); - Object.entries(u.ORIGINS).forEach(([originLabel, origin]) => { [true, false].forEach(allRequests => { const redirectToFnName = `redirect${allRequests ? 'All' : 'NonFiles'}To${originLabel}`;