Skip to content

Commit 15ff7ba

Browse files
petebacondarwinmhevery
authored andcommitted
fix(aio): update Firebase redirects and SW routes (#21763) (#22104)
Closes #21377 PR Close #21763 PR Close #22104
1 parent 615bb95 commit 15ff7ba

File tree

2 files changed

+82
-34
lines changed

2 files changed

+82
-34
lines changed

aio/firebase.json

+81-33
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,98 @@
1212
// make sure the routing RegExp in `ngsw-manifest.json` is updated accordingly.
1313
//////////////////////////////////////////////////////////////////////////////////////////////
1414

15-
// cli-quickstart.html, glossary.html, quickstart.html, server-communication.html, style-guide.html
16-
{"type": 301, "source": "/docs/ts/latest/cli-quickstart.html", "destination": "/guide/quickstart"},
17-
{"type": 301, "source": "/docs/ts/latest/glossary.html", "destination": "/guide/glossary"},
18-
{"type": 301, "source": "/docs/ts/latest/quickstart.html", "destination": "/guide/quickstart"},
19-
{"type": 301, "source": "/docs/ts/latest/guide/server-communication.html", "destination": "/guide/http"},
20-
{"type": 301, "source": "/docs/ts/latest/guide/style-guide.html", "destination": "/guide/styleguide"},
15+
// A random bad indexed page that used `api/api`
16+
{"type": 301, "source": "/api/api/:rest*", "destination": "/api/:rest*"},
2117

22-
// guide/cli-quickstart, styleguide
18+
// Guide renames
19+
{"type": 301, "source": "/docs/*/latest/cli-quickstart.html", "destination": "/guide/quickstart"},
20+
{"type": 301, "source": "/docs/*/latest/glossary.html", "destination": "/guide/glossary"},
21+
{"type": 301, "source": "/docs/*/latest/quickstart.html", "destination": "/guide/quickstart"},
22+
{"type": 301, "source": "/docs/*/latest/guide/server-communication.html", "destination": "/guide/http"},
23+
{"type": 301, "source": "/docs/*/latest/guide/style-guide.html", "destination": "/guide/styleguide"},
2324
{"type": 301, "source": "/guide/cli-quickstart", "destination": "/guide/quickstart"},
24-
{"type": 301, "source": "/styleguide", "destination": "/guide/styleguide"},
25+
{"type": 301, "source": "/guide/service-worker-getstart", "destination": "/guide/service-worker-getting-started"},
26+
{"type": 301, "source": "/guide/service-worker-comm", "destination": "/guide/service-worker-communications"},
27+
{"type": 301, "source": "/guide/service-worker-configref", "destination": "/guide/service-worker-config"},
2528

26-
// cookbook/a1-a2-quick-reference.html, cookbook/component-communication.html, cookbook/dependency-injection.html
27-
{"type": 301, "source": "/docs/ts/latest/cookbook/a1-a2-quick-reference.html", "destination": "/guide/ajs-quick-reference"},
28-
{"type": 301, "source": "/docs/ts/latest/cookbook/component-communication.html", "destination": "/guide/component-interaction"},
29-
{"type": 301, "source": "/docs/ts/latest/cookbook/dependency-injection.html", "destination": "/guide/dependency-injection-in-action"},
29+
// some top level guide pages on old site were moved below the guide folder
30+
{"type": 301, "source": "/styleguide", "destination": "/guide/styleguide"},
31+
{"type": 301, "source": "/docs/styleguide", "destination": "/guide/styleguide"},
3032

31-
// cookbook, cookbook/, cookbook/index.html
32-
{"type": 301, "source": "/docs/ts/latest/cookbook", "destination": "/docs"},
33-
{"type": 301, "source": "/docs/ts/latest/cookbook/", "destination": "/docs"},
34-
{"type": 301, "source": "/docs/ts/latest/cookbook/index.html", "destination": "/docs"},
33+
// news is now blog
34+
{"type": 301, "source": "/news*", "destination": "https://blog.angular.io/"},
3535

36-
// cookbook/*.html
37-
{"type": 301, "source": "/docs/ts/latest/cookbook/:cookbook.html", "destination": "/guide/:cookbook"},
36+
// cookbook guides were moved (and sometime renamed or removed)
37+
{"type": 301, "source": "/docs/*/latest/cookbook", "destination": "/docs"},
38+
{"type": 301, "source": "/docs/*/latest/cookbook/", "destination": "/docs"},
39+
{"type": 301, "source": "/docs/*/latest/cookbook/index.html", "destination": "/docs"},
40+
{"type": 301, "source": "/**/cookbook/ts-to-js*", "destination": "https://github.com/angular/angular/blob/master/aio/content/guide/change-log.md#es6--described-in-typescript-to-javascript-2016-11-14"},
41+
{"type": 301, "source": "/docs/*/latest/cookbook/a1-a2-quick-reference.html", "destination": "/guide/ajs-quick-reference"},
42+
{"type": 301, "source": "/docs/*/latest/cookbook/component-communication.html", "destination": "/guide/component-interaction"},
43+
{"type": 301, "source": "/docs/*/latest/cookbook/dependency-injection.html", "destination": "/guide/dependency-injection-in-action"},
44+
{"type": 301, "source": "/docs/*/latest/cookbook/:cookbook.html", "destination": "/guide/:cookbook"},
3845

39-
// docs/ts/latest/api/<package>/index/*-<type>.html (+ special case for `NgFor` which has been renamed)
40-
{"type": 301, "source": "/docs/ts/latest/api/common/index/NgFor-directive.html", "destination": "/api/common/NgForOf"},
41-
{"type": 301, "source": "/docs/ts/latest/api/:package/index/:api-*.html", "destination": "/api/:package/:api"},
46+
// Forms related code was moved from the `common` to `forms` package (and NgFor was renamed to NgForOf)
47+
{"type": 301, "source": "/**/NgFor-*", "destination": "/api/common/NgForOf"},
48+
{"type": 301, "source": "/**/api/common/index/MaxLengthValidator-*", "destination": "/api/forms/MaxLengthValidator"},
49+
{"type": 301, "source": "/**/api/common/ControlGroup*", "destination": "/api/forms/FormGroup"},
50+
{"type": 301, "source": "/**/api/common/Control*", "destination": "/api/forms/FormControl"},
51+
{"type": 301, "source": "/**/api/common/SelectControlValueAccessor-*", "destination": "/api/forms/SelectControlValueAccessor"},
52+
{"type": 301, "source": "/**/api/common/NgModel", "destination": "/api/forms/NgModel"},
4253

43-
// docs/ts/latest
44-
{"type": 301, "source": "/docs/ts/latest", "destination": "/docs"},
54+
// Animations moves, renames and removals
55+
{"type": 301, "source": "/api/animate/:rest*", "destination": "/api/animations/:rest*"},
56+
// AnimationStateDeclarationMetadata was removed
57+
{"type": 301, "source": "/**/AnimationStateDeclarationMetadata*", "destination": "/api/animations"},
58+
// `AnimationDriver` was moved to the `animations/browser` package
59+
{"type": 301, "source": "/api/platform-browser/AnimationDriver", "destination": "/api/animations/browser/AnimationDriver"},
4560

46-
// guide/*, tutorial/*, **/*
47-
{"type": 301, "source": "/docs/ts/latest/:any*", "destination": "/:any*"},
61+
// The `testing` package was renamed to `core/testing`
62+
{"type": 301, "source": "/api/testing/:api-*", "destination": "/api/core/testing/:api"},
4863

49-
// aot-compiler.md and metadata.md combined into aot-compiler.md - issue #19510
50-
{"type": 301, "source": "/guide/metadata", "destination": "/guide/aot-compiler"},
64+
// CORE_DIRECTIVES & PLATFORM_PIPES were removed and are now in the CommonModule
65+
{"type": 301, "source": "/**/CORE_DIRECTIVES*", "destination": "/api/common/CommonModule"},
66+
{"type": 301, "source": "/**/PLATFORM_PIPES*", "destination": "/api/common/CommonModule"},
5167

52-
// ngmodule.md renamed to ngmodules.md
53-
{"type": 301, "source": "/guide/ngmodule", "destination": "/guide/ngmodules"},
68+
// DirectiveMetadata is now covered by the Directive decorator
69+
{"type": 301, "source": "/**/DirectiveMetadata-*", "destination": "/api/core/Directive"},
5470

55-
// service-worker-getstart.md, service-worker-comm.md, service-worker-configref.md
56-
{"type": 301, "source": "/guide/service-worker-getstart", "destination": "/guide/service-worker-getting-started"},
57-
{"type": 301, "source": "/guide/service-worker-comm", "destination": "/guide/service-worker-communications"},
58-
{"type": 301, "source": "/guide/service-worker-configref", "destination": "/guide/service-worker-config"}
71+
// OptionalMetadata is now covered by the Optional decorator
72+
{"type": 301, "source": "/**/OptionalMetadata-*", "destination": "/api/core/Optional"},
73+
74+
// HTTP_PROVIDERS was removed and is now provided in HttpModule
75+
{"type": 301, "source": "/**/HTTP_PROVIDERS*", "destination": "/api/http/HttpModule"},
76+
77+
// URLs that use the old scheme of adding the type to the end (e.g. `SomeClass-class`)
78+
{"type": 301, "source": "/api/:package/:api-*", "destination": "/api/:package/:api"},
79+
{"type": 301, "source": "/api/:package/testing/index/:api-*", "destination": "/api/:package/testing/:api"},
80+
{"type": 301, "source": "/api/:package/testing/:api-*", "destination": "/api/:package/testing/:api"},
81+
{"type": 301, "source": "/api/upgrade/:package/index/:api-*", "destination": "/api/upgrade/:package/:api"},
82+
{"type": 301, "source": "/api/upgrade/:package/:api-*", "destination": "/api/upgrade/:package/:api"},
83+
84+
// URLs that use the old scheme before we moved the docs to the angular/angular repo
85+
{"type": 301, "source": "/docs/*/latest", "destination": "/docs"},
86+
{"type": 301, "source": "/docs/*/latest/api/", "destination": "/api"},
87+
{"type": 301, "source": "/docs/*/latest/api/:package", "destination": "/api/:package"},
88+
{"type": 301, "source": "/docs/*/latest/api/testing/:api-*", "destination": "/api/core/testing/:api"},
89+
{"type": 301, "source": "/docs/*/latest/api/:package/:api-*", "destination": "/api/:package/:api"},
90+
{"type": 301, "source": "/docs/*/latest/api/:package/index/:api-*", "destination": "/api/:package/:api"},
91+
{"type": 301, "source": "/docs/*/latest/api/:package/testing", "destination": "/api/:package/testing"},
92+
{"type": 301, "source": "/docs/*/latest/api/:package/testing/index/:api-*", "destination": "/api/:package/testing/:api"},
93+
{"type": 301, "source": "/docs/*/latest/api/platform-browser/animations/index/:api-*", "destination": "/api/platform-browser/animations/:api"},
94+
{"type": 301, "source": "/docs/*/latest/api/upgrade/:package/:api-*", "destination": "/api/upgrade/:package/:api"},
95+
{"type": 301, "source": "/docs/*/latest/api/upgrade/:package/index/:api-*", "destination": "/api/upgrade/:package/:api"},
96+
{"type": 301, "source": "/docs/*/latest/glossary", "destination": "/guide/glossary"},
97+
{"type": 301, "source": "/docs/*/latest/guide/", "destination": "/docs"},
98+
{"type": 301, "source": "/docs/*/latest/guide/lifecycle-hooks", "destination": "/guide/lifecycle-hooks"},
99+
{"type": 301, "source": "/docs/*/latest/:rest*", "destination": "/:rest*"},
100+
{"type": 301, "source": "/docs/latest/:rest*", "destination": "/:rest*"},
101+
{"type": 301, "source": "/docs/styleguide*", "destination": "/guide/styleguide"},
102+
{"type": 301, "source": "/guide/metadata", "destination": "/guide/aot-compiler"},
103+
{"type": 301, "source": "/guide/ngmodule", "destination": "/guide/ngmodules"},
104+
{"type": 301, "source": "/guide/learning-angular*", "destination": "/guide/quickstart"},
105+
{"type": 301, "source": "/testing", "destination": "/guide/testing"},
106+
{"type": 301, "source": "/testing/**", "destination": "/guide/testing"}
59107
],
60108
"rewrites": [
61109
{

aio/ngsw-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"routing": {
2020
"index": "/index.html",
2121
"routes": {
22-
"^(?!/docs/.|(?:/guide/(?:cli-quickstart|metadata|ngmodule|service-worker-(?:getstart|comm|configref)|learning-angular)|/news/?)$|/testing|/api/(?:common/NgModel|platform-browser/AnimationDriver|testing|api)).*/(?!e?stackblitz|(?:NgFor|MaxLengthValidator)-|Control(?:Group)?|AnimationStateDeclarationMetadata|CORE_DIRECTIVES|PLATFORM_PIPES|DirectiveMetadata|HTTP_PROVIDERS)[^/.]*$": {
22+
"^(?!/docs/.|(?:/guide/(?:cli-quickstart|metadata|ngmodule|service-worker-(?:getstart|comm|configref)|learning-angular)|/news)(?:\\.html|/)?$|/testing|/api/(?:.+/[^/]+-|platform-browser/AnimationDriver|testing|api/|(?:common/(?:NgModel|Control|MaxLengthValidator))|(?:[^/]+/)?(?:NgFor(?:$|-)|AnimationStateDeclarationMetadata|CORE_DIRECTIVES|PLATFORM_PIPES|DirectiveMetadata|HTTP_PROVIDERS))|.*/stackblitz(?:\\.html)?$|.*\\.[^\/.]+$)": {
2323
"match": "regex"
2424
}
2525
}

0 commit comments

Comments
 (0)