From 47bb841ed6d724bcf1e890b86687fd9762e7578c Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Mon, 24 May 2021 21:34:42 +0300 Subject: [PATCH] build(docs-infra): temporarily serve the DevTools guide at `/devtools` too (#42283) The latest SW app version knows that `/devtools` should be redirected to `/guide/devtools`. However, if a user has an older app version installed (and until the SW downloads the latest version) they will get a 404 when navigating to `/devtools`. The reason is that the SW will see `/devtools` as a regular navigation URL and serve `index.html` instead. The Angular app will then try to get the content for `/devtools` by fetching `/generated/docs/devtools.json` (which does not exist). This commit fixes the issue by redirecting `/generated/docs/devtools.json` to `/geenrated/docs/guide/devtools.json`. When a user visits `/devtools` for the first time, they will still be able to see the guide content (while the SW updates in the background). On subsequent visits (once the SW has downloaded the latest app version), they will be redirected to `/guide/devtools`). At a later time, once we are confident that the majority of users will have updated to a newer app version, we can remove this temporary redirect. PR Close #42283 --- aio/firebase.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aio/firebase.json b/aio/firebase.json index 66568b3e5e..8a88687ec5 100644 --- a/aio/firebase.json +++ b/aio/firebase.json @@ -136,7 +136,11 @@ {"type": 301, "source": "/strict", "destination": "/guide/strict-mode"}, // Use discoverable link for Angular DevTools and redirect to the guide page - {"type": 301, "source": "/devtools", "destination": "/guide/devtools"} + {"type": 301, "source": "/devtools", "destination": "/guide/devtools"}, + + // Temporarily serve the guide at `/devtools` as well as `/guide/devtools` until users have + // their SW updated to a version that knows about the `/devtools` redirect. + {"type": 302, "source": "/generated/docs/devtools.json", "destination": "/generated/docs/guide/devtools.json"} ], "rewrites": [ {