Skip to content

Commit 729492e

Browse files
authored
feat: update origin 21.0.0 (#1088)
1 parent 5a25476 commit 729492e

File tree

427 files changed

+17155
-9229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

427 files changed

+17155
-9229
lines changed

.github/workflows/adev-preview-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- uses: bazel-contrib/setup-bazel@4fd964a13a440a8aeb0be47350db2fc640f19ca8 # 0.15.0
3333
with:
3434
bazelisk-cache: true
35-
disk-cache: true
35+
disk-cache: ${{ github.workflow }}
3636
repository-cache: true
3737
bazelrc: |
3838
# Print all the options that apply to the build.

.github/workflows/adev-production-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: bazel-contrib/setup-bazel@4fd964a13a440a8aeb0be47350db2fc640f19ca8 # 0.15.0
2525
with:
2626
bazelisk-cache: true
27-
disk-cache: true
27+
disk-cache: ${{ github.workflow }}
2828
repository-cache: true
2929
bazelrc: |
3030
# Print all the options that apply to the build.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- uses: bazel-contrib/setup-bazel@4fd964a13a440a8aeb0be47350db2fc640f19ca8 # 0.15.0
3737
with:
3838
bazelisk-cache: true
39-
disk-cache: true
39+
disk-cache: ${{ github.workflow }}
4040
repository-cache: true
4141
- run: pnpm install
4242
- run: pnpm run build
Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
@if (!hasAccepted()) {
2-
<div class="docs-cookies-popup docs-invert-mode">
3-
<p>This site uses cookies from Google to deliver its services and to analyze traffic.</p>
2+
<div class="docs-cookies-popup docs-invert-mode">
3+
<p>This site uses cookies from Google to deliver its services and to analyze traffic.</p>
44

5-
<div>
6-
<a href="https://policies.google.com/technologies/cookies" target="_blank" rel="noopener">
7-
<button type="button" class="docs-primary-btn" [attr.text]="'Learn more'" aria-label="Learn More">
5+
<div>
6+
<a
7+
href="https://policies.google.com/technologies/cookies"
8+
target="_blank"
9+
rel="noopener"
10+
class="docs-primary-btn"
11+
aria-label="Learn more about how Google uses cookies"
12+
text="Learn more"
13+
>
814
Learn more
15+
</a>
16+
17+
<button
18+
type="button"
19+
(click)="accept()"
20+
class="docs-primary-btn"
21+
text="Ok, Got it"
22+
aria-label="Ok, Got it"
23+
>
24+
Ok, Got it
925
</button>
10-
</a>
11-
<button
12-
type="button"
13-
(click)="accept()"
14-
class="docs-primary-btn"
15-
[attr.text]="'Ok, Got it'"
16-
aria-label="Ok, Got it"
17-
>
18-
Ok, Got it
19-
</button>
26+
</div>
2027
</div>
21-
</div>
2228
}
Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
@if (!hasAccepted()) {
2-
<div class="docs-cookies-popup docs-invert-mode">
3-
<p>このサイトでは、サービスの提供とトラフィックの分析のためにGoogleのクッキーを使用しています。</p>
2+
<div class="docs-cookies-popup docs-invert-mode">
3+
<p>このサイトでは、サービスの提供とトラフィックの分析のためにGoogleのクッキーを使用しています。</p>
44

5-
<div>
6-
<a href="https://policies.google.com/technologies/cookies" target="_blank" rel="noopener">
7-
<button type="button" class="docs-primary-btn" [attr.text]="'詳細を見る'" aria-label="詳細を見る">
5+
<div>
6+
<a
7+
href="https://policies.google.com/technologies/cookies"
8+
target="_blank"
9+
rel="noopener"
10+
class="docs-primary-btn"
11+
aria-label="Googleのクッキー使用方法の詳細を見る"
12+
text="詳細を見る"
13+
>
814
詳細を見る
15+
</a>
16+
17+
<button
18+
type="button"
19+
(click)="accept()"
20+
class="docs-primary-btn"
21+
text="了解しました"
22+
aria-label="了解しました"
23+
>
24+
了解しました
925
</button>
10-
</a>
11-
<button
12-
type="button"
13-
(click)="accept()"
14-
class="docs-primary-btn"
15-
[attr.text]="'了解しました'"
16-
aria-label="了解しました"
17-
>
18-
了解しました
19-
</button>
26+
</div>
2027
</div>
21-
</div>
2228
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*!
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.dev/license
7+
*/
8+
9+
import {Injectable, inject} from '@angular/core';
10+
import {NavigationItem} from '@angular/docs';
11+
import {Meta, Title} from '@angular/platform-browser';
12+
import {ActivatedRouteSnapshot, RouterStateSnapshot, TitleStrategy} from '@angular/router';
13+
14+
export const ROUTE_TITLE_PROPERTY = 'label';
15+
export const ROUTE_PARENT_PROPERTY = 'parent';
16+
export const TITLE_SUFFIX = 'Angular';
17+
export const TITLE_SEPARATOR = ' • ';
18+
export const DEFAULT_PAGE_TITLE = 'Overview';
19+
20+
export const TITLE_OG_META_TAG = 'og:title';
21+
export const TITLE_TWITTER_META_TAG = 'twitter:title';
22+
23+
export const ALL_TITLE_META_TAGS = [TITLE_OG_META_TAG, TITLE_TWITTER_META_TAG];
24+
25+
@Injectable({providedIn: 'root'})
26+
export class ADevTitleStrategy extends TitleStrategy {
27+
private readonly title = inject(Title);
28+
private readonly meta = inject(Meta);
29+
30+
constructor() {
31+
super();
32+
}
33+
34+
override updateTitle(routerState: RouterStateSnapshot) {
35+
const title = this.buildTitle(routerState);
36+
37+
if (title !== undefined) {
38+
this.title.setTitle(title);
39+
ALL_TITLE_META_TAGS.forEach((tag) => this.meta.updateTag({property: tag, content: title}));
40+
}
41+
}
42+
43+
override buildTitle(snapshot: RouterStateSnapshot): string {
44+
let route: ActivatedRouteSnapshot = snapshot.root;
45+
46+
while (route.firstChild) {
47+
route = route.firstChild;
48+
}
49+
50+
const data = route.data as NavigationItem;
51+
const routeTitle = data.label ?? '';
52+
53+
const prefix =
54+
routeTitle.startsWith(DEFAULT_PAGE_TITLE) && data.parent
55+
? `${data.parent.label}${TITLE_SEPARATOR}`
56+
: '';
57+
58+
return !!routeTitle ? `${prefix}${routeTitle}${TITLE_SEPARATOR}${TITLE_SUFFIX}` : TITLE_SUFFIX;
59+
}
60+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*!
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.dev/license
7+
*/
8+
9+
import {Injectable, inject} from '@angular/core';
10+
import {NavigationItem} from '@angular/docs';
11+
import {Meta, Title} from '@angular/platform-browser';
12+
import {ActivatedRouteSnapshot, RouterStateSnapshot, TitleStrategy} from '@angular/router';
13+
14+
export const ROUTE_TITLE_PROPERTY = 'label';
15+
export const ROUTE_PARENT_PROPERTY = 'parent';
16+
export const TITLE_SUFFIX = 'Angular 日本語版';
17+
export const TITLE_SEPARATOR = ' • ';
18+
export const DEFAULT_PAGE_TITLE = 'Overview';
19+
20+
export const TITLE_OG_META_TAG = 'og:title';
21+
export const TITLE_TWITTER_META_TAG = 'twitter:title';
22+
23+
export const ALL_TITLE_META_TAGS = [TITLE_OG_META_TAG, TITLE_TWITTER_META_TAG];
24+
25+
@Injectable({providedIn: 'root'})
26+
export class ADevTitleStrategy extends TitleStrategy {
27+
private readonly title = inject(Title);
28+
private readonly meta = inject(Meta);
29+
30+
constructor() {
31+
super();
32+
}
33+
34+
override updateTitle(routerState: RouterStateSnapshot) {
35+
const title = this.buildTitle(routerState);
36+
37+
if (title !== undefined) {
38+
this.title.setTitle(title);
39+
ALL_TITLE_META_TAGS.forEach((tag) => this.meta.updateTag({property: tag, content: title}));
40+
}
41+
}
42+
43+
override buildTitle(snapshot: RouterStateSnapshot): string {
44+
let route: ActivatedRouteSnapshot = snapshot.root;
45+
46+
while (route.firstChild) {
47+
route = route.firstChild;
48+
}
49+
50+
const data = route.data as NavigationItem;
51+
const routeTitle = data.label ?? '';
52+
53+
const prefix =
54+
routeTitle.startsWith(DEFAULT_PAGE_TITLE) && data.parent
55+
? `${data.parent.label}${TITLE_SEPARATOR}`
56+
: '';
57+
58+
return !!routeTitle ? `${prefix}${routeTitle}${TITLE_SEPARATOR}${TITLE_SUFFIX}` : TITLE_SUFFIX;
59+
}
60+
}

adev-ja/src/app/features/home/home.component.en.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
<div class="adev-home" #home>
1+
<main class="adev-home" #home>
22
<div class="banners-layer layer">
33
<div class="adev-banner-container">
4-
<a href="https://goo.gle/angular-ai-update" class="adev-banner" target="_blank">
5-
<h1 tabindex="-1">Available Now:</h1>
6-
<p class="adev-banner-cta">Angular AI Developer Event Replay</p>
4+
<a
5+
href="events/v21"
6+
class="adev-banner"
7+
target="_blank"
8+
>
9+
<h1 tabindex="-1">Angular v21 is here!</h1>
10+
<p class="adev-banner-cta">🕹️ Start your adventure</p>
711
</a>
812
</div>
913
</div>
@@ -486,4 +490,4 @@ <h3>Are you an LLM or curious about AI in Angular?</h3>
486490
</div>
487491
</div>
488492
</section>
489-
</div>
493+
</main>

adev-ja/src/app/features/home/home.component.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
<div class="adev-home" #home>
1+
<main class="adev-home" #home>
22
<div class="banners-layer layer">
33
<div class="adev-banner-container">
4-
<a href="https://goo.gle/angular-ai-update" class="adev-banner" target="_blank">
5-
<h1 tabindex="-1">最新情報:</h1>
6-
<p class="adev-banner-cta">Angular AI Developer Event Replay</p>
4+
<a
5+
href="events/v21"
6+
class="adev-banner"
7+
target="_blank"
8+
>
9+
<h1 tabindex="-1">Angular v21がリリースされました!</h1>
10+
<p class="adev-banner-cta">🕹️ 冒険を始めよう</p>
711
</a>
812
</div>
913
</div>
@@ -111,7 +115,7 @@ <h2>開発効率とスケーラビリティを両立</h2>
111115
</g>
112116
</g>
113117
</svg>
114-
<h3>AI重視</h3>
118+
<h3>AI志向</h3>
115119
<p>AIで開発を加速させるリソースと統合機能が充実</p>
116120
</div>
117121
<div class="feature">
@@ -484,4 +488,4 @@ <h3>AIとAngularの組み合わせに興味がありますか?</h3>
484488
</div>
485489
</div>
486490
</section>
487-
</div>
491+
</main>

adev-ja/src/app/features/update/recommendations.en.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,4 +2742,12 @@ export const RECOMMENDATIONS: Step[] = [
27422742
action:
27432743
'In templates parentheses are now always respected. This can lead to runtime breakages when nullish coalescing were nested in parathesis. eg `(foo?.bar).baz` will throw if `foo` is nullish as it would in native JavaScript.',
27442744
},
2745+
{
2746+
possibleIn: 2000,
2747+
necessaryAsOf: 2000,
2748+
level: ApplicationComplexity.Advanced,
2749+
step: '20.0.0_router_generate_error_redirectTo_and_canMatch_incompatible_together',
2750+
action:
2751+
'Route configurations are now validated more rigorously. Routes that combine `redirectTo` and `canMatch` protections will generate an error, as these properties are incompatible together by default.',
2752+
},
27452753
];

0 commit comments

Comments
 (0)