Skip to content

Commit 7778761

Browse files
authored
chore: update origin (#925)
1 parent 2c9e581 commit 7778761

File tree

97 files changed

+1738
-390
lines changed

Some content is hidden

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

97 files changed

+1738
-390
lines changed

.github/workflows/build-and-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
submodules: true
1818
- uses: actions/setup-node@v4
1919
with:
20-
node-version-file: 'package.json'
20+
node-version-file: '.node-version'
2121
cache: yarn
2222
- run: yarn install
2323
- run: yarn test
@@ -29,7 +29,7 @@ jobs:
2929
submodules: true
3030
- uses: actions/setup-node@v4
3131
with:
32-
node-version-file: 'package.json'
32+
node-version-file: '.node-version'
3333
cache: yarn
3434
- run: yarn install
3535
- run: yarn build
@@ -54,7 +54,7 @@ jobs:
5454
submodules: true
5555
- uses: actions/setup-node@v4
5656
with:
57-
node-version-file: 'package.json'
57+
node-version-file: '.node-version'
5858
cache: yarn
5959
- run: yarn install
6060
- run: yarn build

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.13.1

aio-ja/content/errors/NG0602.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
@name Disallowed function call inside reactive context
2+
@category runtime
3+
@shortDescription A disallowed function is called inside a reactive context
4+
5+
@description
6+
A function that is not allowed to run inside a reactive context was called from within a reactive context.
7+
8+
For example, an `effect` cannot be scheduled from within a `computed` or an actively executing effect.
9+
Avoid calling functions like `effect` as part of template expressions, as those execute in their own reactive context.
10+
11+
Computed expressions are expected to be pure.
12+
Pure means that expression do not trigger any side effects.
13+
Side effects are operations like scheduling `afterRender`, creating a new `effect`, or subscribing to observables.
14+
15+
Some operations are explicitly banned inside reactive contexts in order to avoid common pitfalls.
16+
As an example, using `afterRender` inside a `computed` will schedule new render hooks every time the computed expression evaluates.
17+
This is likely not intended and could degrade application performance.
18+
19+
### Fixing the error
20+
21+
This error guide is non-exhaustive.
22+
It captures a few common scenarios and how to address the error.
23+
24+
#### `afterRender`
25+
Move the call for `afterRender` outside of the reactive context.
26+
27+
A good place to schedule the after render hook is in the component's class constructor.
28+
Alternatively, use `untracked` to leave the reactive context and explicitly opt-out of this error.
29+
30+
#### `effect`
31+
Move the call for `effect` outside of the reactive context.
32+
33+
A good place to schedule an effect is in a `@Component`'s class constructor.
34+
35+
#### `toSignal`
36+
Move the call for `toSignal` outside of the reactive context.
37+
38+
```typescript
39+
result = computed(() => {
40+
const dataSignal = toSignal(dataObservable$);
41+
return doSomething(dataSignal());
42+
});
43+
```
44+
45+
can be refactored into:
46+
47+
```typescript
48+
dataSignal = toSignal(dataObservable$);
49+
result = computed(() => doSomething(dataSignal()));
50+
```
51+
52+
Alternatively, if this is not possible, consider manually subscribing to the observable.
53+
54+
As a last resort, use `untracked` to leave the reactive context.
55+
Be careful as leaving the reactive context can result in signal reads to be ignored inside `untracked`.
56+
57+
@debugging
58+
59+
The error message mentions the function that was unexpectedly called.
60+
Look for this function call in your application code.
61+
62+
Alternatively, the stack trace in your browser will show where the function was invoked and where it's located.

aio-ja/content/errors/NG0950.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@name Input is required but no value is available yet.
2+
@category runtime
3+
@shortDescription A required input is accessed before a value is set.
4+
5+
@description
6+
A required input was accessed but no value was bound.
7+
8+
This can happen when a required input is accessed too early in your directive or component.
9+
This is commonly happening when the input is read as part of class construction.
10+
11+
Inputs are guaranteed to be available in the `ngOnInit` lifecycle hook and afterwards.
12+
13+
## Fixing the error
14+
15+
Access the required input in reactive contexts.
16+
For example, in the template itself, inside a `computed`, or inside an effect.
17+
18+
Alternatively, access the input inside the `ngOnInit` lifecycle hook, or later.

aio-ja/content/errors/NG0951.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@name Child query result is required but no value is available.
2+
@category runtime
3+
@shortDescription Required child query result was accessed before query results were calculated or query has no matches.
4+
5+
@description
6+
Required child query (`contentChild.required` or `viewChild.required`) result was accessed before query results were calculated or query has no matches.
7+
8+
This can happen in two distinct situations:
9+
* query results were accessed before a given query could collect results;
10+
* a query was executed but didn't match any nodes and has no results as a consequence.
11+
12+
Content queries and view queries each calculate their results at different points in time:
13+
* `contentChild` results are available after a _host_ view (template where a directive declaring a query is used) is created;
14+
* `viewChild` results are available after a template of a component declaring a query is created.
15+
16+
Accessing query results before they're available results in the error described on this page. Most notably, query results are _never_ available in a constructor of the component or directive declaring a query.
17+
18+
## Fixing the error
19+
20+
`contentChild` query results can be accessed in the `AfterContentChecked` lifecycle hook, or later.
21+
`viewChild` query results can be accessed in the `AfterViewChecked` lifecycle hook, or later.
22+
23+
Make sure that a required query matches at least one node and has results at all. You can verify this by accessing query results in the lifecycle hooks listed above.

aio-ja/content/guide/angular-package-format.en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ This is because the tslib version is tied to the TypeScript version used to comp
347347

348348
## Examples
349349

350-
* [@angular/core package](https://unpkg.com/browse/@angular/core@13.0.0-rc.0)
351-
* [@angular/material package](https://unpkg.com/browse/@angular/material@13.0.0-rc.0)
350+
* [@angular/core package](https://unpkg.com/browse/@angular/core@17.0.0/)
351+
* [@angular/material package](https://unpkg.com/browse/@angular/material@17.0.0/)
352352

353353
## Definition of terms
354354

aio-ja/content/guide/angular-package-format.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ APF v10 では、プライマリエントリポイントの直接の依存関係
347347

348348
##
349349

350-
* [@angular/core パッケージ](https://unpkg.com/browse/@angular/core@13.0.0-rc.0)
351-
* [@angular/material パッケージ](https://unpkg.com/browse/@angular/material@13.0.0-rc.0)
350+
* [@angular/core パッケージ](https://unpkg.com/browse/@angular/core@17.0.0/)
351+
* [@angular/material パッケージ](https://unpkg.com/browse/@angular/material@17.0.0/)
352352

353353
## 用語の定義
354354

aio-ja/content/guide/change-detection-zone-pollution.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In the image above, there is a series of change detection calls triggered by eve
2121

2222
## Run tasks outside `NgZone`
2323

24-
In such cases, you can instruct Angular to avoid calling change detection for tasks scheduled by a given piece of code using [NgZone](/guide/zone).
24+
In such cases, you can instruct Angular to avoid calling change detection for tasks scheduled by a given piece of code using [NgZone](/api/core/NgZone).
2525

2626
```ts
2727
import { Component, NgZone, OnInit } from '@angular/core';

aio-ja/content/guide/change-detection-zone-pollution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Angular DevTools を使用すると、不要な変更検知の呼び出しを見
2121

2222
## NgZone の外でタスクを実行
2323

24-
このような場合、[NgZone](/guide/zone) を使って、特定のコードによってスケジュールされたタスクの変更検知を呼び出さないよう Angular に指示することができます。
24+
このような場合、[NgZone](/api/core/NgZone) を使って、特定のコードによってスケジュールされたタスクの変更検知を呼び出さないよう Angular に指示することができます。
2525

2626
```ts
2727
import { Component, NgZone, OnInit } from '@angular/core';

aio-ja/content/guide/component-overview.en.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,20 @@ To declare the styles within the component, add a `styles` property to the `@Com
142142

143143
The `styles` property takes an array of strings that contain the CSS rule declarations.
144144

145+
### Creating a component manually
146+
147+
Our recommendation is to make components standalone using the `standalone: true` flag in the `@Component` decorator.
148+
149+
<code-example path="component-overview/src/app/component-overview/component-overview.component.4.ts" region="standalonedeclaration"></code-example>
150+
151+
However, in the case of working with a `NgModule` based application, the component needs to be added to the proper `@NgModule`.
152+
To embed a component in a module, embed it in the array of declarations found in the `@NgModule` decorator.
153+
154+
<code-example path="component-overview/src/app/component-overview/component-overview.module.ts" region="componentmoduledeclaration"></code-example>
155+
156+
With these steps completed, your Angular component is ready for integration and use within your application.
157+
158+
145159
## Next steps
146160

147161
* For an architectural overview of components, see [Introduction to components and templates](guide/architecture-components)

0 commit comments

Comments
 (0)