Skip to content

Compare changes across branches, commits, tags, and more below. #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Aug 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ var_4_win: &cache_key_win_fallback v7-angular-win-node-12-{{ checksum ".bazelver

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

# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
# `build-ivy-npm-packages`.
Expand Down
2 changes: 1 addition & 1 deletion .circleci/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ setPublicVar COMPONENTS_REPO_TMP_DIR "/tmp/angular-components-repo"
setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git"
setPublicVar COMPONENTS_REPO_BRANCH "master"
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`.
setPublicVar COMPONENTS_REPO_COMMIT "f428c00465dfcf8a020237f22532480eedbd2cb6"
setPublicVar COMPONENTS_REPO_COMMIT "09e68db8ed5b1253f2fe38ff954ef0df019fc25a"


####################################################################################################
Expand Down
4 changes: 2 additions & 2 deletions aio/content/guide/architecture-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ Data binding plays an important role in communication between a template and its

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.

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.
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.

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

`{{interpolated_value | pipe_name}}`

Expand Down
2 changes: 1 addition & 1 deletion aio/content/guide/built-in-directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Angular provides *value accessors* for all of the basic HTML form elements and t

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

You don't need a value accessor for an Angular component that
you write because you can name the value and event properties
Expand Down
4 changes: 2 additions & 2 deletions aio/content/guide/cli-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ For example, your `myBuilder` folder could contain the following files.
| `src/my-builder.ts` | Main source file for the builder definition. |
| `src/my-builder.spec.ts` | Source file for tests. |
| `src/schema.json` | Definition of builder input options. |
| `builders.json` | Testing configuration. |
| `builders.json` | Builders definition. |
| `package.json` | Dependencies. See https://docs.npmjs.com/files/package.json. |
| `tsconfig.json` | [TypeScript configuration](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). |

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.
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.

<code-example language="sh">

Expand Down
6 changes: 3 additions & 3 deletions aio/content/guide/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ While following these steps, you can [explore the translated example app](#app-p

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

* [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.
* [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.
* [Import global variants of the locale data](#import-locale) for extra locale data.
* [Manage marked text with custom IDs](#custom-id) if you require more control over matching translations.

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

<div class="alert is-helpful">

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

</div>

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

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

* [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.
* [Set the source locale manually](#set-source-manually) by setting the [LOCALE_ID](api/core/LOCALE_ID "API reference for LOCALE_ID") token.
* [Import global variants of the locale data](#import-locale) for extra locale data.
* [Manage marked text with custom IDs](#custom-id) if you require more control over matching translations.

Expand Down
4 changes: 2 additions & 2 deletions aio/content/guide/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To ensure we provide a future-proof e2e testing strategy, we want to evaluate th

### Angular libraries use Ivy

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).
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).

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

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

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.

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

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.

Expand Down
48 changes: 43 additions & 5 deletions aio/content/guide/service-worker-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,27 @@ This field contains an array of asset groups, each of which defines a set of ass

```json
{
"assetGroups": [{
...
}, {
...
}]
"assetGroups": [
{
...
},
{
...
}
]
}
```

<div class="alert is-helpful">

When the ServiceWorker handles a request, it checks asset groups in the order in which they appear in `ngsw-config.json`.
The first asset group that matches the requested resource handles the request.

It is recommended that you put the more specific asset groups higher in the list.
For example, an asset group that matches `/foo.js` should appear before one that matches `*.js`.

</div>

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.

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

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.

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.

```json
{
"dataGroups": [
{
...
},
{
...
}
]
}
```

<div class="alert is-helpful">

When the ServiceWorker handles a request, it checks data groups in the order in which they appear in `ngsw-config.json`.
The first data group that matches the requested resource handles the request.

It is recommended that you put the more specific data groups higher in the list.
For example, a data group that matches `/api/foo.json` should appear before one that matches `/api/*.json`.

</div>

Data groups follow this Typescript interface:

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ module.exports = function processCliCommands(createDocMessage) {
$runBefore: ['rendering-docs'],
$process(docs) {
const navigationDoc = docs.find(doc => doc.docType === 'navigation-json');
const navigationNode = navigationDoc &&
navigationDoc.data['SideNav'].find(
node => node.children && node.children.length && node.children[0].url === 'cli');
const cliCommandsNode = navigationDoc && findCliCommandsNode(navigationDoc.data['SideNav']);

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

// Add to navigation doc
navigationNode.children.push({url: doc.path, title: `ng ${doc.name}`});
cliCommandsNode.children.push({url: doc.path, title: `ng ${doc.name}`});
}
});
}
};
};

// Look for the `CLI Commands` navigation node. It is the node whose first child has `url: 'cli'`.
// (NOTE: Using the URL instead of the title, because it is more robust.)
function findCliCommandsNode(nodes) {
// We will "recursively" check all navigation nodes and their children (in breadth-first order),
// until we find the `CLI Commands` node. Keep a list of nodes lists to check.
// (NOTE: Each item in the list is a LIST of nodes.)
const nodesList = [nodes];

while (nodesList.length > 0) {
// Get the first item from the list of nodes lists.
const currentNodes = nodesList.shift();
const cliCommandsNode = currentNodes.find(isCliCommandsNode);

// One of the nodes in `currentNodes` was the `CLI Commands` node. Return it.
if (cliCommandsNode) return cliCommandsNode;

// The `CLI Commands` node is not in `currentNodes`. Check each node's children (if any).
currentNodes.forEach(node => node.children && nodesList.push(node.children));
}

// We checked all navigation nodes and their children and did not find the `CLI Commands` node.
return undefined;
}

function isCliCommandsNode(node) {
return node.children && node.children.length && node.children[0].url === 'cli';
}

function processOptions(container, options, optionKeywords) {
container.positionalOptions = [];
container.namedOptions = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,15 @@ describe('processCliCommands processor', () => {
docType: 'navigation-json',
data: {
SideNav: [
{url: 'some/page', title: 'Some Page'}, {
{url: 'some/page', title: 'Some Page'},
{
title: 'CLI Commands',
tooltip: 'Angular CLI command reference',
children: [{'title': 'Overview', 'url': 'cli'}]
children: [{'title': 'Overview', 'url': 'cli'}],
},
{url: 'other/page', title: 'Other Page'}
]
}
{url: 'other/page', title: 'Other Page'},
],
},
};
processor.$process([command, navigation]);
expect(navigation.data.SideNav[1].title).toEqual('CLI Commands');
Expand All @@ -275,6 +276,54 @@ describe('processCliCommands processor', () => {
]);
});

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',
() => {
const command = {
docType: 'cli-command',
name: 'command1',
commandAliases: ['alias1', 'alias2'],
options: [],
path: 'cli/command1',
};
const navigation = {
docType: 'navigation-json',
data: {
SideNav: [
{url: 'some/page', title: 'Some Page'},
{
title: 'CLI Commands Grandparent',
children: [
{url: 'some/nested/page', title: 'Some Nested Page'},
{
title: 'CLI Commands Parent',
children: [
{url: 'some/more/nested/page', title: 'Some More Nested Page'},
{
title: 'CLI Commands',
tooltip: 'Angular CLI command reference',
children: [{'title': 'Overview', 'url': 'cli'}],
},
{url: 'other/more/nested/page', title: 'Other More Nested Page'},
],
},
{url: 'other/nested/page', title: 'Other Nested Page'},
],
},
{url: 'other/page', title: 'Other Page'},
],
},
};

processor.$process([command, navigation]);

const cliCommandsNode = navigation.data.SideNav[1].children[1].children[1];
expect(cliCommandsNode.title).toEqual('CLI Commands');
expect(cliCommandsNode.children).toEqual([
{url: 'cli', title: 'Overview'},
{url: 'cli/command1', title: 'ng command1'},
]);
});

it('should complain if there is no child with `cli` url', () => {
const command = {
docType: 'cli-command',
Expand Down
40 changes: 16 additions & 24 deletions goldens/circular-deps/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,7 @@
"packages/core/src/render3/assert.ts",
"packages/core/src/render3/interfaces/container.ts",
"packages/core/src/render3/interfaces/node.ts",
"packages/core/src/render3/interfaces/definition.ts",
"packages/core/src/core.ts",
"packages/core/src/metadata.ts",
"packages/core/src/di.ts",
"packages/core/src/di/index.ts",
"packages/core/src/di/injectable.ts",
"packages/core/src/di/jit/injectable.ts",
"packages/core/src/di/jit/environment.ts",
"packages/core/src/di/injector_compatibility.ts",
"packages/core/src/render3/interfaces/view.ts",
"packages/core/src/di/injector.ts",
"packages/core/src/di/r3_injector.ts",
"packages/core/src/render3/definition.ts",
Expand All @@ -247,8 +239,14 @@
"packages/core/src/render3/assert.ts",
"packages/core/src/render3/interfaces/container.ts",
"packages/core/src/render3/interfaces/node.ts",
"packages/core/src/render3/interfaces/definition.ts",
"packages/core/src/render3/interfaces/view.ts",
"packages/core/src/metadata.ts",
"packages/core/src/di.ts",
"packages/core/src/di/index.ts",
"packages/core/src/di/injectable.ts",
"packages/core/src/di/jit/injectable.ts",
"packages/core/src/di/jit/environment.ts",
"packages/core/src/di/injector_compatibility.ts",
"packages/core/src/di/injector.ts",
"packages/core/src/di/r3_injector.ts",
"packages/core/src/render3/definition.ts",
Expand All @@ -264,8 +262,9 @@
"packages/core/src/render3/assert.ts",
"packages/core/src/render3/interfaces/container.ts",
"packages/core/src/render3/interfaces/node.ts",
"packages/core/src/render3/interfaces/definition.ts",
"packages/core/src/render3/interfaces/view.ts",
"packages/core/src/render3/interfaces/definition.ts",
"packages/core/src/core.ts",
"packages/core/src/metadata.ts",
"packages/core/src/di.ts",
"packages/core/src/di/index.ts",
Expand Down Expand Up @@ -1766,27 +1765,25 @@
[
"packages/core/src/render3/interfaces/container.ts",
"packages/core/src/render3/interfaces/node.ts",
"packages/core/src/render3/interfaces/definition.ts",
"packages/core/src/render3/interfaces/view.ts"
],
[
"packages/core/src/render3/interfaces/definition.ts",
"packages/core/src/render3/interfaces/node.ts"
"packages/core/src/render3/interfaces/node.ts",
"packages/core/src/render3/interfaces/view.ts"
],
[
"packages/core/src/render3/interfaces/definition.ts",
"packages/core/src/render3/interfaces/view.ts"
],
[
"packages/core/src/render3/interfaces/definition.ts",
"packages/core/src/render3/interfaces/view.ts",
"packages/core/src/render3/interfaces/node.ts"
"packages/core/src/render3/interfaces/node.ts",
"packages/core/src/render3/interfaces/view.ts"
],
[
"packages/core/src/render3/interfaces/definition.ts",
"packages/core/src/render3/interfaces/node.ts",
"packages/core/src/render3/interfaces/view.ts",
"packages/core/src/render3/interfaces/query.ts",
"packages/core/src/render3/interfaces/node.ts"
"packages/core/src/render3/interfaces/query.ts"
],
[
"packages/core/src/render3/interfaces/query.ts",
Expand Down Expand Up @@ -1858,11 +1855,6 @@
"packages/forms/src/directives/ng_model.ts",
"packages/forms/src/directives/ng_model_group.ts"
],
[
"packages/forms/src/directives/normalize_validator.ts",
"packages/forms/src/model.ts",
"packages/forms/src/directives/shared.ts"
],
[
"packages/forms/src/directives/reactive_directives/form_control_directive.ts",
"packages/forms/src/directives/shared.ts",
Expand Down
Loading