Skip to content

Commit 5238aac

Browse files
Merge pull request #514 from angular/master
Compare changes across branches, commits, tags, and more below.
2 parents 52a11e5 + 445ac15 commit 5238aac

Some content is hidden

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

50 files changed

+2163
-926
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ var_4_win: &cache_key_win_fallback v7-angular-win-node-12-{{ checksum ".bazelver
3232

3333
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the
3434
# cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable.
35-
var_5: &components_repo_unit_tests_cache_key v7-angular-components-f428c00465dfcf8a020237f22532480eedbd2cb6
36-
var_6: &components_repo_unit_tests_cache_key_fallback v7-angular-components-
35+
var_5: &components_repo_unit_tests_cache_key v9-angular-components-09e68db8ed5b1253f2fe38ff954ef0df019fc25a
36+
var_6: &components_repo_unit_tests_cache_key_fallback v9-angular-components-
3737

3838
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
3939
# `build-ivy-npm-packages`.

.circleci/env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ setPublicVar COMPONENTS_REPO_TMP_DIR "/tmp/angular-components-repo"
7474
setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git"
7575
setPublicVar COMPONENTS_REPO_BRANCH "master"
7676
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`.
77-
setPublicVar COMPONENTS_REPO_COMMIT "f428c00465dfcf8a020237f22532480eedbd2cb6"
77+
setPublicVar COMPONENTS_REPO_COMMIT "09e68db8ed5b1253f2fe38ff954ef0df019fc25a"
7878

7979

8080
####################################################################################################

aio/content/guide/architecture-components.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ Data binding plays an important role in communication between a template and its
124124

125125
Angular pipes let you declare display-value transformations in your template HTML. A class with the `@Pipe` decorator defines a function that transforms input values to output values for display in a view.
126126

127-
Angular defines various pipes, such as the [date](https://angular.io/api/common/DatePipe) pipe and [currency](https://angular.io/api/common/CurrencyPipe) pipe; for a complete list, see the [Pipes API list](https://angular.io/api?type=pipe). You can also define new pipes.
127+
Angular defines various pipes, such as the [date](api/common/DatePipe) pipe and [currency](api/common/CurrencyPipe) pipe; for a complete list, see the [Pipes API list](api?type=pipe). You can also define new pipes.
128128

129-
To specify a value transformation in an HTML template, use the [pipe operator (|)](https://angular.io/guide/template-expression-operators#pipe).
129+
To specify a value transformation in an HTML template, use the [pipe operator (|)](guide/template-expression-operators#pipe).
130130

131131
`{{interpolated_value | pipe_name}}`
132132

aio/content/guide/built-in-directives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Angular provides *value accessors* for all of the basic HTML form elements and t
140140

141141
You can't apply `[(ngModel)]` to a non-form native element or a
142142
third-party custom component until you write a suitable value accessor. For more information, see
143-
the API documentation on [DefaultValueAccessor](https://angular.io/api/forms/DefaultValueAccessor).
143+
the API documentation on [DefaultValueAccessor](api/forms/DefaultValueAccessor).
144144

145145
You don't need a value accessor for an Angular component that
146146
you write because you can name the value and event properties

aio/content/guide/cli-builder.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ For example, your `myBuilder` folder could contain the following files.
4242
| `src/my-builder.ts` | Main source file for the builder definition. |
4343
| `src/my-builder.spec.ts` | Source file for tests. |
4444
| `src/schema.json` | Definition of builder input options. |
45-
| `builders.json` | Testing configuration. |
45+
| `builders.json` | Builders definition. |
4646
| `package.json` | Dependencies. See https://docs.npmjs.com/files/package.json. |
4747
| `tsconfig.json` | [TypeScript configuration](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). |
4848

49-
You can publish the builder to `npm` (see [Publishing your Library](https://angular.io/guide/creating-libraries#publishing-your-library)). If you publish it as `@example/my-builder`, you can install it using the following command.
49+
You can publish the builder to `npm` (see [Publishing your Library](guide/creating-libraries#publishing-your-library)). If you publish it as `@example/my-builder`, you can install it using the following command.
5050

5151
<code-example language="sh">
5252

aio/content/guide/i18n.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ While following these steps, you can [explore the translated example app](#app-p
5858

5959
The following are optional practices that may be required in special cases:
6060

61-
* [Set the source locale manually](#set-source-manually) if you need to set the [LOCALE_ID](https://angular.io/api/core/LOCALE_ID "API reference for LOCALE_ID") token.
61+
* [Set the source locale manually](#set-source-manually) if you need to set the [LOCALE_ID](api/core/LOCALE_ID "API reference for LOCALE_ID") token.
6262
* [Import global variants of the locale data](#import-locale) for extra locale data.
6363
* [Manage marked text with custom IDs](#custom-id) if you require more control over matching translations.
6464

@@ -77,7 +77,7 @@ This command updates your project's `package.json` and `polyfills.ts` files to i
7777

7878
<div class="alert is-helpful">
7979

80-
For more information about `package.json` and polyfill packages, see [Workspace npm dependencies](https://angular.io/guide/npm-packages).
80+
For more information about `package.json` and polyfill packages, see [Workspace npm dependencies](guide/npm-packages).
8181

8282
</div>
8383

@@ -804,7 +804,7 @@ The following tabs show the example app and its translation files:
804804

805805
The following are optional practices that may be required in special cases:
806806

807-
* [Set the source locale manually](#set-source-manually) by setting the [LOCALE_ID](https://angular.io/api/core/LOCALE_ID "API reference for LOCALE_ID") token.
807+
* [Set the source locale manually](#set-source-manually) by setting the [LOCALE_ID](api/core/LOCALE_ID "API reference for LOCALE_ID") token.
808808
* [Import global variants of the locale data](#import-locale) for extra locale data.
809809
* [Manage marked text with custom IDs](#custom-id) if you require more control over matching translations.
810810

aio/content/guide/roadmap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To ensure we provide a future-proof e2e testing strategy, we want to evaluate th
2020

2121
### Angular libraries use Ivy
2222

23-
We are investing in the design and development of Ivy library distribution plan, which will include an update of the library package format to use Ivy compilation, unblock the deprecation of the View Engine library format, and [ngcc](https://angular.io/guide/glossary#ngcc).
23+
We are investing in the design and development of Ivy library distribution plan, which will include an update of the library package format to use Ivy compilation, unblock the deprecation of the View Engine library format, and [ngcc](guide/glossary#ngcc).
2424

2525
### Evaluate future RxJS changes (v7 and beyond)
2626

@@ -72,7 +72,7 @@ We want to unify commit message requirements and conformance across Angular repo
7272

7373
We are going to design and implement a plan to make Zone.js optional from Angular applications. This way, we will simplify the framework, improve debugging, and reduce application bundle size. Additionally, this will allow us to take advantage of native async/await syntax, which currently Zone.js does not support.
7474

75-
### Remove legacy [View Engine](https://angular.io/guide/ivy)
75+
### Remove legacy [View Engine](guide/ivy)
7676

7777
After the transition of all our internal tooling to Ivy has completed, we want to remove the legacy View Engine for smaller Angular conceptual overhead, smaller package size, lower maintenance cost, and lower complexity of the codebase.
7878

aio/content/guide/service-worker-config.md

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,27 @@ This field contains an array of asset groups, each of which defines a set of ass
5353

5454
```json
5555
{
56-
"assetGroups": [{
57-
...
58-
}, {
59-
...
60-
}]
56+
"assetGroups": [
57+
{
58+
...
59+
},
60+
{
61+
...
62+
}
63+
]
6164
}
6265
```
6366

67+
<div class="alert is-helpful">
68+
69+
When the ServiceWorker handles a request, it checks asset groups in the order in which they appear in `ngsw-config.json`.
70+
The first asset group that matches the requested resource handles the request.
71+
72+
It is recommended that you put the more specific asset groups higher in the list.
73+
For example, an asset group that matches `/foo.js` should appear before one that matches `*.js`.
74+
75+
</div>
76+
6477
Each asset group specifies both a group of resources and a policy that governs them. This policy determines when the resources are fetched and what happens when changes are detected.
6578

6679
Asset groups follow the Typescript interface shown here:
@@ -123,6 +136,31 @@ These options are used to modify the matching behavior of requests. They are pas
123136

124137
Unlike asset resources, data requests are not versioned along with the app. They're cached according to manually-configured policies that are more useful for situations such as API requests and other data dependencies.
125138

139+
This field contains an array of data groups, each of which defines a set of data resources and the policy by which they are cached.
140+
141+
```json
142+
{
143+
"dataGroups": [
144+
{
145+
...
146+
},
147+
{
148+
...
149+
}
150+
]
151+
}
152+
```
153+
154+
<div class="alert is-helpful">
155+
156+
When the ServiceWorker handles a request, it checks data groups in the order in which they appear in `ngsw-config.json`.
157+
The first data group that matches the requested resource handles the request.
158+
159+
It is recommended that you put the more specific data groups higher in the list.
160+
For example, a data group that matches `/api/foo.json` should appear before one that matches `/api/*.json`.
161+
162+
</div>
163+
126164
Data groups follow this Typescript interface:
127165

128166
```typescript

aio/tools/transforms/cli-docs-package/processors/processCliCommands.js

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ module.exports = function processCliCommands(createDocMessage) {
44
$runBefore: ['rendering-docs'],
55
$process(docs) {
66
const navigationDoc = docs.find(doc => doc.docType === 'navigation-json');
7-
const navigationNode = navigationDoc &&
8-
navigationDoc.data['SideNav'].find(
9-
node => node.children && node.children.length && node.children[0].url === 'cli');
7+
const cliCommandsNode = navigationDoc && findCliCommandsNode(navigationDoc.data['SideNav']);
108

11-
if (!navigationNode) {
9+
if (!cliCommandsNode) {
1210
throw new Error(createDocMessage(
1311
'Missing `cli` url - CLI Commands must include a first child node with url set at `cli`',
1412
navigationDoc));
@@ -24,13 +22,41 @@ module.exports = function processCliCommands(createDocMessage) {
2422
doc.optionKeywords = Array.from(optionKeywords).join(' ');
2523

2624
// Add to navigation doc
27-
navigationNode.children.push({url: doc.path, title: `ng ${doc.name}`});
25+
cliCommandsNode.children.push({url: doc.path, title: `ng ${doc.name}`});
2826
}
2927
});
3028
}
3129
};
3230
};
3331

32+
// Look for the `CLI Commands` navigation node. It is the node whose first child has `url: 'cli'`.
33+
// (NOTE: Using the URL instead of the title, because it is more robust.)
34+
function findCliCommandsNode(nodes) {
35+
// We will "recursively" check all navigation nodes and their children (in breadth-first order),
36+
// until we find the `CLI Commands` node. Keep a list of nodes lists to check.
37+
// (NOTE: Each item in the list is a LIST of nodes.)
38+
const nodesList = [nodes];
39+
40+
while (nodesList.length > 0) {
41+
// Get the first item from the list of nodes lists.
42+
const currentNodes = nodesList.shift();
43+
const cliCommandsNode = currentNodes.find(isCliCommandsNode);
44+
45+
// One of the nodes in `currentNodes` was the `CLI Commands` node. Return it.
46+
if (cliCommandsNode) return cliCommandsNode;
47+
48+
// The `CLI Commands` node is not in `currentNodes`. Check each node's children (if any).
49+
currentNodes.forEach(node => node.children && nodesList.push(node.children));
50+
}
51+
52+
// We checked all navigation nodes and their children and did not find the `CLI Commands` node.
53+
return undefined;
54+
}
55+
56+
function isCliCommandsNode(node) {
57+
return node.children && node.children.length && node.children[0].url === 'cli';
58+
}
59+
3460
function processOptions(container, options, optionKeywords) {
3561
container.positionalOptions = [];
3662
container.namedOptions = [];

aio/tools/transforms/cli-docs-package/processors/processCliCommands.spec.js

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,15 @@ describe('processCliCommands processor', () => {
258258
docType: 'navigation-json',
259259
data: {
260260
SideNav: [
261-
{url: 'some/page', title: 'Some Page'}, {
261+
{url: 'some/page', title: 'Some Page'},
262+
{
262263
title: 'CLI Commands',
263264
tooltip: 'Angular CLI command reference',
264-
children: [{'title': 'Overview', 'url': 'cli'}]
265+
children: [{'title': 'Overview', 'url': 'cli'}],
265266
},
266-
{url: 'other/page', title: 'Other Page'}
267-
]
268-
}
267+
{url: 'other/page', title: 'Other Page'},
268+
],
269+
},
269270
};
270271
processor.$process([command, navigation]);
271272
expect(navigation.data.SideNav[1].title).toEqual('CLI Commands');
@@ -275,6 +276,54 @@ describe('processCliCommands processor', () => {
275276
]);
276277
});
277278

279+
it('should detect the CLI node if it is nested in another node (as long as there is a first child node with a `cli` url',
280+
() => {
281+
const command = {
282+
docType: 'cli-command',
283+
name: 'command1',
284+
commandAliases: ['alias1', 'alias2'],
285+
options: [],
286+
path: 'cli/command1',
287+
};
288+
const navigation = {
289+
docType: 'navigation-json',
290+
data: {
291+
SideNav: [
292+
{url: 'some/page', title: 'Some Page'},
293+
{
294+
title: 'CLI Commands Grandparent',
295+
children: [
296+
{url: 'some/nested/page', title: 'Some Nested Page'},
297+
{
298+
title: 'CLI Commands Parent',
299+
children: [
300+
{url: 'some/more/nested/page', title: 'Some More Nested Page'},
301+
{
302+
title: 'CLI Commands',
303+
tooltip: 'Angular CLI command reference',
304+
children: [{'title': 'Overview', 'url': 'cli'}],
305+
},
306+
{url: 'other/more/nested/page', title: 'Other More Nested Page'},
307+
],
308+
},
309+
{url: 'other/nested/page', title: 'Other Nested Page'},
310+
],
311+
},
312+
{url: 'other/page', title: 'Other Page'},
313+
],
314+
},
315+
};
316+
317+
processor.$process([command, navigation]);
318+
319+
const cliCommandsNode = navigation.data.SideNav[1].children[1].children[1];
320+
expect(cliCommandsNode.title).toEqual('CLI Commands');
321+
expect(cliCommandsNode.children).toEqual([
322+
{url: 'cli', title: 'Overview'},
323+
{url: 'cli/command1', title: 'ng command1'},
324+
]);
325+
});
326+
278327
it('should complain if there is no child with `cli` url', () => {
279328
const command = {
280329
docType: 'cli-command',

goldens/circular-deps/packages.json

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,7 @@
223223
"packages/core/src/render3/assert.ts",
224224
"packages/core/src/render3/interfaces/container.ts",
225225
"packages/core/src/render3/interfaces/node.ts",
226-
"packages/core/src/render3/interfaces/definition.ts",
227-
"packages/core/src/core.ts",
228-
"packages/core/src/metadata.ts",
229-
"packages/core/src/di.ts",
230-
"packages/core/src/di/index.ts",
231-
"packages/core/src/di/injectable.ts",
232-
"packages/core/src/di/jit/injectable.ts",
233-
"packages/core/src/di/jit/environment.ts",
234-
"packages/core/src/di/injector_compatibility.ts",
226+
"packages/core/src/render3/interfaces/view.ts",
235227
"packages/core/src/di/injector.ts",
236228
"packages/core/src/di/r3_injector.ts",
237229
"packages/core/src/render3/definition.ts",
@@ -247,8 +239,14 @@
247239
"packages/core/src/render3/assert.ts",
248240
"packages/core/src/render3/interfaces/container.ts",
249241
"packages/core/src/render3/interfaces/node.ts",
250-
"packages/core/src/render3/interfaces/definition.ts",
251242
"packages/core/src/render3/interfaces/view.ts",
243+
"packages/core/src/metadata.ts",
244+
"packages/core/src/di.ts",
245+
"packages/core/src/di/index.ts",
246+
"packages/core/src/di/injectable.ts",
247+
"packages/core/src/di/jit/injectable.ts",
248+
"packages/core/src/di/jit/environment.ts",
249+
"packages/core/src/di/injector_compatibility.ts",
252250
"packages/core/src/di/injector.ts",
253251
"packages/core/src/di/r3_injector.ts",
254252
"packages/core/src/render3/definition.ts",
@@ -264,8 +262,9 @@
264262
"packages/core/src/render3/assert.ts",
265263
"packages/core/src/render3/interfaces/container.ts",
266264
"packages/core/src/render3/interfaces/node.ts",
267-
"packages/core/src/render3/interfaces/definition.ts",
268265
"packages/core/src/render3/interfaces/view.ts",
266+
"packages/core/src/render3/interfaces/definition.ts",
267+
"packages/core/src/core.ts",
269268
"packages/core/src/metadata.ts",
270269
"packages/core/src/di.ts",
271270
"packages/core/src/di/index.ts",
@@ -1766,27 +1765,25 @@
17661765
[
17671766
"packages/core/src/render3/interfaces/container.ts",
17681767
"packages/core/src/render3/interfaces/node.ts",
1769-
"packages/core/src/render3/interfaces/definition.ts",
17701768
"packages/core/src/render3/interfaces/view.ts"
17711769
],
17721770
[
17731771
"packages/core/src/render3/interfaces/definition.ts",
1774-
"packages/core/src/render3/interfaces/node.ts"
1772+
"packages/core/src/render3/interfaces/node.ts",
1773+
"packages/core/src/render3/interfaces/view.ts"
17751774
],
17761775
[
17771776
"packages/core/src/render3/interfaces/definition.ts",
17781777
"packages/core/src/render3/interfaces/view.ts"
17791778
],
17801779
[
1781-
"packages/core/src/render3/interfaces/definition.ts",
1782-
"packages/core/src/render3/interfaces/view.ts",
1783-
"packages/core/src/render3/interfaces/node.ts"
1780+
"packages/core/src/render3/interfaces/node.ts",
1781+
"packages/core/src/render3/interfaces/view.ts"
17841782
],
17851783
[
1786-
"packages/core/src/render3/interfaces/definition.ts",
1784+
"packages/core/src/render3/interfaces/node.ts",
17871785
"packages/core/src/render3/interfaces/view.ts",
1788-
"packages/core/src/render3/interfaces/query.ts",
1789-
"packages/core/src/render3/interfaces/node.ts"
1786+
"packages/core/src/render3/interfaces/query.ts"
17901787
],
17911788
[
17921789
"packages/core/src/render3/interfaces/query.ts",
@@ -1858,11 +1855,6 @@
18581855
"packages/forms/src/directives/ng_model.ts",
18591856
"packages/forms/src/directives/ng_model_group.ts"
18601857
],
1861-
[
1862-
"packages/forms/src/directives/normalize_validator.ts",
1863-
"packages/forms/src/model.ts",
1864-
"packages/forms/src/directives/shared.ts"
1865-
],
18661858
[
18671859
"packages/forms/src/directives/reactive_directives/form_control_directive.ts",
18681860
"packages/forms/src/directives/shared.ts",

0 commit comments

Comments
 (0)