Skip to content

Commit 76a29ec

Browse files
authored
chore: update origin to 4e4df4a (#1209)
* chore: update origin to 4e4df4a * fix: migrate untranslated files * fix(app): apply upstream changes to translated strings in src/app/features/home * fix(app): mirror upstream code changes in src/app/features/update * fix(app): apply upstream changes to translated strings in src/app/features/update * fix(app): apply upstream changes to translated strings in src/app/routing/navigation-entries * fix(docs): apply upstream wording changes in src/content/ai * fix(docs): apply upstream wording changes in src/content/guide * fix(docs): retranslate updated sections in src/content/guide * fix(docs): apply upstream wording changes in src/content/guide/animations * fix(docs): apply upstream wording changes in src/content/guide/aria * fix(docs): retranslate updated sections in src/content/guide/aria * fix(docs): mirror upstream code and link changes in src/content/guide/components * fix(docs): apply upstream wording changes in src/content/guide/components * fix(docs): retranslate updated sections in src/content/guide/di * fix(docs): apply upstream wording changes in src/content/guide/forms * fix(docs): apply upstream wording changes in src/content/guide/forms/signals * fix(docs): retranslate updated sections in src/content/guide/forms/signals * chore(docs): insert new upstream sections untranslated in src/content/guide/forms/signals * fix(docs): mirror upstream code and link changes in src/content/guide/http * fix(docs): retranslate updated sections in src/content/guide/http * fix(docs): mirror upstream code and link changes in src/content/guide/routing * fix(docs): apply upstream wording changes in src/content/guide/routing * fix(docs): retranslate updated sections in src/content/guide/routing * fix(docs): retranslate updated sections in src/content/guide/signals * fix(docs): apply upstream wording changes in src/content/guide/templates * fix(docs): retranslate updated sections in src/content/guide/templates * fix(docs): mirror upstream code and link changes in src/content/guide/testing * fix(docs): apply upstream wording changes in src/content/guide/testing * fix(docs): retranslate updated sections in src/content/guide/testing * fix(docs): mirror upstream code and link changes in src/content/introduction/essentials * fix(docs): apply upstream wording changes in src/content/reference/errors * fix(docs): retranslate updated sections in src/content/tools/cli * fix(docs): apply upstream wording changes in src/content/tools/devtools * fix(docs): apply upstream wording changes in src/content/tutorials/first-app/steps/01-hello-world * fix(docs): retranslate updated sections in src/content/tutorials/first-app/steps/02-Home * fix(docs): apply upstream wording changes in src/content/tutorials/first-app/steps/04-interfaces * fix(docs): apply upstream wording changes in src/content/tutorials/first-app/steps/05-inputs * fix(docs): apply upstream wording changes in src/content/tutorials/first-app/steps/06-property-binding * fix(docs): mirror upstream code and link changes in src/content/tutorials/learn-angular/steps/10-deferrable-views * fix(docs): apply upstream wording changes in src/content/tutorials/learn-angular/steps/11-optimizing-images * fix(docs): mirror upstream code and link changes in src/content/tutorials/learn-angular/steps/12-enable-routing * fix(docs): apply upstream wording changes in src/content/tutorials/learn-angular/steps/24-create-a-pipe * fix(docs): apply upstream wording changes in src/content/tutorials/learn-angular/steps/4-control-flow-if * fix(docs): apply upstream wording changes in src/content/tutorials/learn-angular/steps/5-control-flow-for * fix(docs): retranslate updated sections in src/content/tutorials/learn-angular/steps/7-event-handling * fix(docs): apply upstream wording changes in src/content/tutorials/signals/steps/10-reacting-to-signal-changes-with-effect * fix(docs): apply upstream wording changes in src/content/tutorials/signals/steps/2-deriving-state-with-computed-signals * fix(docs): apply upstream wording changes in src/content/tutorials/signals/steps/4-managing-async-data-with-signals * fix(docs): mirror upstream code and link changes in src/content/tutorials/signals/steps/5-component-communication-with-signals * fix(docs): add anchor IDs to all headings in expression-syntax.md
1 parent 8475045 commit 76a29ec

203 files changed

Lines changed: 1180 additions & 675 deletions

File tree

Some content is hidden

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1 tabindex="-1">Angular v22 is here!</h1>
1313
</div>
1414
</div>
1515

16-
@if (!isUwu) {
16+
@if (!uwu()) {
1717
<div class="title">
1818
<h2>Productivity<br />Meets scalability</h2>
1919
<h3>The framework for building scalable web apps with confidence</h3>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1 tabindex="-1">Angular v22がリリースされました!</h1>
1313
</div>
1414
</div>
1515

16-
@if (!isUwu) {
16+
@if (!uwu()) {
1717
<div class="title">
1818
<h2>Productivity<br />Meets scalability</h2>
1919
<h3>スケーラブルなWebアプリを確信を持って構築できるフレームワーク</h3>

‎adev-ja/src/app/features/update/update.component.en.html‎

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ <h3>Angular versions</h3>
1111
From v.
1212

1313
<button type="button" [cdkMenuTriggerFor]="templatesMenuFrom">
14-
<span>{{ from.name }}</span>
14+
<span>{{ from().name }}</span>
1515
<docs-icon>expand_more</docs-icon>
1616
</button>
1717

1818
<ng-template #templatesMenuFrom>
1919
<ul class="adev-template-dropdown" cdkMenu>
2020
@for (version of versions; track $index) {
2121
<li>
22-
<button cdkMenuItem type="button" (click)="from = version; showUpdatePath()">
22+
<button cdkMenuItem type="button" (click)="from.set(version); showUpdatePath()">
2323
<span>{{ version.name }}</span>
2424
</button>
2525
</li>
@@ -32,15 +32,15 @@ <h3>Angular versions</h3>
3232
<span class="adev-template-select">
3333
To v.
3434
<button type="button" [cdkMenuTriggerFor]="templatesMenuTo">
35-
<span>{{ to.name }}</span>
35+
<span>{{ to().name }}</span>
3636
<docs-icon>expand_more</docs-icon>
3737
</button>
3838

3939
<ng-template #templatesMenuTo>
4040
<ul class="adev-template-dropdown" cdkMenu>
4141
@for (version of versions; track $index) {
4242
<li>
43-
<button cdkMenuItem type="button" (click)="to = version; showUpdatePath()">
43+
<button cdkMenuItem type="button" (click)="to.set(version); showUpdatePath()">
4444
<span>{{ version.name }}</span>
4545
</button>
4646
</li>
@@ -51,7 +51,7 @@ <h3>Angular versions</h3>
5151
</span>
5252
</div>
5353

54-
@if (from.number >= futureVersion || to.number >= futureVersion) {
54+
@if (from().number >= futureVersion || to().number >= futureVersion) {
5555
<div class="docs-alert docs-alert-critical">
5656
<p>
5757
<strong>Warning:</strong>
@@ -61,7 +61,7 @@ <h3>Angular versions</h3>
6161
</div>
6262
}
6363

64-
@if (from.number > to.number) {
64+
@if (from().number > to().number) {
6565
<div class="docs-alert docs-alert-critical">
6666
<p>
6767
<strong>Warning:</strong>
@@ -70,7 +70,7 @@ <h3>Angular versions</h3>
7070
</div>
7171
}
7272

73-
@if (to.number - from.number > 150 && from.number > 240) {
73+
@if (to().number - from().number > 150 && from().number > 240) {
7474
<div class="docs-alert docs-alert-critical">
7575
<p>
7676
<strong>Warning:</strong>
@@ -84,19 +84,19 @@ <h3>Angular versions</h3>
8484

8585
<h3>Application complexity</h3>
8686
<mat-button-toggle-group
87-
(change)="level = $event.value; showUpdatePath()"
88-
[value]="level"
87+
(change)="level.set($event.value); showUpdatePath()"
88+
[value]="level()"
8989
style="margin-bottom: 16px"
9090
>
9191
<mat-button-toggle [value]="1">Basic</mat-button-toggle>
9292
<mat-button-toggle [value]="2">Medium</mat-button-toggle>
9393
<mat-button-toggle [value]="3">Advanced</mat-button-toggle>
9494
</mat-button-toggle-group>
95-
@if (level === 1) {
95+
@if (level() === 1) {
9696
<p>Shows information for all Angular developers.</p>
97-
} @else if (level === 2) {
97+
} @else if (level() === 2) {
9898
<p>Shows information that's of interest to more advanced Angular developers.</p>
99-
} @else if (level === 3) {
99+
} @else if (level() === 3) {
100100
<p>Shows all the information we have about this update.</p>
101101
}
102102

@@ -111,7 +111,7 @@ <h3>Other dependencies</h3>
111111
</div>
112112
}
113113

114-
@if (from.number < 600) {
114+
@if (from().number < 600) {
115115
<h4>Package Manager</h4>
116116
<mat-button-toggle-group
117117
(change)="packageManager = $event.value; showUpdatePath()"
@@ -159,8 +159,7 @@ <h3>Before you update</h3>
159159
</span>
160160
</div>
161161
</div>
162-
}
163-
@if (beforeRecommendations.length <= 0) {
162+
} @empty {
164163
<div>
165164
<em>You don't need to do anything before moving between these versions.</em>
166165
</div>
@@ -187,8 +186,7 @@ <h3>Update to the new version</h3>
187186
</span>
188187
</div>
189188
</div>
190-
}
191-
@if (duringRecommendations.length <= 0) {
189+
} @empty {
192190
<div>
193191
<em>There aren't any recommendations for moving between these versions.</em>
194192
</div>
@@ -209,8 +207,7 @@ <h3>After you update</h3>
209207
</span>
210208
</div>
211209
</div>
212-
}
213-
@if (afterRecommendations.length <= 0) {
210+
} @empty {
214211
<div>
215212
<em>You don't need to do anything after moving between these versions.</em>
216213
</div>

‎adev-ja/src/app/features/update/update.component.en.ts‎

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {Clipboard} from '@angular/cdk/clipboard';
1010
import {CdkMenu, CdkMenuItem, CdkMenuTrigger} from '@angular/cdk/menu';
11-
import {Component, inject, signal} from '@angular/core';
11+
import {afterNextRender, Component, inject, input, linkedSignal, signal} from '@angular/core';
1212
import {IconComponent} from '@angular/docs';
1313
import {MatButtonToggle, MatButtonToggleGroup} from '@angular/material/button-toggle';
1414
import {MatCheckbox} from '@angular/material/checkbox';
@@ -39,6 +39,10 @@ interface Option {
3939

4040
const isWindows = typeof window !== 'undefined' && window.navigator.userAgent.includes('Windows');
4141

42+
/** Versions selected when the URL doesn't specify any. */
43+
const DEFAULT_FROM_VERSION = '21.0';
44+
const DEFAULT_TO_VERSION = '22.0';
45+
4246
@Component({
4347
selector: 'adev-update-guide',
4448
templateUrl: './update.component.html',
@@ -61,7 +65,8 @@ export default class UpdateComponent {
6165

6266
protected title = signal('');
6367

64-
protected level = 1;
68+
/** The application complexity level, initialized from the `l` query param. */
69+
protected readonly level = linkedSignal(() => parseInt(this.levelParam() ?? '', 10) || 1);
6570
protected options: Record<string, boolean> = {
6671
ngUpgrade: false,
6772
material: false,
@@ -120,8 +125,17 @@ export default class UpdateComponent {
120125
{name: '2.1', number: 201},
121126
{name: '2.0', number: 200},
122127
];
123-
protected from = this.versions.find((version) => version.name === '21.0')!;
124-
protected to = this.versions.find((version) => version.name === '22.0')!;
128+
/** The versions to update from and to, initialized from the `v` query param. */
129+
protected readonly from = linkedSignal(
130+
() =>
131+
this.findVersion(this.versionsParam()?.split('-')[0]) ??
132+
this.findVersion(DEFAULT_FROM_VERSION)!,
133+
);
134+
protected readonly to = linkedSignal(
135+
() =>
136+
this.findVersion(this.versionsParam()?.split('-')[1]) ??
137+
this.findVersion(DEFAULT_TO_VERSION)!,
138+
);
125139
protected futureVersion = 2300;
126140

127141
protected readonly steps: Step[] = RECOMMENDATIONS;
@@ -130,19 +144,22 @@ export default class UpdateComponent {
130144
private readonly router = inject(Router);
131145
private readonly activatedRoute = inject(ActivatedRoute);
132146

147+
/** Bound from the `v` query param, in the `<from>-<to>` format (e.g. `21.0-22.0`). */
148+
readonly versionsParam = input<string>(undefined, {alias: 'v'});
149+
/** Bound from the `l` query param, the application complexity level. */
150+
readonly levelParam = input<string>(undefined, {alias: 'l'});
151+
133152
constructor() {
134-
const queryMap = this.activatedRoute.snapshot.queryParamMap;
135-
// Detect settings in URL
136-
this.level = parseInt(queryMap.get('l')!, 10) || this.level;
137-
138-
// Detect versions of from and to
139-
const versions = queryMap.get('v');
140-
if (versions) {
141-
const [from, to] = versions.split('-');
142-
this.from = this.versions.find((version) => version.name === from)!;
143-
this.to = this.versions.find((version) => version.name === to)!;
144-
this.showUpdatePath();
145-
}
153+
// Show the update path right away when the versions are provided in the URL.
154+
afterNextRender(() => {
155+
if (this.versionsParam()) {
156+
this.showUpdatePath();
157+
}
158+
});
159+
}
160+
161+
private findVersion(name: string | undefined) {
162+
return this.versions.find((version) => version.name === name);
146163
}
147164

148165
copyCode(event: Event) {
@@ -172,7 +189,7 @@ export default class UpdateComponent {
172189
this.afterRecommendations = [];
173190

174191
// Refuse to generate recommendations for downgrades
175-
if (this.to.number < this.from.number) {
192+
if (this.to().number < this.from().number) {
176193
alert('We do not support downgrading versions of Angular.');
177194
return;
178195
}
@@ -182,13 +199,13 @@ export default class UpdateComponent {
182199
const labelMedium = 'medium applications';
183200
const labelAdvanced = 'advanced applications';
184201

185-
this.title.set(`${labelTitle} v${this.from.name} -> v${this.to.name}
202+
this.title.set(`${labelTitle} v${this.from().name} -> v${this.to().name}
186203
for
187-
${this.level < 2 ? labelBasic : this.level < 3 ? labelMedium : labelAdvanced}`);
204+
${this.level() < 2 ? labelBasic : this.level() < 3 ? labelMedium : labelAdvanced}`);
188205

189206
// Find applicable steps and organize them into before, during, and after upgrade
190207
for (const step of this.steps) {
191-
if (step.level <= this.level && step.necessaryAsOf > this.from.number) {
208+
if (step.level <= this.level() && step.necessaryAsOf > this.from().number) {
192209
// Check Options
193210
// Only show steps that don't have a required option
194211
// Or when the user has a matching option selected
@@ -213,12 +230,12 @@ export default class UpdateComponent {
213230
step.renderedStep = await marked(this.replaceVariables(step.action));
214231

215232
// If you could do it before now, but didn't have to finish it before now
216-
if (step.possibleIn <= this.from.number && step.necessaryAsOf >= this.from.number) {
233+
if (step.possibleIn <= this.from().number && step.necessaryAsOf >= this.from().number) {
217234
this.beforeRecommendations.push(step);
218235
// If you couldn't do it before now, and you must do it now
219-
} else if (step.possibleIn > this.from.number && step.necessaryAsOf <= this.to.number) {
236+
} else if (step.possibleIn > this.from().number && step.necessaryAsOf <= this.to().number) {
220237
this.duringRecommendations.push(step);
221-
} else if (step.possibleIn <= this.to.number) {
238+
} else if (step.possibleIn <= this.to().number) {
222239
this.afterRecommendations.push(step);
223240
}
224241
}
@@ -227,7 +244,7 @@ export default class UpdateComponent {
227244
// Update the URL so users can link to this transition
228245
this.router.navigate([], {
229246
relativeTo: this.activatedRoute,
230-
queryParams: {v: `${this.from.name}-${this.to.name}`, l: this.level},
247+
queryParams: {v: `${this.from().name}-${this.to().name}`, l: this.level()},
231248
queryParamsHandling: 'merge',
232249
});
233250

@@ -257,8 +274,8 @@ export default class UpdateComponent {
257274

258275
private async renderPreV6Instructions(): Promise<void> {
259276
let upgradeStep: Step;
260-
const additionalDeps = this.getAdditionalDependencies(this.to.number);
261-
const angularVersion = this.getAngularVersion(this.to.number);
277+
const additionalDeps = this.getAdditionalDependencies(this.to().number);
278+
const angularVersion = this.getAngularVersion(this.to().number);
262279
const angularPackages = [
263280
'animations',
264281
'common',
@@ -274,7 +291,7 @@ export default class UpdateComponent {
274291
];
275292

276293
// Provide npm/yarn instructions for versions before 6
277-
if (this.to.number < 600) {
294+
if (this.to().number < 600) {
278295
const actionMessage = `Update all of your dependencies to the latest Angular and the right version of TypeScript.`;
279296

280297
if (isWindows) {
@@ -305,7 +322,7 @@ export default class UpdateComponent {
305322

306323
// Npm installs typescript wrong in v5, let's manually specify
307324
// https://github.com/npm/npm/issues/16813
308-
if (this.packageManager === 'npm install' && this.to.number === 500) {
325+
if (this.packageManager === 'npm install' && this.to().number === 500) {
309326
upgradeStep.action += `
310327
311328
\`npm install typescript@2.4.2 --save-exact\``;

0 commit comments

Comments
 (0)