Compare commits

..

271 Commits

Author SHA1 Message Date
8bc2f0647b release: cut the v8.2.11 release 2019-10-15 22:15:08 +00:00
b71ccc2954 docs: fix JDK url (#33168)
PR Close #33168
2019-10-15 16:53:31 +00:00
2daa838a04 docs: Update link (#33166)
Update multi-project workspace link

weblink on the angular.io website was not working, therefore, updated the multi-project workspace link.
PR Close #33166
2019-10-15 16:52:31 +00:00
a2716acf4c fix(service-worker): continue serving api requests on cache failure (#33165)
When responses are cached ok during sw initialization,
but caching throws an error when handling api response,
this response never gets to client. Fix response
delivery by catching errors, add logging and 2 test cases.
Same changes for master branch in PR #32996

Fixes #21412

PR Close #33165
2019-10-15 16:51:16 +00:00
7a0cc534df refactor(service-worker): make signatures of caching methods compatible (#32996) (#33165)
Make safe caching and unsafe caching methods compatible so they can be
swapped. Gives more flexibility when writing http response processing
code.

PR Close #32996

(cherry picked from commit 1353afc2b1)

PR Close #33165
2019-10-15 16:51:16 +00:00
5f52e63857 docs: use neutral domain name in i18n example (#33146)
PR Close #33146
2019-10-15 16:50:02 +00:00
9409dce93c docs: correct matcher description (#32970)
PR Close #32970
2019-10-14 23:47:30 +00:00
2fa788c9e6 docs: clarify static router-outlet name attribute (#32973)
PR Close #32973
2019-10-14 23:47:02 +00:00
73e667f61f docs: a typo fixed in the upgrade guide (#33054)
PR Close #33054
2019-10-14 23:46:23 +00:00
a7d5d33f0a docs: clarify http header api doc (#33038)
PR Close #33038
2019-10-14 23:45:46 +00:00
7e511e78cd docs: fix typo in guide (#33155)
PR Close #33155
2019-10-14 23:43:30 +00:00
9e76a38073 build: using the xlarge resource class for zonejs tests on CI (#33148)
Fixes #33147

PR Close #33148
2019-10-14 20:13:26 +00:00
242981963e docs: add command for creating angular workspace (#32804)
Improved documentation

Add command to create Angular workspace, it is required for executing `ng generate library <my-lib>` .

PR Close #32804
2019-10-14 16:32:47 +00:00
970df9ebaf docs: add note to build Angular locally (#31053)
I got the compiled failed error when I followed the tutorial, which should be informed in advance as there are people who might not know the dependency in the package.json if they have no former relevant experience.

PR Close #31053
2019-10-14 16:31:53 +00:00
4c7e7fbd09 docs(router): Update description and example for Resolve interface (#31810)
PR Close #31810
2019-10-10 15:28:04 -07:00
5f78456170 docs(common): Fixes typo (#33003)
PR Close #33003
2019-10-10 13:55:41 -07:00
36fd063737 docs: fix typo in guide (#32893)
PR Close #32893
2019-10-10 13:54:59 -07:00
c1b7f0370e docs: changed 'function' word in to 'steps' (#32211)
changed word for better method's interpretation.

PR Close #32211
2019-10-10 13:54:24 -07:00
882a9e3856 docs: fixed a misleading sentence (#32211)
Reading this sentence, make the reader think that the second argument strictly accepts one single animate, which is not
PR Close #32211
2019-10-10 13:54:24 -07:00
362b3e4d03 release: cut the v8.2.10 release 2019-10-09 13:55:51 -07:00
2952ea57a5 docs: correct sentence in AoT compiler guide (#33020)
PR Close #33020
2019-10-07 13:13:58 -07:00
3541e590f4 docs: fix accessibility lint rules (#32661)
Add and fix accessibility rules, bump codelyzer to support pseudo events
for template-click-events-have-key-events rule.

PR Close #32661
2019-10-07 11:22:50 -07:00
8ef0ae3561 docs: add dotnettricks to training (#32771)
PR Close #32771
2019-10-07 11:03:04 -07:00
c3ff66c1ba docs: add missing parenthesis (#31041)
PR Close #31041
2019-10-07 11:02:34 -07:00
a1d9848456 build(docs-infra): update in-memory-we-api and karma-jasmine-html-reporter version (#32892)
The `karma-jasmine-html-reporter` update also includes a fix for
taras42/karma-jasmine-html-reporter#31.

Fixes #29802

PR Close #32892
2019-10-07 10:51:20 -07:00
a3482f7076 refactor(forms): refactor Validators.email() regexp for easier comparison with WHATWG version (#32961)
As mentioned in the previous commit, the regexp used by
`Validators.email()` is a slightly enhanced version of the
[WHATWG one](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).

This commit refactors the regexp (without changing its behavior) to make
it more closely match the format of WHATWG version, so that it is easier
for people to compare it against the WHATWG one and understand the
differences.

The main changes were:
- Changing the order of characters/character classes inside `[...]`;
  e.g. `[A-Za-z]` --> `[a-zA-Z]`
- Mark all groups as non-capturing (since we do not use the captured
  values); e.g. `(foo)` --> `(?:foo)`
  (This could theoretically also have a positive performance impact, but
  I suspect JavaScript engines are already optimizing away capturing
  groups when they are not used.)

PR Close #32961
2019-10-07 10:51:01 -07:00
006af0b985 docs(forms): expand e-mail validation description (#32961)
Previously, there was no documentation of what `Validators.email()`
expects as a valid e-mail address, making it difficult for people to
determine whether it covers their requirements or not. Even more so that
the used pattern slightly deviates from the
[WHATWG version](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).
One's only option was to look at the source code and try to decipher the
regexp pattern.

This commit adds a high-level description of the validator and mentions
its similarity to and differences from the WHATWG version. It also adds
a brief explanation of the regexp's behavior and references for more
information in the source code to provide more context to
maintainers/users trying to understand the implementation in the future.

Fixes #18985
Fixes #25186
Closes #32747

PR Close #32961
2019-10-07 10:51:01 -07:00
9dc4815e39 ci: shorten the display name of init_environment steps that are shown in all jobs (#32998)
The `init_environment` custom command is used in almost all other jobs.
The this is implemented in CircleCI is that the steps of the command are
inlined into the other jobs.

Some of the `init_environment` commands are quite long and (since the
default display name for a step is its command) they clutter the
CircleCI UI. Additionally, multiple related commands are shown as
separate steps, which makes it more difficult to get to the actual steps
of a job.

This commit improves this by:
1. Defining explicit, short names for steps with long commands.
2. Grouping multiple related steps into one.

PR Close #32998
2019-10-04 08:39:21 -07:00
4263d9ea0d ci: refactor notification commands into a single parametrized one (#32745) (#32982)
notify_caretaker_on_fail and notify_dev_infra_on_fail are the same, except for the url they notify.

PR Close #32745

PR Close #32982
2019-10-03 14:14:56 -07:00
30253a7df3 ci: use CircleCI parameterized jobs (#32745) (#32982)
Parameterized jobs lets us reduce duplication of very similar jobs.

See https://circleci.com/docs/2.0/reusing-config/#authoring-parameterized-jobs for more info.

PR Close #32745

PR Close #32982
2019-10-03 14:14:56 -07:00
16b83e8e2f ci: use CircleCI commands (#32745) (#32982)
When we needed to run multiple commands in a reusable fashion, we needed to make a giant run block with multiple things inside. Using custom commands gives us a better way to do this.

See https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-commands for more info.

PR Close #32745

PR Close #32982
2019-10-03 14:14:55 -07:00
e0c10632ea ci: keep cache key fallback in a var (#32745) (#32982)
This way it's right next to the original key and it's easier to keep them in sync.

PR Close #32745

PR Close #32982
2019-10-03 14:14:55 -07:00
686b62129c ci: use CircleCI executors (#32745) (#32982)
Executors let you define custom execution contexts for jobs.

See https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-executors for more information.

PR Close #32745

PR Close #32982
2019-10-03 14:14:55 -07:00
dd2587d9e5 build: create script for setting up RBE in local dev environment (#31200)
PR Close #31200
2019-10-03 12:17:57 -07:00
2742649a52 docs(core): mark EventEmitter#__isAsync as internal to hide from API docs (#31378)
The `__isAsync` property is not part of the public API and should not
appear in the API docs.

PR Close #31378
2019-10-03 10:24:35 -07:00
eb0461d2d4 fix(docs-infra): ignore ng*Def members in API docs (#31378)
`ng*Def` properties (such as `ngInjectorDef`) are not considered part of
the public API and should not appear in the API docs. This commit adds a
filter to remove these properties from the docs metadata.

PR Close #31378
2019-10-03 10:24:35 -07:00
e24393c35b test(upgrade): add unit tests for AngularJSUrlCodec's parse method (#32976)
Add unit test coverage for new logic added in #32874 and for existing
logic that was untested.

test(upgrade): add unit tests for AngularJSUrlCodec's parse method

Add additional coverage and fix spacing

test(upgrade): add unit tests for AngularJSUrlCodec's parse method

Add unit test coverage for new logic added in #32874 and for existing
logic that was untested.

test(upgrade): add unit tests for AngularJSUrlCodec's parse method

Add additional coverage and fix spacing

test(upgrade): add unit tests for AngularJSUrlCodec's parse method

Add unit test coverage for new logic added in #32874 and for existing
logic that was untested.

test(upgrade): add unit tests for AngularJSUrlCodec's parse method

Add unit test coverage for new logic added in #32874 and for existing
logic that was untested.

test(upgrade): add unit tests for AngularJSUrlCodec's parse method

Add additional coverage and fix spacing

test(upgrade): add unit tests for AngularJSUrlCodec's parse method

Add unit test coverage for new logic added in #32874 and for existing
logic that was untested.

PR Close #32976
2019-10-03 09:55:27 -07:00
8237e958a6 docs: fix typo in attribute-directives.md (#32943)
Fixes #32924

PR Close #32943
2019-10-02 14:30:51 -07:00
9ba898d588 docs: remove Renderer2 section (#32972)
PR Close #32972
2019-10-02 13:47:50 -07:00
cd1b0c1b1f Revert "docs: move renderer2 deprecation guide into own file (#32626)" (#32972)
This reverts commit 222af38462.

PR Close #32972
2019-10-02 13:47:50 -07:00
06072e0062 Revert "docs: add undecorated classes migration faq (#32478)" (#32972)
This reverts commit bd679581e2.

PR Close #32972
2019-10-02 13:47:49 -07:00
288e0ef7b6 Revert "docs: add dynamic queries flag migration documentation (#32582)" (#32972)
This reverts commit 206fb82330.

PR Close #32972
2019-10-02 13:47:49 -07:00
88ad5052bf docs: add comment about newEvent utility function (#32001)
PR Close #32001
2019-10-02 13:28:39 -07:00
7e6644a25a docs(docs-infra): use recommended type assertion (#31042)
Angular uses tslint:recommended by default. The default for no-angle-bracket-type-assertion is true
See https://github.com/palantir/tslint/blob/master/src/configs/recommended.ts#L69

PR Close #31042
2019-10-02 13:25:40 -07:00
d533d15001 docs: add ngOnInit description (#32789)
PR Close #32789
2019-10-02 13:24:31 -07:00
d0abf1bc54 refactor(bazel): ng_module action description should include compile mode (#32955)
Similarly to `ts_library` compilation actions, the `ng_module` compile action should include
the current compile mode in the action description. This makes it consistent with `ts_library`
targets and also avoids confusion when both output flavors are requested.

Currently when both output flavors are requested (e.g. in the `ng_package` rule), both
devmode and prodmode compilations have the same action name. This is confusing and
looks like the given target is built *twice* due to a bug (which is obviously not the case though)

PR Close #32955
2019-10-02 13:21:40 -07:00
56ac18ea8c docs: fix stackblitz example polyfills (#32969)
PR Close #32969
2019-10-02 13:20:38 -07:00
11d3b19b32 release: cut the v8.2.9 release 2019-10-02 11:15:13 -07:00
d96167fc54 docs: add lib build note (#32940)
PR Close #32940
2019-10-02 10:59:06 -07:00
68fed2fc28 docs(router): fix typo for "urlUpdateStrategy" (#32960)
PR Close #32960
2019-10-02 10:58:41 -07:00
57457fb7c7 fix(upgrade): fix AngularJsUrlCodec to support Safari (#32959)
Safari throws an error when the new URL() constructor is called with an
undefined base. This change checks whether the base is undefined and
then calls the corresponding version of the URL constructor.

fix(upgrade): simplify solution by replacing undefined with ''

Co-Authored-By: Pete Bacon Darwin <pete@bacondarwin.com>

Simplify solution by replacing undefined with ''

Co-Authored-By: Pete Bacon Darwin <pete@bacondarwin.com>

fix(upgrade): Avoid passing an empty string as the base as well.

Browsers other than Safari may have issues with the empty string.

PR Close #32959
2019-10-02 10:00:48 -07:00
a2fc5774a7 docs: added '>' to ng-template closing tag. (#32939)
Fixes #32931

PR Close #32939
2019-10-02 09:44:24 -07:00
c6041b985e fix(docs-infra): show hamburger button on getting started guide (#32941)
In 1c3ee4190, the `getting-started` guide/tutorial was renamed to
`start`, but the corresponding CSS class that controls the display of
the top-left hamburger (and it automatically derived based on the URL)
was not updated.

This commit updates the class to ensure that the hamburger is not hidden
when navigating to the getting started guide.

PR Close #32941
2019-10-02 09:20:23 -07:00
b45d2e0fb1 docs: add dynamic queries flag migration documentation (#32582)
PR Close #32582
2019-10-01 17:19:06 -07:00
42f7419522 docs: emphasize headers for code examples (#32938)
PR Close #32938
2019-10-01 14:45:30 -07:00
32f5241598 docs: fix capitalization in elements docs (#32917) (#32936)
PR Close #32917

PR Close #32936
2019-10-01 14:44:50 -07:00
06e72721ca docs: clarify http response type (#32817)
PR Close #32817
2019-10-01 11:00:36 -07:00
3a80069f65 docs: fix typo in creating-libraries (#32930)
PR Close #32930
2019-10-01 10:59:02 -07:00
0818e2c799 docs(service-worker): add info about recovering from degraded Driver state (#32682)
Related to #31865

PR Close #32682
2019-09-30 14:15:35 -07:00
7b8b2d4622 docs: update inline lazy loading example to use the import syntax (#32260)
PR Close #32260
2019-09-30 12:06:02 -07:00
f6526a0872 docs: add filename headers to code examples (#32701)
PR Close #32701
2019-09-30 10:28:21 -07:00
0984022192 docs: add prompts section to schematic guide (#32728)
PR Close #32728
2019-09-30 10:27:39 -07:00
bb7603104f docs: removed duplicate "compilerOptions" property (#32449) (#32911)
PR Close #32449

PR Close #32911
2019-09-30 10:26:21 -07:00
bdea243fed docs: add missing space between "Component" and "will" in guide (#32885)
Closes angular/angular#32873

PR Close #32885
2019-09-27 15:59:29 -07:00
2397144e01 docs(router): make InitialNavigation part of the public API (#32707)
`InitialNavigation` is used in `ExtraOptions`, which is already part of
the public API. Thus, `InitialNavigation` should be too. Not publicly
exporting it from `router/index.ts` seems an omission, since the type is
already annotated with the `@publicApi` JSDoc tag.

By publicly exporting `InitialNavigation`, it will also correctly appear
in the API docs on angular.io.

PR Close #32707
2019-09-27 14:21:14 -07:00
466c754cc8 docs: fix typo in deployment guide (#32777)
The typo causes most of the callout to not appear on the page. The issue 
appears at the bottom of the "Lazy loading" section on the live site:
https://angular.io/guide/deployment#lazy-loading
PR Close #32777
2019-09-27 10:32:38 -07:00
45fee069d7 docs: correct spelling of HTMLTableCellElement in Template Syntax (#32805)
Spelling Correction in Docs

Corrected spelling; From `HTMLTableCellElment` to  `HTMLTableCellElement`.

PR Close #32805
2019-09-27 10:03:53 -07:00
432f7ce2a0 docs: fix sentence phrasing (#32846)
`In this section, you'll add a "Buy" button the product details page.` -> `In this section, you'll add a "Buy" button to the product details page.`
PR Close #32846
2019-09-27 10:03:23 -07:00
e8c34c47af docs: clarify sentence in lifecycle hooks doc (#32860)
PR Close #32860
2019-09-27 10:02:54 -07:00
e81fc14da1 fix(docs-infra): correctly run on IE11 (#32871)
Since 007282d2b, [TocService][1] uses [forEach()][2] to iterate over a
`NodeList`. This breaks in IE11, which does not support
`NodeList#forEach()`.

This commit wraps the returned `NodeList` in a regular `Array` to have
access to array methods (such as `forEach()`).

Fixes #32832

[1]: https://github.com/angular/angular/blob/fbad4ff65/aio/src/app/shared/toc.service.ts#L68
[2]: https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach

PR Close #32871
2019-09-26 17:05:39 -07:00
d5c210a2e1 docs: added link to ngRuAir podcast (#32223)
PR Close #32223
2019-09-26 07:37:55 -07:00
7dbde6f570 docs: remove extra parenthesis from inline animations snippet (#32735)
PR Close #32735
2019-09-25 12:05:22 -07:00
78de6211e3 release: cut the v8.2.8 release 2019-09-25 10:08:33 -07:00
104c786b90 docs: removed duplicated spaces in upgrade guide (#32813)
PR Close #32813
2019-09-24 14:01:43 -07:00
9680f4c991 docs: fix typo in upgrade guide (#32807)
PR Close #32807
2019-09-24 14:01:19 -07:00
e63390daf8 docs: correct default for router extra option (#32702)
PR Close #32702
2019-09-23 14:24:21 -07:00
af99f9e98e docs: edit copy on getting started step 1 (#32773)
PR Close #32773
2019-09-19 14:20:51 -07:00
8398f9d54c docs: edit copy on first step of getting started (#32751)
PR Close #32751
2019-09-18 13:37:00 -07:00
da5d91b97b release: cut the v8.2.7 release 2019-09-18 10:01:57 -07:00
ba1ef6b1a5 fix(bazel): ng_package(data) should support non-text files (#32721)
PR Close #32721
2019-09-17 15:58:43 -07:00
acebf6464e ci: build bazel saucelabs tests remotely (#32719)
PR Close #32719
2019-09-17 15:14:18 -07:00
e367aa2ca5 docs: Typo fixes in hierarchical DI guide (#32536)
Introduce minor typo fixes in the guide for hierarchical dependency injection

PR Close #32536
2019-09-17 13:37:54 -07:00
0ee2b755e2 ci: use automatic strategy selection for AngularTemplateCompile and TypeScriptCompile (#32708)
PR Close #32708
2019-09-16 16:35:54 -07:00
f213c7a643 docs: add autoprefixer backward compatability instruction (#32109)
PR Close #32109
2019-09-16 10:48:03 -07:00
947c076ff2 fix(compiler-cli): fix typo in diagnostic template info. (#32684)
Fixes #32662

PR Close #32684
2019-09-16 08:59:49 -07:00
6600bea815 ci: run ts-api-guardian test remotely on CI (#32677)
PR Close #32677
2019-09-13 15:13:45 -07:00
6cd61aeb1c ci: add @josephperrott to global approvers in CODEOWNERS (#32667)
This change aims to align the documented members in `CODEOWNERS` with
the actual members of the secret `framework-global-approvers` GitHub
team.

PR Close #32667
2019-09-13 08:55:57 -07:00
581b991432 docs: add undecorated classes migration faq (#32478)
PR Close #32478
2019-09-12 12:16:15 -07:00
4014aab300 docs: move renderer2 deprecation guide into own file (#32626)
PR Close #32626
2019-09-12 10:43:01 -07:00
b523844966 build(docs-infra): upgrade cli command docs sources to e21aeeecd (#32635)
Updating [angular#8.2.x](https://github.com/angular/angular/tree/8.2.x) from [cli-builds#8.3.x](https://github.com/angular/cli-builds/tree/8.3.x).

##
Relevant changes in [commit range](6734efe52...e21aeeecd):

**Modified**
- help/generate.json

##

PR Close #32635
2019-09-12 10:32:10 -07:00
8d322c89b7 docs: modify lazy-load module instructions for new cli flag (#32588)
PR Close #32588
2019-09-12 10:23:20 -07:00
08a7c6f0b5 ci: update codeowners to reflect GitHub team members (#32569)
PR Close #32569
2019-09-11 20:26:29 -04:00
31f06ee3f9 build: enforce proper compile mode for size-tracking test (#32613)
Ensures that the "core_all:size_test" target runs with "--define=compile=aot".
This is necessary because we don't run this test on CI currently, but if we run
it manually, we need to ensure that it runs with Ivy for proper size comparisons.

PR Close #32613
2019-09-11 20:22:29 -04:00
1c5b157f10 fix(language-service): cache module resolution (#32483)
This is a patch PR for https://github.com/angular/angular/pull/32479

This PR fixes a critical performance issue where the language
service makes a MASSIVE number of filesystem calls when performing
module resolution.
This is because there is no caching. To make matters worse, module
resolution is performed for every program change (which means every
few keystrokes trigger a massive number of fs calls).

PR Close #32483
2019-09-11 20:21:55 -04:00
38fe47316c docs: fix doc links to current version (#32566)
PR Close #32566
2019-09-11 19:27:01 -04:00
9488da0d0a docs: add header to code examples (#32563)
PR Close #32563
2019-09-11 19:26:20 -04:00
5a8c560373 docs: update CHANGELOG to include default message for 8.2.6 2019-09-11 14:06:37 -07:00
d8675c7e72 release: cut the v8.2.6 release 2019-09-11 12:41:39 -07:00
bf29bd95a6 build: remove localize as a CODEOWNERS entry (#32618)
With v544eb89198304846c8a9c488da6790a1672cac64 the CODEOWNERS file
was amended to include an entry for the `localize` angular package.
This package exists in master, but not in the `8.x` branch. This patch
removes the entry from the file so that CI will work for `8.x`.

PR Close #32618
2019-09-11 15:14:04 -04:00
1775498b40 ci: pin docker images by ID for hermeticity (#32602)
Previously, the docker images used on CI where specified by a tag
(`10.16` and `10.16-browsers`). Since tags are not immutable, this only
pins specific characteristics of the environment (e.g. the OS type and
the Node.js version), but not others. Especially when using a tag that
does not specify the patch version (e.g. `10.16` instead of `10.16.0`),
it is inevitable that the image will change at some point, potentially
leading to unrelated failures due to changes in the environment.

One source of such failures can be the Chrome version used in tests.
Since we install a specific ChromeDriver version (that is only
compatible with specific Chrome version ranges), unexpectedly updating
to a newer Chrome version may break the tests if the new version falls
outside the range of supported version for our pinned ChromeDriver.

Using a tag that specifies the patch version (e.g. `10.16.0`) or even
the OS version (e.g. `10.16.0-buster`) is safer (i.e. has a lower
probability of introducing the kind of breakages described above), but
is still not fully hermetic.

This commit prevents such breakages by pinning the docker images by ID.
Image IDs are based on the image's digest (SHA256) and are thus
immutable, ensuring that all CI jobs will be running on the exact same
image.

See [here][1] for more info on pre-built CircleCI docker images and more
specifically [pinning images by ID][2].

[1]: https://circleci.com/docs/2.0/circleci-images
[2]: https://circleci.com/docs/2.0/circleci-images#using-a-docker-image-id-to-pin-an-image-to-a-fixed-version

PR Close #32602
2019-09-11 12:34:15 -04:00
1eea575dfc ci: add missing code-owners (#32577)
PR Close #32577
2019-09-10 17:30:57 -04:00
0c624b2ca7 ci: check code-ownership on CI (#32577)
This commit expands the `lint` CircleCI job to also run the
`tools/verify-codeownership.js` script. This script verifies that some
important files/directories in the codebase have code-owners assigned in
`.github/CODEOWNERS`.

The main purpose of this change is to prevent adding new directories
(e.g. packages or docs guides/examples) without assigning appropriate
code-owners. When no code-owner is explicitly assigned, corresponding
PRs will automatically request reviews from @igorminar, who is the
"fall-back" code-owner.

PR Close #32577
2019-09-10 17:30:56 -04:00
8659451d13 test: expand the verify-codeownership.js script to also check packages (#32577)
The `aio/scripts/verify-codeownership.js` script (formerly
`verify-docs-codeownership.js`) can be used to verify whether there are
directories in the codebase that don't have a codeowner (in
`.github/CODEOWNERS`) and vice versa. It does not aim to cover all files
and directories, but do a coarse check on some important (or frequently
changing) directories.

Previously, the script only checked for API docs examples (in
`packages/examples/`) and guides (and related images and example) (in
`aio/content/`).

This commit expands the script to also check for packages (i.e.
top-level directories in `packages/`). It also renames the script from
`verify-docs-codeownership.js` to `verify-codeownership.js`, to better
reflect its new behavior.

PR Close #32577
2019-09-10 17:30:56 -04:00
2565f67956 docs: add mdb angular boilerplate to docs resources (#30448)
PR Close #30448
2019-09-10 17:22:32 -04:00
38f4dcd5e1 docs: port accessibility app from stackblitz to aio (#32377)
Fixes #32320

PR Close #32377
2019-09-10 13:11:49 -04:00
6e380cff82 ci: update i18n CODEOWNERS for @angular/localize package (#32570)
PR Close #32570
2019-09-10 13:09:12 -04:00
76a84706b6 docs: fixed typo for toh-pt5.md (#32362)
PR Close #32362
2019-09-10 13:03:37 -04:00
39302ba923 docs: fix typos in the routing and testing documentation (#32329)
PR Close #32329
2019-09-10 07:58:45 -04:00
1c71db846f docs: describe your change... (#32552)
Properly Closed Bracket for the header
PR Close #32552
2019-09-10 06:30:07 -04:00
48e4b0eb7f docs: add NG Rome MMXIX to Events resources (#31500)
PR Close #31500
2019-09-09 15:56:24 -04:00
9fd63c3ef6 docs(forms): correct parameter names in jsdoc (#32530)
PR Close #32530
2019-09-09 15:55:42 -04:00
aaea3878d9 ci: work around CIRCLE_COMPARE_URL not being available wih CircleCI Pipelines (#32537)
The commit range that is associated with a CI build is used for a couple
of things (mostly related to payload-size tracking):
- Determine whether a size change was caused by application code or
  dependencies (or both).
- Add the messages of the commits associated with the build (and thus
  the payload-size change).

NOTE: The commit range is only used on push builds.

Previously, the commit range was computed based on the
`CIRCLE_COMPARE_URL` environment variable. With [CircleCI Pipelines][1]
enabled, `CIRCLE_COMPARE_URL` is no longer available and the commit
range cannot be reliably detected.

This commit switches `CI_COMMIT_RANGE` to only include the last commit.
This can be less accurate in some rare cases, but is true in the
majority of cases (on push builds). Additionally, it stores the CircleCI
build URL in the database along with the payload data, so the relevant
info can be retrieved when needed.

[1]: https://circleci.com/docs/2.0/build-processing

PR Close #32537
2019-09-09 12:21:45 -04:00
8838a1b54c docs: edit copy and example in hierarchical injectors guide (#32501)
Fixes #32461

PR Close #32501
2019-09-06 18:28:42 -04:00
e742edca78 docs: add akita to the list of data libraries (#32505)
PR Close #32505
2019-09-06 14:58:16 -04:00
8304343e94 docs: expand abbreviation in providers guide (#32400)
The intro paragraph currently uses the DI abbreviation,
but it is clearer with DI written out and linked to the DI guide.

PR Close #32400
2019-09-05 18:59:56 -04:00
2ec91443e9 ci: re-run flaky docs examples e2e tests in test_docs_examples[_ivy] jobs (#32497)
The docs examples e2e tests have been quite flaky recently. This causes
the `test_docs_examples` and `test_docs_examples_ivy` CircleCI jobs to
often fail (and block PRs) without a real reason.

This commit adds support for re-running failed docs examples e2e tests
and configures the `test_docs_examples` and `test_docs_examples_ivy`
jobs to try running each test that fails a second time, before giving up
and marking it as failed.

Closes #31841
Closes #31842

PR Close #32497
2019-09-05 18:10:31 -04:00
be30f25da6 docs: update default path for xi18n (#32480)
PR Close #32480
2019-09-05 13:34:19 -04:00
c426a2595f docs: add Alexey Zuev to GDE resources (#32440)
PR Close #32440
2019-09-05 13:34:02 -04:00
896a8a441e docs: added note in animation keyframe offset (#32350)
Not mentioned in the docs.
Whenever offset property is used inside a keyframe's step at least once, then it must be defined to all the steps.
When read the first time, I supposed that the API automatically sets an even offset to the remaining not defined offsets, which is not

PR Close #32350
2019-09-05 13:33:27 -04:00
b1e7f4c952 fix(docs-infra): do not include GitHub links in Table of Content (#32418)
The docs template for cli commands ([cli-command.template.html][1])
includes an `h2` element with GitHub links for [long description][2].
Since the content of `h2` elements is replicated in the auto-generated
Table of Contents, the GitHub links were replicated as well (which is
undesirable).

This commit fixes it by explicitly excluding `.github-links` elements,
when extracting the content for the ToC (in
[TocService#extractHeadingSafeHtml()][3]). This is similar to what we do
for the auto-generated `.header-link` anchors.

[1]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html
[2]: https://github.com/angular/angular/blob/1537791f0/aio/tools/transforms/templates/cli/cli-command.template.html#L18
[3]: https://github.com/angular/angular/blob/1537791f0/aio/src/app/shared/toc.service.ts#L56

PR Close #32418
2019-09-05 13:33:07 -04:00
d3ee9e3926 fix(docs-infra): exclude heading anchor icon text from ToC tooltips (#32418)
The Table of Contents (ToC) is auto-generated based on the content of
heading elements on the page. At the same time, anchor links are
auto-generated and added to each heading element. Note that the Material
Icons used for the anchor icon make use of ligatures, which means that
the icons are specified by using their textual name as text content of
the icon element. As a result, the name of the icon is included in the
parent element's `textContent`.

Previously, the `TocService` used to strip off these anchor elements
when generating the content of ToC items, but not when generating the
content of their tooltips. Thus, tooltips for ToC items would
confusingly include a `link` suffix (`link` is the textual name of the
icon used in heading anchor links).

This commit fixes this by deriving the tooltip content from the
transformed text content (which already has anchor links stripped off),
instead of from the original heading content.

PR Close #32418
2019-09-05 13:33:07 -04:00
2b7116a4f3 release: cut the v8.2.5 release 2019-09-04 14:57:38 -07:00
8be20f3a3e build: fix incorrect formating which caused a broken build 2019-09-04 13:42:39 -07:00
5112669d29 refactor(benchpress): remove two mutable exports from largetable/util.ts (#32425)
Mutable exports, i.e. using this pattern

```
export let x = 0;
export function f() {
  x += 1;
}
```

is problematic to transpile to CommonJS and Goog.module systems, we are
working on banning it google internal codebase.

The workaround is adding an explcit getter function.

PR Close #32425
2019-09-04 11:44:18 -07:00
3d453fe6df docs: fix typo in structural directive example (#32459)
Fixes #32458

PR Close #32459
2019-09-04 11:36:03 -07:00
32a6972cdc docs: add app-shell production reference (#32471)
PR Close #32471
2019-09-04 11:34:17 -07:00
2cd5d4c64b docs: correct @ngtools/webpack url (#32407)
Fixes #32385

PR Close #32407
2019-09-03 12:00:20 -07:00
3248fe865f ci: re-enable chrome mobile tests on android (#32447)
With 63dff9c888, we temporarily disabled
the chrome mobile tests on Android because the launched browsers weren't
able to load the karma page through the tunnel.

The Saucelabs support responded to a ticket that we opened and said that
there were issues with those browsers which are now resolved.

PR Close #32447
2019-09-03 11:58:31 -07:00
b3ea6981cd feat(common): HttpParams fromObject accepts ReadonlyArray<string> (#31072)
Fixes #28452

PR Close #31072
2019-08-30 12:55:03 -07:00
f698a6bd73 ci: update codeowners for docs guides/examples/images (#32360)
Based on the output of `node aio\scripts\verify-docs-codeownership`, the
following guides still have no owners:

- accessibility.md
- angular-compiler-options.md
- aot-metadata-errors.md
- bazel.md
- cli-builder.md
- static-query-migration.md

PR Close #32360
2019-08-30 12:48:25 -07:00
97d2673eae test(docs-infra): expand select glob patterns in verify-docs-codeownership.js (#32360)
This allows the script to recognise some matches that it would miss
before and avoid listing them as missing.

Ideally, the script should be able to understand the globs in
`CODEOWNERS` and correctly find matching file-system paths.However, for
the limited purposes of the script (and for just a couple of relevant
globs), implementing this would be an overkill.

Implemented the "manual expansion" instead.
(We might revisit, if the needs change.)

PR Close #32360
2019-08-30 12:48:25 -07:00
4e93c4f87a test(docs-infra): modify verify-guide-codeownership.js to also check API docs examples (#32360)
This script can be used for manually checking that all docs
guides/examples/images have owners in `.github/CODEOWNERS`.

This commit adds support for also checking codeownership of API docs
examples (in `packages/examples/*`). The script is also renamed to the
more generic (and accurate) `verify-docs-codeownership.js`.

PR Close #32360
2019-08-30 12:48:25 -07:00
b5f85638f7 fix(zone.js): a path traversal attack in test (#32392)
`simple-server.js` is vulnerable to a trivial path traversal attack, i.e. an
attacker can supply a path like `../../etc/passwd` to read arbitrary files on
the server. This change fixes the issue by properly resolving the path, and then
only serving files under the current directory (as intended).

This is not really a security issue, given the code is not part of Angular, but
rather just testing infrastructure for Angular itself, and the CI servers are
not expected to contain confidential information, but still worth fixing for
code hygiene.

PR Close #32392
2019-08-30 12:44:47 -07:00
efd13d31fc build(docs-infra): upgrade cli command docs sources to 6734efe52 (#32414)
Updating [angular#8.2.x](https://github.com/angular/angular/tree/8.2.x) from [cli-builds#8.3.x](https://github.com/angular/cli-builds/tree/8.3.x).

##
Relevant changes in [commit range](ea386e045...6734efe52):

**Modified**
- help/e2e.json

##

PR Close #32414
2019-08-30 13:54:31 -04:00
3a45bef0e7 docs: add clarification regarding development in older browsers in Deployment guide (#32210)
Fixes #32199

PR Close #32210
2019-08-30 13:53:12 -04:00
5b105544fc build: mention where to find the invalid commit message, when validation fails (#32420)
Whenever someone tries to commit (by running `git commit` directly or
indirectly), a `commit-msg` git hook is run to validate the commit
message. If the validation fails, an error message is printed and the
commit is aborted.

Occasionally, people may have written a non-trivial commit message which
could turn out to be invalid (due a small typo for example). In that
case, it is frustrating to "lose" the whole message and have to write it
all over again (from memory). This is frustrating and has happened to me
enough times to finally seek a solution.

Fortunately, it turns out that git stores the last commit message in
`.git/COMMIT_EDITMSG`, so it is easy to get it back (as long as you know
where to look for it). This commit mentions this info in the validation
error to help people that might not know about it.

(This issue is probably mostly relevant for people using git from the
command-line and not through a UI, but it won't hurt in either case.)

PR Close #32420
2019-08-30 13:52:54 -04:00
4c5cfecc56 fix: update all files/directories owned by DevInfra to new DevInfra Framework team alias (#32247)
PR Close #32247
2019-08-29 12:36:18 -07:00
9d2348b9af docs: fix typo in compiler options guide (#32348)
PR Close #32348
2019-08-29 12:35:26 -07:00
e7bca0751c build: update ibazel to version that supports windows (#32390)
The `bazel-watcher` (also known as `ibazel`) currently does not work on windows. This
is because all versions before `v0.10.0` did not have official windows support. This
commit updates `ibazel` to the latest version which also comes with windows support.

PR Close #32390
2019-08-29 12:34:10 -07:00
45c909a237 ci: temporarily disable chrome mobile tests on android (#32403)
Temporarily disables saucelabs tests for Chrome Mobile on
android devices. This is because the browsers constantly do not
capture in Karma due to some connectivity issue where the
browsers are not able to load the karma page.

PR Close #32403
2019-08-29 12:29:54 -07:00
5b76b939af build: bump yarn requirement to 1.17.3 (#32344)
PR Close #32344
2019-08-28 17:14:44 -07:00
261593aab1 docs: update release notes for 8.2.4 to indicate a docs only release 2019-08-28 12:01:33 -07:00
c9ce735675 release: cut the v8.2.4 release 2019-08-28 11:00:34 -07:00
b7f95bec04 build(docs-infra): add empty codeGenApi JSDoc tag definition (#32207)
This avoids warning such as the following ([example][1]):

```
warn: Invalid tags found -
  doc "platform-browser/ɵBROWSER_SANITIZATION_PROVIDERS__POST_R3__" (const)
  from file "platform-browser/src/browser.ts"
```

[1]: https://circleci.com/gh/angular/angular/427064

PR Close #32207
2019-08-28 09:41:22 -07:00
d02573d05f docs: fix a minor typo in the HTTP guide (#32359)
"of typed" should be "of type"
PR Close #32359
2019-08-28 09:40:09 -07:00
8ff6ed6aa3 docs: fix callout header (#32325)
PR Close #32325
2019-08-28 09:06:08 -07:00
6aaf4eac89 docs(docs-infra): add note about setting up examples on Windows (#32355)
Closes #32321

PR Close #32355
2019-08-28 09:04:39 -07:00
1d0c93622d docs(service-worker): add example app for SwPush API docs (#32139)
Previously, the `SwPush` API docs were using hard-coded code snippets.

This commit switches to using code snippets from an actual example app,
which ensures that the code shown in the docs will at least continue to
compile successfully.

PR Close #32139
2019-08-27 16:18:54 -07:00
acd6c195a0 docs: add push notification usage to api doc (#32139)
PR Close #32139
2019-08-27 16:18:54 -07:00
53a9a28ec0 docs: add detail to router event doc (#32140)
PR Close #32140
2019-08-27 16:17:07 -07:00
aa8dd74176 docs: clean up formats in template syntax guide (#32197)
PR Close #32197
2019-08-27 16:14:25 -07:00
ed6dcce13b docs: update marketing resources.json with ExtAngular (#32126)
PR Close #32126
2019-08-27 16:12:32 -07:00
d170e45784 docs: change lite-server baseDir path to output folder (#32164)
In lite-server baseDir, path should be the output folder path, So need to change `baseDir="dist"` to `baseDir="dist/project-name"`

PR Close #32164
2019-08-27 15:53:38 -07:00
7033e7eb22 docs: Use ngOnInit to fetch data from services in the getting started guide (#32273)
Call data services inside ngOnInit interface implementation of components.

closes #32048

PR Close #32273
2019-08-27 09:08:26 -07:00
893123936b docs: Fix typo in singleton-services.md page (#32330)
There is a typo in the first sentence of the singleton-service.md documentation page.
PR Close #32330
2019-08-27 09:07:19 -07:00
31fcb9e036 style: align i18n angular config (#32334)
PR Close #32334
2019-08-27 09:06:52 -07:00
c303d44df6 docs: update i18n docs sample to cater for latest raw-loader version (#32334)
`raw-loader` version 2+ which is used in the CLI version 8 introduced a breaking change and now uses `export default` instead of `module.exports`.

See: https://github.com/webpack-contrib/raw-loader/blob/master/CHANGELOG.md#200-2019-03-18

Closes #32333

PR Close #32334
2019-08-27 09:06:52 -07:00
73dd43170b build: remove the deprecated aio commit message scope (#32341)
The `aio` commit message scope was renamed to `docs-infra` (which is
more descriptive) in #24295. Although it has been removed from the
documentation, the legacy `aio` scope was kept in the [list of valid
scopes][1] to cater for in-flight PRs that already used it. As a result,
it still shows up as a recommended, valid scope in the error message
shown when commit message validation fails during `git commit`. This is
misleading, especially for new contributors.

Since we have been "manually" discouraging people from using `aio`,
there should be no open PRs by now (and if there are, they should be
changed to `docs-infra`), so it is safe to remove it from the list of
allowed scopes.

Related discussion:
https://github.com/angular/angular/pull/32273#pullrequestreview-279767931

[1]: https://github.com/angular/angular/blob/3df54be9e/tools/validate-commit-message/commit-message.json#L16

PR Close #32341
2019-08-27 09:06:36 -07:00
514271ba9c docs: reference articles specifically (#32221)
PR Close #32221
2019-08-26 15:03:05 -07:00
8d18b49899 docs: add links to web.dev sw articles (#32221)
resolves issue 32218

PR Close #32221
2019-08-26 15:03:05 -07:00
6b0b7d01bf docs: fix typo in compiler options guide (#32312)
PR Close #32312
2019-08-26 11:47:40 -07:00
079773f54e ci: remove unused artifact uploads from test job (#32322)
These were initally added to allow for CircleCI to provide a better failure UI using junit data.
This information is not currently being created for bazel tests and once it is created it will
be available on the cloud status pages created by the BEP for each bazel execution.

PR Close #32322
2019-08-26 11:45:43 -07:00
b5cb120db0 docs: Update the aria-valuemax attr of the sample (#32261)
In order to be the same value as the one use here : https://stackblitz.com/edit/angular-kn5jdi?file=src%2Fapp%2Fprogress-bar.ts
PR Close #32261
2019-08-26 10:21:09 -07:00
0fb78d6c94 build(docs-infra): upgrade cli command docs sources to ea386e045 (#32298)
Updating [angular#8.2.x](https://github.com/angular/angular/tree/8.2.x) from [cli-builds#8.3.x](https://github.com/angular/cli-builds/tree/8.3.x).

##
Relevant changes in [commit range](166cd1501...ea386e045):

**Modified**
- help/generate.json

##

PR Close #32298
2019-08-26 09:33:34 -07:00
a80a8636ba docs: fix animations reference links to api pages (#32267)
The automated links for state() and group() are currently going to the
wrong api pages. Edit directs them to the correct animations api pages.

PR Close #32267
2019-08-26 09:31:26 -07:00
0878d67757 docs: fix wrong HttpEventType of HttpResponse class (#32296)
PR Close #32296
2019-08-26 09:28:57 -07:00
5e0890b3af build(docs-infra): upgrade cli command docs sources to 166cd1501 (#32286)
Updating [angular#8.2.x](https://github.com/angular/angular/tree/8.2.x) from [cli-builds#8.3.x](https://github.com/angular/cli-builds/tree/8.3.x).

##
Relevant changes in [commit range](e0055d293...166cd1501):

**Modified**
- help/add.json
- help/deploy.json

##

PR Close #32286
2019-08-23 11:03:12 -07:00
43bac21301 docs: fix http example to use correct property (#32288)
Fixes #31814

PR Close #32288
2019-08-23 09:02:06 -07:00
4df415060b docs: add information about running clang-format with Vim (#32254)
A clang-format plugin for Vim must point to the npm-installed
clang-format command. Add docs for this.

PR Close #32254
2019-08-22 15:59:14 -07:00
039d70efec docs: improve structure (#32227)
PR Close #32227
2019-08-22 13:29:49 -07:00
2a71496791 docs: fix typo (#32227)
PR Close #32227
2019-08-22 13:29:49 -07:00
617a329c24 docs: restructure the ng deploy section (#32227)
PR Close #32227
2019-08-22 13:29:49 -07:00
a00eae0b62 docs: address comments in the ng deploy guide (#32227)
PR Close #32227
2019-08-22 13:29:49 -07:00
e54dd741ef docs: fix broken links to deployment packages (#32227)
PR Close #32227
2019-08-22 13:29:48 -07:00
7b4c1cdbe4 docs: add ng deploy to the deployment guide (#32227)
PR Close #32227
2019-08-22 13:29:48 -07:00
5e4babeaa9 docs: update http guide (#32045)
PR Close #32045
2019-08-22 06:39:56 -07:00
f661f460bb docs(upgrade): position old setup guide as legacy until it can be removed (#32193)
PR Close #32193
2019-08-21 15:20:48 -07:00
44f233c02c docs: edit and organize aot doc (#32028)
PR Close #32028
2019-08-21 15:19:30 -07:00
31e8a52722 release: cut the v8.2.3 release 2019-08-21 13:28:20 -07:00
e3c9f9d794 ci: update material-unit-tests commit [patch] (#32244)
Updates the SHA that will be tested against in the `material-unit-tests` job
to the latest commit in the components repository. SHA 18b9ef3f5529f0fa8f034944681486447af7b879
is needed in order to make the newly introduced material-ci test blocklist effective.

Patch version of #32243.

PR Close #32244
2019-08-21 11:49:43 -07:00
e7c4e94c9a docs: update collaborators page (#32229)
PR Close #32229
2019-08-21 08:26:44 -07:00
26dc826821 docs: change to global approvers (#31940)
PR Close #31940
2019-08-20 16:47:16 -07:00
287247ef05 ci: update material commit we use to run integration tests (#32224)
PR Close #32224
2019-08-20 14:37:38 -07:00
af170d2ae9 ci: exclude the upstream g3 branch from building on CI (#32202)
We don't need to build this branch as it's informative for the purposes of figuring out
the diff between the master and what's synced into google3.

PR Close #32202
2019-08-20 09:55:56 -07:00
a01ed0d7b4 refactor(core): remove disabled injectable-pipe migration (#32184) (#32206)
Initially the plan was to have a migration that adds `@Injectable()` to
all pipes in a CLI project so that the pipes can be injected in Ivy
similarly to how it worked in view engine.

Due to the planned refactorings which ensure that `@Directive`, `@Component`
and `@Pipe` also have a factory definition, this migration is no longer
needed for Ivy. Additionally since it is already disabled (due to
572b54967c) and we have a more generic
migration (known as `missing-injectable)` that could do the same as
`injectable-pipe`, we remove the migration from the code-base.

PR Close #32184

PR Close #32206
2019-08-20 09:48:10 -07:00
a7b94783b5 fix(bazel): pin @microsoft/api-extractor (#32187)
The API of `@microsoft/api-extractor` changed in a minor version which is causes an error when using dts flattening downstream.

API wil be updated on master https://github.com/angular/angular/pull/32185

PR Close #32187
2019-08-19 15:42:45 -07:00
789dd6a0da docs(service-worker): mention that dataGroups only cache non-mutating requests (#32142)
Fixes #28988

PR Close #32142
2019-08-19 10:11:28 -07:00
e5b18e810c build(docs-infra): upgrade cli command docs sources to e0055d293 (#32175)
Updating [angular#8.2.x](https://github.com/angular/angular/tree/8.2.x) from [cli-builds#8.3.x](https://github.com/angular/cli-builds/tree/8.3.x).

##
Relevant changes in [commit range](43fc440c0...e0055d293):

**Added**
- help/deploy.json

**Modified**
- help/generate.json
- help/new.json
- help/serve.json

##

PR Close #32175
2019-08-19 10:09:09 -07:00
b8f86ad7d5 ci: move bazel saucelabs execution to script to be used across all Angular repos (#32141)
PR Close #32141
2019-08-16 09:57:23 -07:00
6f2e8afaed docs: fix typo of Typescript to TypeScript (#32153)
PR Close #32153
2019-08-15 12:44:42 -07:00
699c705a8d docs: clarify hierarchical injectors (#28700)
PR Close #28700
2019-08-15 12:43:51 -07:00
adc869ff88 build: add ngcc as a valid commit message scope (#32144)
PR Close #32144
2019-08-15 10:33:37 -07:00
46f2dcc470 build(docs-infra): upgrade cli command docs sources to 43fc440c0 (#32148)
Updating [angular#8.2.x](https://github.com/angular/angular/tree/8.2.x) from [cli-builds#8.2.x](https://github.com/angular/cli-builds/tree/8.2.x).

##
Relevant changes in [commit range](de49294bf...43fc440c0):

**Modified**
- help/serve.json

##

PR Close #32148
2019-08-15 09:54:24 -07:00
2d9c4c1d82 docs(router): fix router description (#32136)
PR Close #32136
2019-08-14 14:09:02 -07:00
0757702d63 docs: add guide to reproduce material-unit-test failures locally (#32138)
Adds a new guide that can be used to reproduce failures
reported in the `material-unit-tests` job locally.

The document should live in the framework repository as
the package building scripts are local to the framework
repository.

PR Close #32138
2019-08-14 12:02:13 -07:00
174777443d ci: remove material-unit-tests failure blocklist (#32138)
Initially when the `material-unit-tests` job got wired up,
Ivy was not really backwards-compatible and a few bugs caused
test failures when running the Angular Material test suites w/ Ivy.

These bugs got fixed progressively and eventually the test
blocklist became empty. At this point we don't want to regress
in the future and the blocklist should never have new items.

Additionally since we switched the unit-tests job to run against
Angular Material `master` with Bazel, the blocklist is no
longer respected. Therefore we can safely remove the blocklist.

PR Close #32138
2019-08-14 12:02:13 -07:00
baf2d9ddbc fix(docs-infra): fix broken toc ul styles (#32124)
Fixes #32027

PR Close #32124
2019-08-14 12:01:18 -07:00
da444984a8 docs: add info about reviewing PRs from code owners (#32108)
PR Close #32108
2019-08-14 11:59:14 -07:00
84a3daf609 docs: doc browser support for service workers (#32046)
PR Close #32046
2019-08-14 11:58:21 -07:00
c88cdea9ac build(core): add missing tsconfig-build.json dependency (#31943)
For some reason (on OS/X) this transitive dependency is not being passed
through to the final TS builds that rely on this rule, so the build fails
with a missing file error:

```
The specified path does not exist:
'/.../sandbox/darwin-sandbox/451/execroot/angular/packages/tsconfig-build.json'.
```

PR Close #31943
2019-08-14 11:56:14 -07:00
7b3bd219f7 build: ensure schematics are built with typescript strict flag (#31967)
Follow-up to #30993 where we build all Angular packages with
the TypeScript `--strict` flag. The flag improves overall code
health and also helps us catch issues easier.

PR Close #31967
2019-08-13 11:39:01 -07:00
dc76c14e31 docs: edit location doc (#32042)
PR Close #32042
2019-08-13 11:37:14 -07:00
0ffc1d0d21 docs: update marketing resources with Angular UI Toolkit (#31969)
PR Close #31969
2019-08-13 11:36:37 -07:00
3d1b82be67 docs: correct description of animation example (#32009)
PR Close #32009
2019-08-13 11:16:32 -07:00
dec7e5286f ci: use local strategy for AngularTemplateCompile and TypescriptCompile on CI (#32112)
PR Close #32112
2019-08-13 09:57:51 -07:00
2f812f31d5 docs: update events page and fix ordering (#32106)
PR Close #32106
2019-08-13 09:57:28 -07:00
18bac15ddd ci: add ivy commits to generated CHANGELOG (#32114)
Historically, we've cleaned Ivy commits out of the CHANGELOG because
Ivy was not available except as a preview. Given that Ivy will soon
be the default in 9.0.0, it no longer makes sense to remove the Ivy
commits from the log. This changes the gulp changelog task so that
Ivy commits are included by default.

PR Close #32114
2019-08-12 16:03:37 -07:00
a1fe52b41c docs: format currency api (#32107)
PR Close #32107
2019-08-12 15:16:15 -07:00
033fc3e6e5 release: cut the v8.2.2 release 2019-08-12 13:19:30 -07:00
76854287e5 Revert "fix(compiler): do not remove whitespace wrapping i18n expansions (#31962)" (#32110)
This reverts commit 6ec91dd4ca because it contains
a breaking change (and thus should only be on the master branch).

PR Close #32110
2019-08-12 13:15:19 -07:00
972550ee08 style: fix inline comment typo (#32090)
PR Close #32090
2019-08-12 07:06:01 -07:00
c67f490d28 build: ensure fixup commits match an earlier, unmerged commit (#32023)
Previously, `validate-commit-message` would treat `fixup! `-prefixed
commits like this:
- It would strip the `fixup! ` prefix.
- It would validate the rest of the commit message header as any other
  commit.

However, fixup commits are special in that they need to exactly match an
earlier commit message header (sans the `fixup! ` prefix) in order for
git to treat them correctly. Otherwise, they will not be squashed into
the original commits and will be merged as is. Fixup commits can end up
not matching their original commit for several reasons (e.g. accidental
typo, changing the original commit message, etc.).

This commit prevents invalid fixup commits to pass validation by
ensuring that they match an earlier (unmerged) commit (i.e. a commit
between the current HEAD and the BASE commit).

NOTE: This new behavior is currently not activated in the pre-commit git
      hook, that is used to validate commit messages (because the
      preceding, unmerged commits are not available there). It _is_
      activated in `gulp validate-commit-message`, which is run as part
      of the `lint` job on CI and thus will detect invalid commits,
      before their getting merged.

PR Close #32023
2019-08-09 15:12:38 -07:00
edd6cb5865 fix: do not allow squash! commits when merging (#32023)
While `fixup! ` is fine, `squash! ` means that the commit message needs
tweaking, which cannot be done automatically during merging (i.e. it
should be done by the PR author).

Previously, `validate-commit-message` would always allow
`squash! `-prefixed commits, which would cause problems during merging.

This commit changes `validate-commit-message` to make it configurable
whether such commits are allowed and configures the
`gulp validate-commit-message` task, which is run as part of the `lint`
job on CI, to not allow them.

NOTE: This new check is disabled in the pre-commit git hook that is used
      to validate commit messages, because these commits might still be
      useful during development.

PR Close #32023
2019-08-09 15:12:38 -07:00
7b2617f087 refactor: clean up validate-commit-message script (#32023)
This sets the ground for adding stricter rules for fixup commits in a
follow-up PR.

PR Close #32023
2019-08-09 15:12:38 -07:00
d9d06899f4 test: clean up and re-organize validate-commit-message tests (#32023)
Mainly making the tests more closely follow the order of checks in the
function implementation, so that it is easier to follow.

PR Close #32023
2019-08-09 15:12:38 -07:00
eccb60cd6e test: update golden files (#32069)
PR Close #32069
2019-08-09 14:15:25 -07:00
3420d2923a fix(bazel): disable treeshaking when generating FESM and UMD bundles (#32069)
There has been a regression where enabling rollup treeshaking causes errors during runtime because it will drop const access which will always evaluate to true or false. However, such `const` in `@angular/core` cannot be dropped because their value is changed when NGCC is run on `@angular/core`

VE
```
const SWITCH_IVY_ENABLED__POST_R3__ = true;
const SWITCH_IVY_ENABLED__PRE_R3__ = false;
const ivyEnabled = SWITCH_IVY_ENABLED__PRE_R3__;
```

Ivy (After NGCC)
```
const SWITCH_IVY_ENABLED__POST_R3__ = true;
const SWITCH_IVY_ENABLED__PRE_R3__ = false;
const ivyEnabled = SWITCH_IVY_ENABLED__POST_R3__;
```

FESM2015
```
load(path) {
	/** @type {?} */
	const legacyOfflineMode = this._compiler instanceof Compiler;
	return legacyOfflineMode ? this.loadFactory(path) : this.loadAndCompile(path);
}
```

ESM2015
```
 load(path) {
	/** @type {?} */
	const legacyOfflineMode = !ivyEnabled && this._compiler instanceof Compiler;
	return legacyOfflineMode ? this.loadFactory(path) : this.loadAndCompile(path);
}
```

From the above we can see that `ivyEnabled ` is being treeshaken away when generating the FESM bundle which is causing runtime errors such as `Cannot find module './lazy/lazy.module.ngfactory'` since in Ivy we will always load the factories.

PR Close #32069
2019-08-09 14:15:25 -07:00
6ec91dd4ca fix(compiler): do not remove whitespace wrapping i18n expansions (#31962)
Similar to interpolation, we do not want to completely remove whitespace
nodes that are siblings of an expansion.

For example, the following template

```html
<div>
  <strong>items left<strong> {count, plural, =1 {item} other {items}}
</div>
```

was being collapsed to

```html
<div><strong>items left<strong>{count, plural, =1 {item} other {items}}</div>
```

which results in the text looking like

```
items left4
```

instead it should be collapsed to

```html
<div><strong>items left<strong> {count, plural, =1 {item} other {items}}</div>
```

which results in the text looking like

```
items left 4
```

---

**Analysis of the code and manual testing has shown that this does not cause
the generated ids to change, so there is no breaking change here.**

PR Close #31962
2019-08-09 12:03:51 -07:00
90ddee7a71 ci: remove codefresh config and supporting files (#32058)
PR Close #32058
2019-08-09 10:53:21 -07:00
3300331691 docs: clarify pipe naming (#31806)
PR Close #31806
2019-08-09 10:45:49 -07:00
6f3414bd68 docs: fix cli builder doc (#31305)
PR Close #31305
2019-08-09 10:42:23 -07:00
1b0bd6b706 release: cut the v8.2.1 release 2019-08-08 13:42:58 -07:00
cfaefa9964 fix(ivy): set LOCALE_ID when using the injector (#31983)
In `BrowserModule` the value of `LOCALE_ID` is defined in the `APPLICATION_MODULE_PROVIDERS` after `APP_INITIALIZER` has run.
This PR ensures that `LOCALE_ID` is also set for ivy at the same moment which allows the application to fetch the locale from a backend (for example).

Fixes #31465

FW-1436 #resolve

PR Close #31983
2019-08-08 12:49:58 -07:00
a48376b26a docs(router): rename incorrect class names (#31815)
PR Close #31815
2019-08-08 12:16:47 -07:00
e6d8274c38 docs: correct description of output decorator and add links to guide (#31780)
PR Close #31780
2019-08-08 12:15:29 -07:00
40df016390 docs: update rxjs refs (#31780)
PR Close #31780
2019-08-08 12:15:29 -07:00
eee75c2eea docs: add note on compatibility mode (#31808)
PR Close #31808
2019-08-08 12:13:57 -07:00
96aefc5019 docs: remove download for testing examples (#31949)
Examples for testing are designed specifically to run in StackBlitz and
are not regular cli projects (e.g. their `main.ts` files may load and run
tests instead of bootstrapping an app). They are not intended to be
downloaded and built/run locally using the cli.

In order to avoid confusing users, this commit removes the download links
from the guide. If desired, the projects can still be exported locally
via StackBlitz's UI.

Related to #31020 and #31937.

PR Close #31949
2019-08-08 12:13:29 -07:00
038d823943 docs: remove extraneous word from sentence in styleguide (#32038)
PR Close #32038
2019-08-08 11:43:12 -07:00
19095835a4 docs: add missing Oxford comma in styleguide (#32040)
PR Close #32040
2019-08-08 11:42:37 -07:00
b560207bf5 build(docs-infra): ensure the locally built packages exist and are up-to-date in yarn setup-local (#31985)
The `setup-local` npm script uses `NgPackagesInstaller` to replace the
Angular packages with the locally built ones. Previously, it would (a)
assume that the packages were built and (b) it would do anything if the
currently installed versions already correspond to locally built
packages (even if not the latest version).
This could lead to all sorts of errors, such as:
- Confusing error messages, `dist/packages-dist/` was missing.
- Using outdated build artifacts from `dist/packages-dist/` without a
  warning.
- Not installing the latest locally built packages, because the ones
  installed already corresponded to locally built (but older) ones.

This commit fixes these issues by ensuring that:
- The local packages are always built before being used by
  `NgPackagesInstaller`.
- The local packages are installed, even if the ones install already
  correspond to local packages.

NOTE: Special `*-ci` scripts are introduced (for use on CI) that skip
      building the local packages, since that step would have been taken
      care of (in a more efficient way) in a previous CI step.

PR Close #31985
2019-08-08 11:30:38 -07:00
c5de1fb05f fix(docs-infra): correctly handle multiple occurrences of an option in NgPackagesInstaller (#31985)
PR Close #31985
2019-08-08 11:30:38 -07:00
62a9843ed0 feat(docs-infra): support building the local Angular packages in NgPackagesInstaller (#31985)
Previously, when `NgPackagesInstaller` needed to install the local
Angular packages to a project, it assumed the `dist/packages-dist/`
would exist and contain up-to-date built packages. I.e. it was up to the
user to have built the packages first (by running the appropriate
script).
However, many people not familiar with the `aio/` infrastructure assumed
that `yarn build-local` or `yarn build-with-ivy` would take care of all
the necessary steps.

To avoid getting confusing errors (or worse yet, using outdated local
packages), `NgPackagesInstaller` now has an option to build the packages
before using them.
One caveat is that the build script does not currently work on Windows,
so a warning is printed instead, letting the user know they need to
(somehow) take care of it themselves.

NOTE 1: Since the build script is using bazel, running it should not be
        expensive if the directory is up-to-date (i.e. no changes have
        been made to source code after the last build).
NOTE 2: This commit adds support for `--build-packages`, but does not
        change the default behavior (not building the packages). It will
        be turned on in a subsequent commit.

PR Close #31985
2019-08-08 11:30:38 -07:00
75a162575f refactor(docs-infra): minor refactorings and code simplification in NgPackagesInstaller (#31985)
PR Close #31985
2019-08-08 11:30:38 -07:00
5bf912599f docs: remove duplicate sentence in toh-pt5 (#32021)
PR Close #32021
2019-08-08 11:19:37 -07:00
afd76a80da docs: use proper case in styleguide sentence (#32039)
PR Close #32039
2019-08-08 11:15:52 -07:00
bb4627786d docs: update node:8-browsers to 10 in testing (#32049)
Fixes #31993

PR Close #32049
2019-08-08 11:15:23 -07:00
83d67b4a83 docs: add doc for compiler options (#31829)
PR Close #31829
2019-08-05 13:01:11 -07:00
6ba31b9b84 docs: updated doc for timezone param in DatePipe (#31827)
PR Close #31827
2019-08-05 13:00:26 -07:00
a1c43b39a2 docs: updated doc for timezone param in DatePipe (#31827)
PR Close #31827
2019-08-05 13:00:26 -07:00
af91c21fd9 docs: fix typo in Workspace Config guide code snippet (sourceMaps --> sourceMap) (#31957)
PR Close #31957
2019-08-05 12:57:18 -07:00
c00e7ff128 fix(docs-infra): ui polish (#31013)
- Change margin to the header so that the the label aligns with the header
- Make code in API pages pre-wrap so that you can see the actual text on the screen - helps with issue #27296
- Modified text to be title case in label API to be consistent with rest of app labels
- Removed unused table of contents SCSS file
- TOC SCSS file reorg cleanup
- Soften headers font-weight in API pages
- Make linenums ordered list inside code examples always show as numbers

PR Close #31013
2019-08-05 12:53:02 -07:00
3bf2f98c35 refactor(upgrade): avoid using static inherited method (#31986)
Using `ParentInjectorPromise.all()` (which is a static method inherited
from `SyncPromise`) causes Closure Compiler (or some related tool) to
complain:

```
TypeError: ...$packages$upgrade$src$common$src$downgrade_component_ParentInjectorPromise.all is not a function
```

Switching to `SyncPromise.all()` (the static method on the parent class)
to avoid this error.

PR Close #31986
2019-08-05 10:01:33 -07:00
2cabced9fc build(docs-infra): fix StackBlitz projects and ZIPs for testing guide examples (#31937)
- Update the `stackblitz.json` config files (used for generating
  Stackblitz projects and ZIP archives) to include the correct files
  (taking into account the current layout of the example projects).
- Update the boilerplate files for `testing` examples to match the
  current layout of the example projects.

PR Close #31937
2019-08-05 09:54:52 -07:00
b38e8674bc build(docs-infra): correct list of files included in ZIPs to match current layout (#31937)
PR Close #31937
2019-08-05 09:54:52 -07:00
553f335705 build(docs-infra): remove unused StackBlitz/ZIP configurations for setup example (#31937)
The generated StackBlitz project and ZIP archives are no longer used
(and they are broken anyway), so removing them altogether to avoid
confusion.

Note: Still keeping the example project, because that is referenced in
the `setup` guide.

PR Close #31937
2019-08-05 09:54:52 -07:00
dde0a32946 build(zone.js): update gulp task to gen changelog automatically (#31915)
PR Close #31915
2019-08-02 14:28:50 -07:00
9789cb6507 build(zone.js): update changelog of zone.js (#31915)
PR Close #31915
2019-08-02 14:28:49 -07:00
bb1fdb6c0f docs: add anyComponentStyle budget description (#31955)
In CLI 8.2 we introduced a new budget see: https://github.com/angular/angular-cli/pull/15127

PR Close #31955
2019-08-02 09:35:38 -07:00
44b5bf486f docs: add links to web.dev/angular guides (#31804)
This PR adds the following links to web.dev/angular:

1. Link to the guides in the resource section under "Online Training"
2. Links to code-splitting & preloading in the lazy-loading guide
3. Link to the accessibility guide on web.dev/angular

PR Close #31804
2019-08-01 17:45:43 -07:00
14bfcfb731 docs: update Zenika trainings URL in resources.json (#31910)
PR Close #31910
2019-08-01 10:09:49 -07:00
04ebd59961 fix(upgrade): compile downgraded components synchronously (if possible) (#31840)
AngularJS compilation is a synchronous operation (unless having to fetch
a template, which is not supported for downgraded components).
Previously, ngUpgrade tried to retain the synchronous nature of the
compilation for downgraded components (when possible), by using a
synchronous thenable implementation (`ParentInjectorPromise`). This was
accidentally broken in #27217 by replacing a call to
`ParentInjectorPromise#then()` (which can be synchronous) with a call to
`Promise.all()` (which is asynchronous).

This commit fixes this by introducing a `SyncPromise.all()` static
method; similar to `Promise.all()` but retaining the synchronous
capabilities of `SyncPromise` (which `ParentInjectorPromise` inherits
from).

Fixes #30330

PR Close #31840
2019-08-01 10:09:02 -07:00
6129cfa269 refactor(upgrade): extract promise-related utilities to separate file and add tests (#31840)
PR Close #31840
2019-08-01 10:09:02 -07:00
b8f269414e fix(ivy): speed up ngtsc if project has no templates to check (#31922)
If a project being built with ngtsc has no templates to check, then ngtsc
previously generated an empty typecheck file. This seems to trigger some
pathological behavior in TS where the entire user program is re-checked,
which is extremely expensive. This likely has to do with the fact that the
empty file is not considered an ES module, meaning the module structure of
the program has changed.

This commit causes an export to be produced in the typecheck file regardless
of its other contents, which guarantees that it will be an ES module. The
pathological behavior is avoided and template type-checking is fast once
again.

PR Close #31922
2019-07-31 16:20:38 -07:00
8ed83caa19 build(docs-infra): upgrade cli command docs sources to de49294bf (#31926)
Updating [angular#8.2.x](https://github.com/angular/angular/tree/8.2.x) from [cli-builds#8.2.x](https://github.com/angular/cli-builds/tree/8.2.x).

##
Relevant changes in [commit range](6b6b8f828...de49294bf):

**Modified**
- help/generate.json

##

PR Close #31926
2019-07-31 11:39:33 -07:00
aebf65d0ef docs: add ReactiveConf 2019 to events (#31895)
PR Close #31895
2019-07-31 11:37:44 -07:00
b667bd2224 release: cut the v8.2.0 release 2019-07-31 10:25:50 -07:00
03e8a31bf5 Revert "fix(zone.js): don't wrap uncaught promise error. (#31443)" (#31918)
This reverts commit 2bb9a65351.

It breaks tests in google3 which rely on the error handling behavior.

PR Close #31918
2019-07-30 15:03:49 -07:00
800e90e4ed fix(zone.js): don't rely on global node typings outside of node/ directory (#31783)
PR Close #31783
2019-07-30 12:59:40 -07:00
7290053952 docs: fix typo in Animation guide (#31888)
PR Close #31888
2019-07-30 12:58:53 -07:00
14890e9117 docs: change Angular Material Design to Material Design in animations guide (#31889)
PR Close #31889
2019-07-30 12:56:23 -07:00
06c49b4a6b build: secure yarn lock files (#31640)
See https://yarnpkg.com/blog/2019/07/12/recommended-security-update/

PR Close #31640
2019-07-29 16:10:23 -07:00
d269b111dd fix(zone.js): should expose some other internal intefaces (#31866)
PR Close #31866
2019-07-29 16:08:56 -07:00
46b160e925 fix(core): DebugElement.listeners not cleared on destroy (#31820)
Currently the `DebugElement.listeners` array are retained after the node is destroyed. This means that they'll continue to fire through `triggerEventHandler` and can cause memory leaks. This has already been fixed in Ivy, but these changes fix it in ViewEngine for consistency.

PR Close #31820
2019-07-29 10:05:20 -07:00
dcbc28f729 build: update to nodejs rules 0.34.0 and bazel 0.28.1 (#31824)
nodejs rules 0.34.0 now includes protractor_web_test_suite rule (via new @bazel/protractor rule) so we switch to that location for that rule in this PR so that /packages/bazel/src/protractor can be removed in a future PR

this PR also brings in node toolchain support which was released in nodejs rules 0.33.0. this is a prerequisite for RBE for mac & windows users

bazel schematics also updated with the same. @bazel/bazel 0.28.1 npm package includes transitive dep on hide-bazel-files so we're able to remove an explicit dep on that as well.

PR Close #31824
2019-07-26 15:01:26 -07:00
9bdffb1e5c docs(core): clarify @ContentChild(ren) behavior (#31846)
Describe that @ContentChild(ren) doesn't search within other component templates (doesn't go across "component boundaries").
PR Close #31846
2019-07-26 14:02:11 -07:00
155f40c175 docs: fix header mistake (#31811)
The code example refers to `src/app/heroes/heroes.component.html` but its header was `src/app/hero.service.ts` which was obviously a mistake.
PR Close #31811
2019-07-26 14:01:28 -07:00
8c446b05d0 test(ivy): fix broken testcase in Windows (#31860)
In #30181, several testcases were added that were failing in Windows.
The reason was that a recent rebase missed a required change to interact
with the compiler's virtualized filesystems. This commit introduces the
required usage of the VFS layer to fix the testcase.

PR Close #31860
2019-07-26 12:22:12 -07:00
2647f708b7 build(docs-infra): upgrade cli command docs sources to 6b6b8f828 (#31856)
Updating [angular#8.2.x](https://github.com/angular/angular/tree/8.2.x) from [cli-builds#8.1.x](https://github.com/angular/cli-builds/tree/8.1.x).

##
Relevant changes in [commit range](a8fe15cb6...6b6b8f828):

**Modified**
- help/build.json

##

PR Close #31856
2019-07-26 12:15:28 -07:00
fa15814d75 build(zone.js): add changelog gulptask for zone.js (#31852)
PR Close #31852
2019-07-26 11:30:09 -07:00
7a62530ed1 release: cut the v8.2.0-rc.0 release 2019-07-26 10:20:21 -07:00
413 changed files with 24439 additions and 15608 deletions

View File

@ -36,22 +36,6 @@ build --incompatible_strict_action_env
run --incompatible_strict_action_env run --incompatible_strict_action_env
test --incompatible_strict_action_env test --incompatible_strict_action_env
###############################
# Saucelabs support #
# Turn on these settings with #
# --config=saucelabs #
###############################
# Expose SauceLabs environment to actions
# These environment variables are needed by
# web_test_karma to run on Saucelabs
test:saucelabs --action_env=SAUCE_USERNAME
test:saucelabs --action_env=SAUCE_ACCESS_KEY
test:saucelabs --action_env=SAUCE_READY_FILE
test:saucelabs --action_env=SAUCE_PID_FILE
test:saucelabs --action_env=SAUCE_TUNNEL_IDENTIFIER
test:saucelabs --define=KARMA_WEB_TEST_MODE=SL_REQUIRED
############################### ###############################
# Release support # # Release support #
# Turn on these settings with # # Turn on these settings with #

View File

@ -28,14 +28,3 @@ test --flaky_test_attempts=2
# More details on failures # More details on failures
build --verbose_failures=true build --verbose_failures=true
# We have seen some flakiness in using TS workers on CircleCI
# https://angular-team.slack.com/archives/C07DT5M6V/p1562693245183400
# > failures like `ERROR: /home/circleci/ng/packages/core/test/BUILD.bazel:5:1:
# > Compiling TypeScript (devmode) //packages/core/test:test_lib failed: Worker process did not return a WorkResponse:`
# > I saw that issue a couple times today.
# > Example job: https://circleci.com/gh/angular/angular/385517
# We expect that TypeScript compilations will parallelize wider than the number of local cores anyway
# so we should saturate remote workers with TS compilations
build --strategy=AngularTemplateCompile=local
build --strategy=TypeScriptCompile=local

View File

@ -7,156 +7,162 @@
# To validate changes, use an online parser, eg. # To validate changes, use an online parser, eg.
# http://yaml-online-parser.appspot.com/ # http://yaml-online-parser.appspot.com/
# Note that the browser docker image comes with Chrome and Firefox preinstalled. This is just # CircleCI configuration version
# needed for jobs that run tests without Bazel. Bazel runs tests with browsers that will be # Version 2.1 allows for extra config reuse features
# fetched by the Webtesting rules. Therefore for jobs that run tests with Bazel, we don't need a # https://circleci.com/docs/2.0/reusing-config/#getting-started-with-config-reuse
# docker image with browsers pre-installed. version: 2.1
# **NOTE 1**: If you change the version of the `*-browsers` docker image, make sure the
# `CI_CHROMEDRIVER_VERSION_ARG` env var (in `.circleci/env.sh`) points to a ChromeDriver
# version that is compatible with the Chrome version in the image.
# **NOTE 2**: If you change the version of the docker images, also change the `cache_key` suffix.
var_1: &default_docker_image circleci/node:10.16
var_2: &browsers_docker_image circleci/node:10.16-browsers
# We don't want to include the current branch name in the cache key because that would prevent # We don't want to include the current branch name in the cache key because that would prevent
# PRs from being able to restore the cache since the branch names are always different for PRs. # PRs from being able to restore the cache since the branch names are always different for PRs.
# The cache key should only consist of dynamic values that change whenever something in the # The cache key should only consist of dynamic values that change whenever something in the
# cache changes. For example: # cache changes. For example:
# 1) yarn lock file changes --> cached "node_modules" are different. # 1) yarn lock file changes --> cached "node_modules" are different.
# 2) bazel repository definitions change --> cached bazel repositories are different. # 2) bazel repository definitions change --> cached bazel repositories are different.
# **NOTE 1 **: If you change the cache key prefix, also sync the restore_cache fallback to match. # **NOTE 1 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
# **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks. # **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI. # See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
var_3: &cache_key v3-angular-node-10.16-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }} var_3: &cache_key v3-angular-node-10.16-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
var_4: &cache_key_fallback v3-angular-node-10.16-
# Initializes the CI environment by setting up common environment variables.
var_4: &init_environment
run:
name: Initializing environment (setting up variables, overwriting Yarn)
# Overwrite the yarn installed in the docker container with our own version.
command: |
./.circleci/env.sh
ourYarn=$(realpath ./third_party/github.com/yarnpkg/yarn/releases/download/v1.13.0/bin/yarn.js)
sudo chmod a+x $ourYarn
sudo ln -fs $ourYarn /usr/local/bin/yarn
echo "Yarn version: $(yarn --version)"
# Add GitHub to known hosts.
mkdir -p ~/.ssh
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
# use git+ssh instead of https
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
git config --global gc.auto 0 || true
var_5: &setup_bazel_remote_execution
run:
name: "Setup bazel RBE remote execution"
command: |
# We need ensure that the same default digest is used for encoding and decoding
# with openssl. Openssl versions might have different default digests which can
# cause decryption failures based on the openssl version. https://stackoverflow.com/a/39641378/4317734
openssl aes-256-cbc -d -in .circleci/gcp_token -md md5 -k "$CI_REPO_NAME" -out /home/circleci/.gcp_credentials
echo "export GOOGLE_APPLICATION_CREDENTIALS=/home/circleci/.gcp_credentials" >> $BASH_ENV
./.circleci/setup-rbe.sh .bazelrc.user
# Settings common to each job
var_6: &job_defaults
working_directory: ~/ng
docker:
- image: *default_docker_image
# After checkout, rebase on top of target branch.
var_7: &post_checkout
run:
name: Rebase PR on target branch
command: >
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
# User is required for rebase.
git config user.name "angular-ci"
git config user.email "angular-ci"
# Rebase PR on top of target branch.
node tools/rebase-pr.js angular/angular ${CIRCLE_PR_NUMBER}
else
echo "This build is not over a PR, nothing to do."
fi
var_8: &yarn_install
run:
name: Running Yarn install
command: |
# Yarn's requests sometimes take more than 10mins to complete.
# Print something to stdout, to prevent CircleCI from failing due to not output.
while true; do sleep 60; echo "[`date`] Keeping alive..."; done &
KEEP_ALIVE_PID=$!
yarn install --frozen-lockfile --non-interactive
kill $KEEP_ALIVE_PID
var_9: &setup_circleci_bazel_config
run:
name: Setting up CircleCI bazel configuration
command: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
var_10: &restore_cache
restore_cache:
keys:
- *cache_key
# This fallback should be the cache_key without variables.
- v3-angular-node-10.16-
# Branch filter that can be specified for jobs that should only run on publish branches
# (e.g. master or the patch branch)
var_11: &publish_branches_filter
branches:
only:
- master
# e.g. 7.0.x, 7.1.x, etc.
- /\d+\.\d+\.x/
# Workspace initially persisted by the `install` job, and then enhanced by `test_aio` and
# `build-npm-packages`.
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
var_12: &attach_workspace
attach_workspace:
at: ~/
var_13: &notify_caretaker_on_fail
run:
when: on_fail
name: Notify caretaker about failure
# `$SLACK_CARETAKER_WEBHOOK_URL` is a secret env var defined in CircleCI project settings.
# The URL comes from https://angular-team.slack.com/apps/A0F7VRE7N-circleci.
command: |
notificationJson="{\"text\":\":x: \`$CIRCLE_JOB\` job for $CIRCLE_BRANCH branch failed on build $CIRCLE_BUILD_NUM: $CIRCLE_BUILD_URL :scream:\"}"
curl --request POST --header "Content-Type: application/json" --data "$notificationJson" $SLACK_CARETAKER_WEBHOOK_URL
var_14: &notify_dev_infra_on_fail
run:
when: on_fail
name: Notify dev-infra about failure
# `$SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL` is a secret env var defined in CircleCI project settings.
# The URL comes from https://angular-team.slack.com/apps/A0F7VRE7N-circleci.
command: |
notificationJson="{\"text\":\":x: \`$CIRCLE_JOB\` job for $CIRCLE_BRANCH branch failed on build $CIRCLE_BUILD_NUM: $CIRCLE_BUILD_URL :scream:\"}"
curl --request POST --header "Content-Type: application/json" --data "$notificationJson" $SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
# Cache key for the Material unit tests job. **Note** when updating the SHA in the cache keys, # Cache key for the Material unit tests job. **Note** when updating the SHA in the cache keys,
# also update the SHA for the "MATERIAL_REPO_COMMIT" environment variable. # also update the SHA for the "MATERIAL_REPO_COMMIT" environment variable.
var_15: &material_unit_tests_cache_key v4-angular-material-097f4335a4e0b6e6b579829ae3a9cffce6292d2b var_5: &material_unit_tests_cache_key v4-angular-material-18b9ef3f5529f0fa8f034944681486447af7b879
var_16: &material_unit_tests_cache_key_short v4-angular-material var_6: &material_unit_tests_cache_key_fallback v4-angular-material-
version: 2
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
# `build-ivy-npm-packages`.
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
var_7: &workspace_location ~/
# Executor Definitions
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-executors
# **NOTE 1**: Pin to exact images using an ID (SHA). See https://circleci.com/docs/2.0/circleci-images/#using-a-docker-image-id-to-pin-an-image-to-a-fixed-version.
# (Using the tag in not necessary when pinning by ID, but include it anyway for documentation purposes.)
# **NOTE 2**: If you change the version of the docker images, also change the `cache_key` suffix.
# **NOTE 3**: If you change the version of the `*-browsers` docker image, make sure the
# `CI_CHROMEDRIVER_VERSION_ARG` env var (in `.circleci/env.sh`) points to a ChromeDriver
# version that is compatible with the Chrome version in the image.
executors:
default-executor:
parameters:
resource_class:
type: string
default: medium
docker:
- image: circleci/node:10.16@sha256:75c05084fff4afa3683a03c5a04a4a3ad95c536ff2439d8fe14e7e1f5c58b09a
resource_class: << parameters.resource_class >>
working_directory: ~/ng
browsers-executor:
parameters:
resource_class:
type: string
default: medium
docker:
# The browser docker image comes with Chrome and Firefox preinstalled. This is just
# needed for jobs that run tests without Bazel. Bazel runs tests with browsers that will be
# fetched by the Webtesting rules. Therefore for jobs that run tests with Bazel, we don't need a
# docker image with browsers pre-installed.
- image: circleci/node:10.16-browsers@sha256:d2a96fe1cbef51257ee626b5f645e64dade3e886f00ba9cb7e8ea65b4efe8db1
resource_class: << parameters.resource_class >>
working_directory: ~/ng
# Command Definitions
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-commands
commands:
custom_attach_workspace:
description: Attach workspace at a predefined location
steps:
- attach_workspace:
at: *workspace_location
# Initializes the CI environment by setting up common environment variables.
init_environment:
description: Initializing environment (setting up variables, overwriting Yarn)
steps:
- run: ./.circleci/env.sh
- run:
# Overwrite the yarn installed in the docker container with our own version.
name: Overwrite yarn with our own version
command: |
ourYarn=$(realpath ./third_party/github.com/yarnpkg/yarn/releases/download/v1.17.3/bin/yarn.js)
sudo chmod a+x $ourYarn
sudo ln -fs $ourYarn /usr/local/bin/yarn
- run: echo "Yarn version $(yarn --version)"
- run:
# Configure git as the CircleCI `checkout` command does.
# This is needed because we only checkout on the setup job.
# Add GitHub to known hosts
name: Configure git
command: |
mkdir -p ~/.ssh
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
git config --global gc.auto 0 || true
setup_circleci_bazel_config:
description: Set up CircleCI bazel configuration
steps:
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
setup_bazel_rbe:
description: Setup bazel RBE remote execution
steps:
# We need ensure that the same default digest is used for encoding and decoding
# with openssl. Openssl versions might have different default digests which can
# cause decryption failures based on the openssl version. https://stackoverflow.com/a/39641378/4317734
- run: openssl aes-256-cbc -d -in .circleci/gcp_token -md md5 -k "$CI_REPO_NAME" -out /home/circleci/.gcp_credentials
- run: echo "export GOOGLE_APPLICATION_CREDENTIALS=/home/circleci/.gcp_credentials" >> $BASH_ENV
- run: ./.circleci/setup-rbe.sh .bazelrc.user
notify_webhook_on_fail:
description: Notify a webhook about failure
parameters:
# `webhook_url_env_var` are secret env vars defined in CircleCI project settings.
# The URLs come from https://angular-team.slack.com/apps/A0F7VRE7N-circleci.
webhook_url_env_var:
type: env_var_name
steps:
- run:
when: on_fail
command: |
notificationJson="{\"text\":\":x: \`$CIRCLE_JOB\` job for $CIRCLE_BRANCH branch failed on build $CIRCLE_BUILD_NUM: $CIRCLE_BUILD_URL :scream:\"}"
curl --request POST --header "Content-Type: application/json" --data "$notificationJson" ${<< parameters.webhook_url_env_var >>}
# Job definitions
# Jobs can include parameters that are passed in the workflow job invocation.
# https://circleci.com/docs/2.0/reusing-config/#authoring-parameterized-jobs
jobs: jobs:
setup: setup:
<<: *job_defaults executor: default-executor
steps: steps:
- checkout - checkout
- *post_checkout - run:
name: Rebase PR on target branch
# After checkout, rebase on top of target branch.
command: >
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
# User is required for rebase.
git config user.name "angular-ci"
git config user.email "angular-ci"
# Rebase PR on top of target branch.
node tools/rebase-pr.js angular/angular ${CIRCLE_PR_NUMBER}
else
echo "This build is not over a PR, nothing to do."
fi
# This cache is saved in the build-npm-packages so that Bazel cache is also included. # This cache is saved in the build-npm-packages so that Bazel cache is also included.
- *restore_cache - restore_cache:
- *init_environment keys:
- *yarn_install - *cache_key
- *cache_key_fallback
- init_environment
- run:
name: Running Yarn install
command: yarn install --frozen-lockfile --non-interactive
# Yarn's requests sometimes take more than 10mins to complete.
no_output_timeout: 45m
- run: yarn --cwd aio install --frozen-lockfile --non-interactive - run: yarn --cwd aio install --frozen-lockfile --non-interactive
# Make the bazel directories and add a file to them if they don't exist already so that # Make the bazel directories and add a file to them if they don't exist already so that
# persist_to_workspace does not fail. # persist_to_workspace does not fail.
@ -166,19 +172,18 @@ jobs:
touch ~/bazel_repository_cache/MARKER touch ~/bazel_repository_cache/MARKER
fi fi
# Persist any changes at this point to be reused by further jobs. # Persist any changes at this point to be reused by further jobs.
# **NOTE 1 **: Folders persisted here should be kept in sync with `var_13: &attach_workspace`. # **NOTE**: To add new content to the workspace, always persist on the same root.
# **NOTE 2 **: To add new content to the workspace, always persist on the same root.
- persist_to_workspace: - persist_to_workspace:
root: ~/ root: *workspace_location
paths: paths:
- ./ng - ./ng
- ./bazel_repository_cache - ./bazel_repository_cache
lint: lint:
<<: *job_defaults executor: default-executor
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- run: 'yarn bazel:format -mode=check || - run: 'yarn bazel:format -mode=check ||
(echo "BUILD files not formatted. Please run ''yarn bazel:format''" ; exit 1)' (echo "BUILD files not formatted. Please run ''yarn bazel:format''" ; exit 1)'
@ -187,34 +192,32 @@ jobs:
(echo -e "\n.bzl files have lint errors. Please run ''yarn bazel:lint-fix''"; exit 1)' (echo -e "\n.bzl files have lint errors. Please run ''yarn bazel:lint-fix''"; exit 1)'
- run: yarn gulp lint - run: yarn gulp lint
- run: node tools/verify-codeownership
test: test:
<<: *job_defaults executor:
resource_class: xlarge name: default-executor
resource_class: xlarge
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- *setup_circleci_bazel_config - setup_circleci_bazel_config
# Setup remote execution and run RBE-compatible tests. # Setup remote execution and run RBE-compatible tests.
- *setup_bazel_remote_execution - setup_bazel_rbe
- run: yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only - run:
- run: mkdir ~/testlogs command: yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only
- run: cp -Lr dist/testlogs/* ~/testlogs no_output_timeout: 20m
- store_test_results:
# Bazel always writes test.xml files under this directory
path: ~/testlogs
- store_artifacts:
path: ~/testlogs
# Temporary job to test what will happen when we flip the Ivy flag to true # Temporary job to test what will happen when we flip the Ivy flag to true
test_ivy_aot: test_ivy_aot:
<<: *job_defaults executor:
resource_class: xlarge name: default-executor
resource_class: xlarge
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- *setup_circleci_bazel_config - setup_circleci_bazel_config
- *setup_bazel_remote_execution - setup_bazel_rbe
# We need to explicitly specify the --symlink_prefix option because otherwise we would # We need to explicitly specify the --symlink_prefix option because otherwise we would
# not be able to easily find the output bin directory when uploading artifacts for size # not be able to easily find the output bin directory when uploading artifacts for size
@ -246,43 +249,41 @@ jobs:
# #
# NOTE: This is currently limited to master builds only. See the `default_workflow` configuration. # NOTE: This is currently limited to master builds only. See the `default_workflow` configuration.
test_saucelabs_bazel: test_saucelabs_bazel:
<<: *job_defaults executor:
# In order to avoid the bottleneck of having a slow host machine, we acquire a better name: default-executor
# container for this job. This is necessary because we launch a lot of browsers concurrently # In order to avoid the bottleneck of having a slow host machine, we acquire a better
# and therefore the tunnel and Karma need to process a lot of file requests and tests. # container for this job. This is necessary because we launch a lot of browsers concurrently
resource_class: xlarge # and therefore the tunnel and Karma need to process a lot of file requests and tests.
resource_class: xlarge
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- *setup_circleci_bazel_config - setup_circleci_bazel_config
- setup_bazel_rbe
- run: - run:
name: Preparing environment for running tests on Saucelabs. name: Run Bazel tests in saucelabs
command: setSecretVar SAUCE_ACCESS_KEY $(echo $SAUCE_ACCESS_KEY | rev) # All web tests are contained within a single //:test_web_all target for Saucelabs
- run: # as running each set of tests as a separate target will attempt to acquire too
name: Starting Saucelabs tunnel # many browsers on Saucelabs (7 per target currently) and some tests will always
command: ./scripts/saucelabs/start-tunnel.sh # fail to acquire browsers. For example:
background: true # 14 02 2019 19:52:33.170:WARN [launcher]: chrome beta on SauceLabs have not captured in 180000 ms, killing.
# Waits for the Saucelabs tunnel to be ready. This ensures that we don't run tests # //packages/forms/test:web_test_sauce TIMEOUT in 315.0s
# too early without Saucelabs not being ready. command: |
- run: ./scripts/saucelabs/wait-for-tunnel.sh ./scripts/saucelabs/run-bazel-via-tunnel.sh \
# All web tests are contained within a single //:test_web_all target for Saucelabs --tunnel-id angular-${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX} \
# as running each set of tests as a separate target will attempt to acquire too --username $SAUCE_USERNAME \
# many browsers on Saucelabs (7 per target currently) and some tests will always --key $(echo $SAUCE_ACCESS_KEY | rev) \
# fail to acquire browsers. For example: yarn bazel test //:test_web_all
# 14 02 2019 19:52:33.170:WARN [launcher]: chrome beta on SauceLabs have not captured in 180000 ms, killing. no_output_timeout: 20m
# //packages/forms/test:web_test_sauce TIMEOUT in 315.0s - notify_webhook_on_fail:
- run: yarn bazel test --config=saucelabs //:test_web_all webhook_url_env_var: SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
- run: ./scripts/saucelabs/stop-tunnel.sh
- *notify_dev_infra_on_fail
test_aio: test_aio:
<<: *job_defaults # Needed because the AIO tests and the PWA score test depend on Chrome being available.
docker: executor: browsers-executor
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
- image: *browsers_docker_image
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
# Build aio # Build aio
- run: yarn --cwd aio build --progress=false - run: yarn --cwd aio build --progress=false
# Lint the code # Lint the code
@ -301,27 +302,27 @@ jobs:
- run: yarn --cwd aio redirects-test - run: yarn --cwd aio redirects-test
deploy_aio: deploy_aio:
<<: *job_defaults
docker:
# Needed because before deploying the deploy-production script runs the PWA score tests. # Needed because before deploying the deploy-production script runs the PWA score tests.
- image: *browsers_docker_image executor: browsers-executor
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
# Deploy angular.io to production (if necessary) # Deploy angular.io to production (if necessary)
- run: setPublicVar_CI_STABLE_BRANCH - run: setPublicVar_CI_STABLE_BRANCH
- run: yarn --cwd aio deploy-production - run: yarn --cwd aio deploy-production
test_aio_local: test_aio_local:
<<: *job_defaults parameters:
docker: ivy:
# Needed because the AIO tests and the PWA score test depend on Chrome being available. type: boolean
- image: *browsers_docker_image default: false
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
executor: browsers-executor
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
# Build aio (with local Angular packages) # Build aio (with local Angular packages)
- run: yarn --cwd aio build-local-ci - run: yarn --cwd aio build-local<<# parameters.ivy >>-with-ivy<</ parameters.ivy >>-ci
# Run unit tests # Run unit tests
- run: yarn --cwd aio test --progress=false --watch=false - run: yarn --cwd aio test --progress=false --watch=false
# Run e2e tests # Run e2e tests
@ -329,32 +330,13 @@ jobs:
# Run PWA-score tests # Run PWA-score tests
- run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
# Check the bundle sizes. # Check the bundle sizes.
- run: yarn --cwd aio payload-size aio-local - run: yarn --cwd aio payload-size aio-local<<# parameters.ivy >>-ivy<</ parameters.ivy >>
test_aio_local_ivy:
<<: *job_defaults
docker:
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
- image: *browsers_docker_image
steps:
- *attach_workspace
- *init_environment
# Build aio with Ivy (using local Angular packages)
- run: yarn --cwd aio build-with-ivy-ci
# Run unit tests
- run: yarn --cwd aio test --progress=false --watch=false
# Run e2e tests
- run: yarn --cwd aio e2e --configuration=ci
# Run PWA-score tests
- run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
# Check the bundle sizes.
- run: yarn --cwd aio payload-size aio-local-ivy
test_aio_tools: test_aio_tools:
<<: *job_defaults executor: default-executor
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
# Install # Install
- run: yarn --cwd aio install --frozen-lockfile --non-interactive - run: yarn --cwd aio install --frozen-lockfile --non-interactive
- run: yarn --cwd aio extract-cli-command-docs - run: yarn --cwd aio extract-cli-command-docs
@ -363,56 +345,42 @@ jobs:
- run: ./aio/aio-builds-setup/scripts/test.sh - run: ./aio/aio-builds-setup/scripts/test.sh
test_docs_examples: test_docs_examples:
<<: *job_defaults parameters:
docker: ivy:
type: boolean
default: false
executor:
# Needed because the example e2e tests depend on Chrome. # Needed because the example e2e tests depend on Chrome.
- image: *browsers_docker_image name: browsers-executor
parallelism: 4 resource_class: xlarge
resource_class: xlarge
steps:
- *attach_workspace
- *init_environment
# Install aio
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
# Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
# Since the parallelism is set to "3", there will be three parallel CircleCI containers
# with either "0", "1" or "2" as node index. This can be passed to the "--shard" argument.
- run: yarn --cwd aio example-e2e --setup --local --cliSpecsConcurrency=5 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL}
test_docs_examples_ivy:
<<: *job_defaults
docker:
# Needed because the example e2e tests depend on Chrome.
- image: *browsers_docker_image
resource_class: xlarge
# We increase the parallelism here to five while the "test_docs_examples" job runs with
# a parallelism of four. This is necessary because this job also need to run NGCC which
# takes up more time and we don't want these jobs to impact the overall CI turnaround.
parallelism: 5 parallelism: 5
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
# Install aio # Install aio
- run: yarn --cwd aio install --frozen-lockfile --non-interactive - run: yarn --cwd aio install --frozen-lockfile --non-interactive
# Rename the Ivy packages dist folder to "dist/packages-dist" as the AIO - when:
# package installer picks up the locally built packages from that location. condition: << parameters.ivy >>
# *Note*: We could also adjust the packages installer, but given we won't have steps:
# two different folders of Angular distributions in the future, we should keep # Rename the Ivy packages dist folder to "dist/packages-dist" as the AIO
# the packages installer unchanged. # package installer picks up the locally built packages from that location.
- run: mv dist/packages-dist-ivy-aot dist/packages-dist # *Note*: We could also adjust the packages installer, but given we won't have
# Run examples tests with ivy. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled. # two different folders of Angular distributions in the future, we should keep
# Since the parallelism is set to "3", there will be three parallel CircleCI containers # the packages installer unchanged.
# with either "0", "1" or "2" as node index. This can be passed to the "--shard" argument. - run: mv dist/packages-dist-ivy-aot dist/packages-dist
- run: yarn --cwd aio example-e2e --setup --local --ivy --cliSpecsConcurrency=5 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL} # Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
# Since the parallelism is set to "5", there will be five parallel CircleCI containers.
# with either "0", "1", etc as node index. This can be passed to the "--shard" argument.
- run: yarn --cwd aio example-e2e --setup --local <<# parameters.ivy >>--ivy<</ parameters.ivy >> --cliSpecsConcurrency=5 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL} --retry 2
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`. # This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
aio_preview: aio_preview:
<<: *job_defaults executor: default-executor
environment: environment:
AIO_SNAPSHOT_ARTIFACT_PATH: &aio_preview_artifact_path 'aio/tmp/snapshot.tgz' AIO_SNAPSHOT_ARTIFACT_PATH: &aio_preview_artifact_path 'aio/tmp/snapshot.tgz'
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- run: ./aio/scripts/build-artifacts.sh $AIO_SNAPSHOT_ARTIFACT_PATH $CI_PULL_REQUEST $CI_COMMIT - run: ./aio/scripts/build-artifacts.sh $AIO_SNAPSHOT_ARTIFACT_PATH $CI_PULL_REQUEST $CI_COMMIT
- store_artifacts: - store_artifacts:
path: *aio_preview_artifact_path path: *aio_preview_artifact_path
@ -423,13 +391,11 @@ jobs:
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`. # This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
test_aio_preview: test_aio_preview:
<<: *job_defaults # Needed because the test-preview script runs e2e tests and the PWA score test with Chrome.
docker: executor: browsers-executor
# Needed because the test-preview script runs e2e tests and the PWA score test with Chrome.
- image: *browsers_docker_image
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- run: yarn --cwd aio install --frozen-lockfile --non-interactive - run: yarn --cwd aio install --frozen-lockfile --non-interactive
- run: - run:
name: Wait for preview and run tests name: Wait for preview and run tests
@ -445,19 +411,20 @@ jobs:
# Build the view engine npm packages. No new jobs should depend on this. # Build the view engine npm packages. No new jobs should depend on this.
build-npm-packages: build-npm-packages:
<<: *job_defaults executor:
resource_class: xlarge name: default-executor
resource_class: xlarge
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- *setup_circleci_bazel_config - setup_circleci_bazel_config
- *setup_bazel_remote_execution - setup_bazel_rbe
- run: scripts/build-packages-dist.sh - run: scripts/build-packages-dist.sh
# Save the npm packages from //packages/... for other workflow jobs to read # Save the npm packages from //packages/... for other workflow jobs to read
- persist_to_workspace: - persist_to_workspace:
root: ~/ root: *workspace_location
paths: paths:
- ng/dist/packages-dist - ng/dist/packages-dist
@ -471,19 +438,20 @@ jobs:
# Build the ivy npm packages. # Build the ivy npm packages.
build-ivy-npm-packages: build-ivy-npm-packages:
<<: *job_defaults executor:
resource_class: xlarge name: default-executor
resource_class: xlarge
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- *setup_circleci_bazel_config - setup_circleci_bazel_config
- *setup_bazel_remote_execution - setup_bazel_rbe
- run: scripts/build-ivy-npm-packages.sh - run: scripts/build-ivy-npm-packages.sh
# Save the npm packages from //packages/... for other workflow jobs to read # Save the npm packages from //packages/... for other workflow jobs to read
- persist_to_workspace: - persist_to_workspace:
root: ~/ root: *workspace_location
paths: paths:
- ng/dist/packages-dist-ivy-aot - ng/dist/packages-dist-ivy-aot
@ -494,18 +462,17 @@ jobs:
# need to re-run manually should be alleviated. # need to re-run manually should be alleviated.
# See comments inside the integration/run_tests.sh script. # See comments inside the integration/run_tests.sh script.
integration_test: integration_test:
<<: *job_defaults executor:
parallelism: 4
docker:
# Needed because the integration tests expect Chrome to be installed (e.g cli-hello-world) # Needed because the integration tests expect Chrome to be installed (e.g cli-hello-world)
- image: *browsers_docker_image name: browsers-executor
# Note: we run Bazel in one of the integration tests, and it can consume >2G # Note: we run Bazel in one of the integration tests, and it can consume >2G
# of memory. Together with the system under test, this can exhaust the RAM # of memory. Together with the system under test, this can exhaust the RAM
# on a 4G worker so we use a larger machine here too. # on a 4G worker so we use a larger machine here too.
resource_class: xlarge resource_class: xlarge
parallelism: 4
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
# Runs the integration tests in parallel across multiple CircleCI container instances. The # Runs the integration tests in parallel across multiple CircleCI container instances. The
# amount of container nodes for this job is controlled by the "parallelism" option. # amount of container nodes for this job is controlled by the "parallelism" option.
- run: ./integration/run_tests.sh ${CIRCLE_NODE_INDEX} ${CIRCLE_NODE_TOTAL} - run: ./integration/run_tests.sh ${CIRCLE_NODE_INDEX} ${CIRCLE_NODE_TOTAL}
@ -513,7 +480,7 @@ jobs:
# This job updates the content of repos like github.com/angular/core-builds # This job updates the content of repos like github.com/angular/core-builds
# for every green build on angular/angular. # for every green build on angular/angular.
publish_snapshot: publish_snapshot:
<<: *job_defaults executor: default-executor
steps: steps:
# See below - ideally this job should not trigger for non-upstream builds. # See below - ideally this job should not trigger for non-upstream builds.
# But since it does, we have to check this condition. # But since it does, we have to check this condition.
@ -527,8 +494,8 @@ jobs:
[[ "$CIRCLE_PROJECT_REPONAME" != "angular" ]]; then [[ "$CIRCLE_PROJECT_REPONAME" != "angular" ]]; then
circleci step halt circleci step halt
fi fi
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
# CircleCI has a config setting to force SSH for all github connections # CircleCI has a config setting to force SSH for all github connections
# This is not compatible with our mechanism of using a Personal Access Token # This is not compatible with our mechanism of using a Personal Access Token
# Clear the global setting # Clear the global setting
@ -542,14 +509,12 @@ jobs:
- run: ./scripts/ci/publish-build-artifacts.sh - run: ./scripts/ci/publish-build-artifacts.sh
aio_monitoring_stable: aio_monitoring_stable:
<<: *job_defaults # This job needs Chrome to be globally installed because the tests run with Protractor
docker: # which does not load the browser through the Bazel webtesting rules.
# This job needs Chrome to be globally installed because the tests run with Protractor executor: browsers-executor
# which does not load the browser through the Bazel webtesting rules.
- image: *browsers_docker_image
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- run: setPublicVar_CI_STABLE_BRANCH - run: setPublicVar_CI_STABLE_BRANCH
- run: - run:
name: Check out `aio/` from the stable branch name: Check out `aio/` from the stable branch
@ -559,33 +524,36 @@ jobs:
- run: - run:
name: Run tests against https://angular.io/ name: Run tests against https://angular.io/
command: ./aio/scripts/test-production.sh https://angular.io/ $CI_AIO_MIN_PWA_SCORE command: ./aio/scripts/test-production.sh https://angular.io/ $CI_AIO_MIN_PWA_SCORE
- *notify_caretaker_on_fail - notify_webhook_on_fail:
- *notify_dev_infra_on_fail webhook_url_env_var: SLACK_CARETAKER_WEBHOOK_URL
- notify_webhook_on_fail:
webhook_url_env_var: SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
aio_monitoring_next: aio_monitoring_next:
<<: *job_defaults # This job needs Chrome to be globally installed because the tests run with Protractor
docker: # which does not load the browser through the Bazel webtesting rules.
# This job needs Chrome to be globally installed because the tests run with Protractor executor: browsers-executor
# which does not load the browser through the Bazel webtesting rules.
- image: *browsers_docker_image
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- run: - run:
name: Run tests against https://next.angular.io/ name: Run tests against https://next.angular.io/
command: ./aio/scripts/test-production.sh https://next.angular.io/ $CI_AIO_MIN_PWA_SCORE command: ./aio/scripts/test-production.sh https://next.angular.io/ $CI_AIO_MIN_PWA_SCORE
- *notify_caretaker_on_fail - notify_webhook_on_fail:
- *notify_dev_infra_on_fail webhook_url_env_var: SLACK_CARETAKER_WEBHOOK_URL
- notify_webhook_on_fail:
webhook_url_env_var: SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
legacy-unit-tests-saucelabs: legacy-unit-tests-saucelabs:
<<: *job_defaults executor:
# In order to avoid the bottleneck of having a slow host machine, we acquire a better name: default-executor
# container for this job. This is necessary because we launch a lot of browsers concurrently # In order to avoid the bottleneck of having a slow host machine, we acquire a better
# and therefore the tunnel and Karma need to process a lot of file requests and tests. # container for this job. This is necessary because we launch a lot of browsers concurrently
resource_class: xlarge # and therefore the tunnel and Karma need to process a lot of file requests and tests.
resource_class: xlarge
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- run: - run:
name: Preparing environment for running tests on Saucelabs. name: Preparing environment for running tests on Saucelabs.
command: | command: |
@ -604,10 +572,10 @@ jobs:
- run: ./scripts/saucelabs/stop-tunnel.sh - run: ./scripts/saucelabs/stop-tunnel.sh
legacy-misc-tests: legacy-misc-tests:
<<: *job_defaults executor: default-executor
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
- run: yarn gulp check-cycle - run: yarn gulp check-cycle
# TODO: disabled because the Bazel packages-dist does not seem to have map files for # TODO: disabled because the Bazel packages-dist does not seem to have map files for
# the ESM5/ES2015 output. See: https://github.com/angular/angular/issues/27966 # the ESM5/ES2015 output. See: https://github.com/angular/angular/issues/27966
@ -616,23 +584,22 @@ jobs:
# Job to run unit tests from angular/material2. Needs a browser since all # Job to run unit tests from angular/material2. Needs a browser since all
# component unit tests assume they're running in the browser environment. # component unit tests assume they're running in the browser environment.
material-unit-tests: material-unit-tests:
<<: *job_defaults executor:
resource_class: xlarge name: browsers-executor
docker: resource_class: xlarge
- image: *browsers_docker_image
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
# Although RBE is configured below for the Material repo, also setup RBE in the Angular repo # Although RBE is configured below for the Material repo, also setup RBE in the Angular repo
# to provision Angular's GCP token into the environment variables. # to provision Angular's GCP token into the environment variables.
- *setup_bazel_remote_execution - setup_bazel_rbe
# Restore the cache before cloning the repository because the clone script re-uses # Restore the cache before cloning the repository because the clone script re-uses
# the restored repository if present. This reduces the amount of times the components # the restored repository if present. This reduces the amount of times the components
# repository needs to be cloned (this is slow and increases based on commits in the repo). # repository needs to be cloned (this is slow and increases based on commits in the repo).
- restore_cache: - restore_cache:
keys: keys:
- *material_unit_tests_cache_key - *material_unit_tests_cache_key
- *material_unit_tests_cache_key_short - *material_unit_tests_cache_key_fallback
- run: - run:
name: "Fetching Material repository" name: "Fetching Material repository"
command: ./scripts/ci/clone_angular_material_repo.sh command: ./scripts/ci/clone_angular_material_repo.sh
@ -655,10 +622,12 @@ jobs:
command: ./scripts/ci/run_angular_material_unit_tests.sh command: ./scripts/ci/run_angular_material_unit_tests.sh
test_zonejs: test_zonejs:
<<: *job_defaults executor:
name: default-executor
resource_class: xlarge
steps: steps:
- *attach_workspace - custom_attach_workspace
- *init_environment - init_environment
# Install # Install
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive - run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
# Run zone.js tools tests # Run zone.js tools tests
@ -673,7 +642,10 @@ workflows:
version: 2 version: 2
default_workflow: default_workflow:
jobs: jobs:
- setup - setup:
filters:
branches:
ignore: g3
- lint: - lint:
requires: requires:
- setup - setup
@ -714,7 +686,9 @@ workflows:
- test_aio_local: - test_aio_local:
requires: requires:
- build-npm-packages - build-npm-packages
- test_aio_local_ivy: - test_aio_local:
name: test_aio_local_ivy
ivy: true
requires: requires:
- build-npm-packages - build-npm-packages
- test_aio_tools: - test_aio_tools:
@ -723,7 +697,9 @@ workflows:
- test_docs_examples: - test_docs_examples:
requires: requires:
- build-npm-packages - build-npm-packages
- test_docs_examples_ivy: - test_docs_examples:
name: test_docs_examples_ivy
ivy: true
requires: requires:
- build-ivy-npm-packages - build-ivy-npm-packages
- aio_preview: - aio_preview:
@ -784,9 +760,3 @@ workflows:
branches: branches:
only: only:
- master - master
# TODO:
# - don't build the g3 branch
# - verify that we are bootstrapping with the right yarn version coming from the docker image
# - check local chrome version pulled from docker image
# - remove /tools/ngcontainer

View File

@ -19,16 +19,20 @@ setPublicVar PROJECT_ROOT "$projectDir";
setPublicVar CI_AIO_MIN_PWA_SCORE "95"; setPublicVar CI_AIO_MIN_PWA_SCORE "95";
# This is the branch being built; e.g. `pull/12345` for PR builds. # This is the branch being built; e.g. `pull/12345` for PR builds.
setPublicVar CI_BRANCH "$CIRCLE_BRANCH"; setPublicVar CI_BRANCH "$CIRCLE_BRANCH";
setPublicVar CI_BUILD_URL "$CIRCLE_BUILD_URL";
# ChromeDriver version compatible with the Chrome version included in the docker image used in # ChromeDriver version compatible with the Chrome version included in the docker image used in
# `.circleci/config.yml`. See http://chromedriver.chromium.org/downloads for a list of versions. # `.circleci/config.yml`. See http://chromedriver.chromium.org/downloads for a list of versions.
# This variable is intended to be passed as an arg to the `webdriver-manager update` command (e.g. # This variable is intended to be passed as an arg to the `webdriver-manager update` command (e.g.
# `"postinstall": "webdriver-manager update $CI_CHROMEDRIVER_VERSION_ARG"`). # `"postinstall": "webdriver-manager update $CI_CHROMEDRIVER_VERSION_ARG"`).
setPublicVar CI_CHROMEDRIVER_VERSION_ARG "--versions.chrome 75.0.3770.90"; setPublicVar CI_CHROMEDRIVER_VERSION_ARG "--versions.chrome 75.0.3770.90";
setPublicVar CI_COMMIT "$CIRCLE_SHA1"; setPublicVar CI_COMMIT "$CIRCLE_SHA1";
# `CI_COMMIT_RANGE` will only be available when `CIRCLE_COMPARE_URL` is also available (or can be # `CI_COMMIT_RANGE` is only used on push builds (a.k.a. non-PR, non-scheduled builds and rerun
# retrieved via `get-compare-url.js`), i.e. on push builds (a.k.a. non-PR, non-scheduled builds and # workflows of such builds).
# rerun workflows of such builds). That is fine, since we only need it in push builds. # NOTE: With [CircleCI Pipelines](https://circleci.com/docs/2.0/build-processing) enabled,
setPublicVar CI_COMMIT_RANGE "`[[ ${CIRCLE_PR_NUMBER:-false} != false ]] && echo "" || node $getCommitRangePath "$CIRCLE_BUILD_NUM" "$CIRCLE_COMPARE_URL"`"; # `CIRCLE_COMPARE_URL` is no longer available and the commit range cannot be reliably
# detected. Fall back to only considering the last commit (which is accurate in the majority
# of cases for push builds).
setPublicVar CI_COMMIT_RANGE "`[[ ${CIRCLE_PR_NUMBER:-false} != false ]] && echo "" || echo "$CIRCLE_SHA1~1...$CIRCLE_SHA1"`";
setPublicVar CI_PULL_REQUEST "${CIRCLE_PR_NUMBER:-false}"; setPublicVar CI_PULL_REQUEST "${CIRCLE_PR_NUMBER:-false}";
setPublicVar CI_REPO_NAME "$CIRCLE_PROJECT_REPONAME"; setPublicVar CI_REPO_NAME "$CIRCLE_PROJECT_REPONAME";
setPublicVar CI_REPO_OWNER "$CIRCLE_PROJECT_USERNAME"; setPublicVar CI_REPO_OWNER "$CIRCLE_PROJECT_USERNAME";
@ -61,6 +65,7 @@ else
setPublicVar SAUCE_USERNAME "angular-ci"; setPublicVar SAUCE_USERNAME "angular-ci";
setSecretVar SAUCE_ACCESS_KEY "9b988f434ff8-fbca-8aa4-4ae3-35442987"; setSecretVar SAUCE_ACCESS_KEY "9b988f434ff8-fbca-8aa4-4ae3-35442987";
fi fi
# TODO(josephperrott): Remove environment variables once all saucelabs tests are via bazel method.
setPublicVar SAUCE_LOG_FILE /tmp/angular/sauce-connect.log setPublicVar SAUCE_LOG_FILE /tmp/angular/sauce-connect.log
setPublicVar SAUCE_READY_FILE /tmp/angular/sauce-connect-ready-file.lock setPublicVar SAUCE_READY_FILE /tmp/angular/sauce-connect-ready-file.lock
setPublicVar SAUCE_PID_FILE /tmp/angular/sauce-connect-pid-file.lock setPublicVar SAUCE_PID_FILE /tmp/angular/sauce-connect-pid-file.lock
@ -79,7 +84,7 @@ setPublicVar MATERIAL_REPO_TMP_DIR "/tmp/material2"
setPublicVar MATERIAL_REPO_URL "https://github.com/angular/material2.git" setPublicVar MATERIAL_REPO_URL "https://github.com/angular/material2.git"
setPublicVar MATERIAL_REPO_BRANCH "master" setPublicVar MATERIAL_REPO_BRANCH "master"
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI "config.yml". # **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI "config.yml".
setPublicVar MATERIAL_REPO_COMMIT "097f4335a4e0b6e6b579829ae3a9cffce6292d2b" setPublicVar MATERIAL_REPO_COMMIT "18b9ef3f5529f0fa8f034944681486447af7b879"
# Source `$BASH_ENV` to make the variables available immediately. # Source `$BASH_ENV` to make the variables available immediately.
source $BASH_ENV; source $BASH_ENV;

View File

@ -10,6 +10,13 @@
* format of the `CIRCLE_COMPARE_URL` environment variable, or by retrieving the equivalent of * format of the `CIRCLE_COMPARE_URL` environment variable, or by retrieving the equivalent of
* `CIRCLE_COMPARE_URL` for jobs that are part of a rerun workflow and extracting it from there. * `CIRCLE_COMPARE_URL` for jobs that are part of a rerun workflow and extracting it from there.
* *
* > !!! WARNING !!!
* > !!
* > !! When [CircleCI Pipelines](https://circleci.com/docs/2.0/build-processing) is enabled, the
* > !! `CIRCLE_COMPARE_URL` environment variable is not available at all and this script does not
* > !! work.
* > !!!!!!!!!!!!!!!
*
* **Context:** * **Context:**
* CircleCI sets the `CIRCLE_COMPARE_URL` environment variable (from which we can extract the commit * CircleCI sets the `CIRCLE_COMPARE_URL` environment variable (from which we can extract the commit
* range) on push builds (a.k.a. non-PR, non-scheduled builds). Yet, when a workflow is rerun * range) on push builds (a.k.a. non-PR, non-scheduled builds). Yet, when a workflow is rerun
@ -21,7 +28,7 @@
* (undocumented) fact that the workspace ID happens to be the same as the workflow ID that first * (undocumented) fact that the workspace ID happens to be the same as the workflow ID that first
* created it. * created it.
* *
* For example, for a job on push build workflow, the CircleCI API will return data that look like: * For example, for a job on push build workflows, the CircleCI API will return data that look like:
* ```js * ```js
* { * {
* compare: 'THE_COMPARE_URL_WE_ARE_LOOKING_FOR', * compare: 'THE_COMPARE_URL_WE_ARE_LOOKING_FOR',

152
.github/CODEOWNERS vendored
View File

@ -44,23 +44,19 @@
# alxhub - Alex Rickabaugh # alxhub - Alex Rickabaugh
# AndrewKushnir - Andrew Kushnir # AndrewKushnir - Andrew Kushnir
# andrewseguin - Andrew Seguin # andrewseguin - Andrew Seguin
# benlesh - Ben Lesh # atscott - Andrew Scott
# brandonroberts - Brandon Roberts
# devversion - Paul Gschwendtner # devversion - Paul Gschwendtner
# filipesilva - Filipe Silva # filipesilva - Filipe Silva
# gkalpak - George Kalpakas # gkalpak - George Kalpakas
# hansl - Hans Larsen
# IgorMinar - Igor Minar # IgorMinar - Igor Minar
# jasonaden - Jason Aden
# jenniferfell - Jennifer Fell
# JiaLiPassion - Jia Li # JiaLiPassion - Jia Li
# josephperrott - Joey Perrott # josephperrott - Joey Perrott
# kapunahelewong - Kapunahele Wong
# kara - Kara Erickson # kara - Kara Erickson
# kyliau - Keen Yee Liau # kyliau - Keen Yee Liau
# matsko - Matias Niemelä # matsko - Matias Niemelä
# mgechev - Minko Gechev # mgechev - Minko Gechev
# mhevery - Misko Hevery # mhevery - Misko Hevery
# ocombe - Olivier Combe
# petebacondarwin - Pete Bacon Darwin # petebacondarwin - Pete Bacon Darwin
# pkozlowski-opensource - Pawel Kozlowski # pkozlowski-opensource - Pawel Kozlowski
# robwormald - Rob Wormald # robwormald - Rob Wormald
@ -88,9 +84,9 @@
# (secret team to avoid review requests, it also doesn't inherit from @angular/framework because nested teams can't be secret) # (secret team to avoid review requests, it also doesn't inherit from @angular/framework because nested teams can't be secret)
# #
# - IgorMinar # - IgorMinar
# - josephperrott
# - kara # - kara
# - mhevery # - mhevery
# - alexeagle
# =========================================================== # ===========================================================
@ -99,9 +95,8 @@
# Used for approving minor documentation-only changes that don't require engineering review. # Used for approving minor documentation-only changes that don't require engineering review.
# (secret team to avoid review requests, it also doesn't inherit from @angular/framework because nested teams can't be secret) # (secret team to avoid review requests, it also doesn't inherit from @angular/framework because nested teams can't be secret)
# #
# - brandonroberts
# - gkalpak # - gkalpak
# - jenniferfell # - kapunahelewong
# - petebacondarwin # - petebacondarwin
@ -126,10 +121,9 @@
# @angular/tools-cli # @angular/tools-cli
# =========================================================== # ===========================================================
# #
# - alexeagle
# - filipesilva # - filipesilva
# - hansl
# - mgechev # - mgechev
# - vikerman
# =========================================================== # ===========================================================
@ -180,8 +174,7 @@
# @angular/fw-forms # @angular/fw-forms
# =========================================================== # ===========================================================
# #
# - kara # - AndrewKushnir
# - jasonaden
# =========================================================== # ===========================================================
@ -203,7 +196,7 @@
# @angular/fw-router # @angular/fw-router
# =========================================================== # ===========================================================
# #
# - jasonaden # - atscott
# =========================================================== # ===========================================================
@ -221,7 +214,6 @@
# #
# - gkalpak # - gkalpak
# - petebacondarwin # - petebacondarwin
# - jasonaden
# =========================================================== # ===========================================================
@ -237,7 +229,7 @@
# #
# - AndrewKushnir # - AndrewKushnir
# - mhevery # - mhevery
# - ocombe # - petebacondarwin
# - vikerman # - vikerman
@ -269,8 +261,8 @@
# @angular/fw-integration # @angular/fw-integration
# =========================================================== # ===========================================================
# #
# - alexeagle
# - IgorMinar # - IgorMinar
# - josephperrott
# - mhevery # - mhevery
@ -278,7 +270,6 @@
# @angular/docs-infra # @angular/docs-infra
# =========================================================== # ===========================================================
# #
# - brandonroberts
# - gkalpak # - gkalpak
# - IgorMinar # - IgorMinar
# - petebacondarwin # - petebacondarwin
@ -288,8 +279,6 @@
# @angular/fw-docs-intro # @angular/fw-docs-intro
# =========================================================== # ===========================================================
# #
# - jenniferfell
# - brandonroberts
# - IgorMinar # - IgorMinar
# - stephenfluin # - stephenfluin
@ -298,16 +287,15 @@
# @angular/fw-docs-observables # @angular/fw-docs-observables
# =========================================================== # ===========================================================
# #
# - benlesh # - alxhub
# - jasonaden
# =========================================================== # ===========================================================
# @angular/fw-docs-packaging # @angular/fw-docs-packaging
# =========================================================== # ===========================================================
# #
# - alexeagle
# - IgorMinar # - IgorMinar
# - vikerman
# =========================================================== # ===========================================================
@ -315,10 +303,9 @@
# =========================================================== # ===========================================================
# #
# - alan-agius4 # - alan-agius4
# - alexeagle
# - hansl
# - IgorMinar # - IgorMinar
# - mgechev # - mgechev
# - vikerman
# =========================================================== # ===========================================================
@ -326,11 +313,9 @@
# =========================================================== # ===========================================================
# #
# - alan-agius4 # - alan-agius4
# - alexeagle
# - hansl
# - IgorMinar # - IgorMinar
# - mgechev # - mgechev
# - vikerman
# =========================================================== # ===========================================================
@ -349,10 +334,9 @@
# =========================================================== # ===========================================================
# @angular/fw-dev-infra # @angular/dev-infra-framework
# =========================================================== # ===========================================================
# #
# - alexeagle
# - devversion # - devversion
# - filipesilva # - filipesilva
# - gkalpak # - gkalpak
@ -410,6 +394,7 @@
# ================================================ # ================================================
/packages/bazel/** @angular/tools-bazel @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/bazel/** @angular/tools-bazel @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/bazel.md @angular/tools-bazel @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -419,8 +404,11 @@
# ================================================ # ================================================
/packages/compiler/** @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/compiler/** @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/examples/compiler/** @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/compiler-cli/** @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/compiler-cli/** @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/angular-compiler-options.md @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/aot-compiler.md @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/aot-compiler.md @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/aot-metadata-errors.md @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -439,6 +427,7 @@
# ================================================ # ================================================
/packages/compiler-cli/src/ngtools/** @angular/tools-cli @angular/framework-global-approvers /packages/compiler-cli/src/ngtools/** @angular/tools-cli @angular/framework-global-approvers
/aio/content/guide/cli-builder.md @angular/tools-cli @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/ivy.md @angular/tools-cli @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/ivy.md @angular/tools-cli @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/web-worker.md @angular/tools-cli @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/web-worker.md @angular/tools-cli @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -454,12 +443,18 @@
# ================================================ # ================================================
/packages/core/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/core/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/examples/core/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/common/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/common/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/platform-browser/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/platform-browser/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/examples/platform-browser/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/platform-browser-dynamic/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/platform-browser-dynamic/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/platform-webworker/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/platform-webworker/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/platform-webworker-dynamic/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/platform-webworker-dynamic/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/examples/common/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/examples/common/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/docs/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/accessibility.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/accessibility/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/architecture-components.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/architecture-components.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/architecture-modules.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/architecture-modules.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -516,6 +511,8 @@
/aio/content/guide/hierarchical-dependency-injection.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/hierarchical-dependency-injection.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/hierarchical-dependency-injection/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/hierarchical-dependency-injection/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/providers-viewproviders/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/resolution-modifiers/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/lazy-loading-ngmodules.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/lazy-loading-ngmodules.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/lazy-loading-ngmodules/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/lazy-loading-ngmodules/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -550,11 +547,12 @@
/aio/content/examples/attribute-binding/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/attribute-binding/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/two-way-binding/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/two-way-binding/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/built-in-directives/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/built-in-directives/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/built-in-directives/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/template-reference-variables/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/template-reference-variables/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/inputs-outputs/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/inputs-outputs/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/inputs-outputs/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/template-expression-operators/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/template-expression-operators/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/pipes.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/pipes.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/pipes/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/pipes/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/pipes/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/images/guide/pipes/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -587,6 +585,7 @@
/packages/common/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/common/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/examples/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/http.md @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/http.md @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/images/guide/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -609,6 +608,7 @@
# ================================================ # ================================================
/packages/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/examples/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/forms.md @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/forms.md @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/images/guide/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -652,6 +652,7 @@
# ================================================ # ================================================
/packages/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/examples/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/router.md @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/router.md @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/images/guide/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -663,6 +664,7 @@
# ================================================ # ================================================
/packages/service-worker/** @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /packages/service-worker/** @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/examples/service-worker/** @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/service-worker-getting-started.md @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/service-worker-getting-started.md @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/service-worker-getting-started/** @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/service-worker-getting-started/** @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/app-shell.md @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/app-shell.md @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -689,6 +691,7 @@
/aio/content/examples/upgrade-phonecat-2-hybrid/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/upgrade-phonecat-2-hybrid/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/upgrade-phonecat-3-final/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/upgrade-phonecat-3-final/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/upgrade-performance.md @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/upgrade-performance.md @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/upgrade-setup.md @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/ajs-quick-reference.md @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/ajs-quick-reference.md @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/ajs-quick-reference/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/ajs-quick-reference/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -726,7 +729,6 @@ testing/** @angular/fw-test
/aio/content/examples/i18n/** @angular/fw-i18n @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/i18n/** @angular/fw-i18n @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
# ================================================ # ================================================
# @angular security # @angular security
# ================================================ # ================================================
@ -777,7 +779,6 @@ testing/** @angular/fw-test
/aio/tools/** @angular/docs-infra @angular/framework-global-approvers /aio/tools/** @angular/docs-infra @angular/framework-global-approvers
# Hidden docs # Hidden docs
/aio/content/guide/change-log.md @angular/docs-infra @angular/framework-global-approvers
/aio/content/guide/docs-style-guide.md @angular/docs-infra @angular/framework-global-approvers /aio/content/guide/docs-style-guide.md @angular/docs-infra @angular/framework-global-approvers
/aio/content/examples/docs-style-guide/** @angular/docs-infra @angular/framework-global-approvers /aio/content/examples/docs-style-guide/** @angular/docs-infra @angular/framework-global-approvers
/aio/content/images/guide/docs-style-guide/** @angular/docs-infra @angular/framework-global-approvers /aio/content/images/guide/docs-style-guide/** @angular/docs-infra @angular/framework-global-approvers
@ -790,9 +791,8 @@ testing/** @angular/fw-test
# Docs: getting started & tutorial # Docs: getting started & tutorial
# ================================================ # ================================================
/aio/content/guide/quickstart.md @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/setup-local.md @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/cli-quickstart/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/images/guide/setup-local/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/cli-quickstart/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/tutorial/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/tutorial/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/toh/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/images/guide/toh/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/toh-pt0/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/toh-pt0/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -804,8 +804,8 @@ testing/** @angular/fw-test
/aio/content/examples/toh-pt6/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/toh-pt6/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/getting-started-v0/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/getting-started-v0/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/getting-started/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/getting-started/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/getting-started/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/start/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/getting-started/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/images/guide/start/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
# ================================================ # ================================================
@ -831,11 +831,11 @@ testing/** @angular/fw-test
/aio/content/guide/npm-packages.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/npm-packages.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/browser-support.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/browser-support.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/typescript-configuration.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/typescript-configuration.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/setup.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/setup/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/examples/setup/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/build.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/build.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/build/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/images/guide/build/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/deployment.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/deployment.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/deployment/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/file-structure.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/file-structure.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/releases.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/releases.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/updating.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes /aio/content/guide/updating.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -878,44 +878,38 @@ testing/** @angular/fw-test
# ================================================ # ================================================
# Build & CI Owners # Build, CI & Dev-infra Owners
# ================================================ # ================================================
/* @angular/fw-dev-infra /* @angular/dev-infra-framework
/.buildkite/** @angular/fw-dev-infra /.buildkite/** @angular/dev-infra-framework
/.circleci/** @angular/fw-dev-infra /.circleci/** @angular/dev-infra-framework
/.devcontainer/** @angular/fw-dev-infra /.devcontainer/** @angular/dev-infra-framework
/.github/** @angular/fw-dev-infra /.github/** @angular/dev-infra-framework
/.vscode/** @angular/fw-dev-infra /.vscode/** @angular/dev-infra-framework
/docs/BAZEL.md @angular/fw-dev-infra /docs/BAZEL.md @angular/dev-infra-framework
/packages/* @angular/fw-dev-infra /packages/* @angular/dev-infra-framework
/scripts/** @angular/fw-dev-infra /packages/examples/test-utils/** @angular/dev-infra-framework
/third_party/** @angular/fw-dev-infra /packages/private/** @angular/dev-infra-framework
/tools/build/** @angular/fw-dev-infra /scripts/** @angular/dev-infra-framework
/tools/cjs-jasmine/** @angular/fw-dev-infra /third_party/** @angular/dev-infra-framework
/tools/gulp-tasks/** @angular/fw-dev-infra /tools/build/** @angular/dev-infra-framework
/tools/ngcontainer/** @angular/fw-dev-infra /tools/cjs-jasmine/** @angular/dev-infra-framework
/tools/npm/** @angular/fw-dev-infra /tools/gulp-tasks/** @angular/dev-infra-framework
/tools/npm_workspace/** @angular/fw-dev-infra /tools/ngcontainer/** @angular/dev-infra-framework
/tools/public_api_guard/** @angular/fw-dev-infra /tools/npm/** @angular/dev-infra-framework
/tools/rxjs/** @angular/fw-dev-infra /tools/npm_workspace/** @angular/dev-infra-framework
/tools/source-map-test/** @angular/fw-dev-infra /tools/public_api_guard/** @angular/dev-infra-framework
/tools/symbol-extractor/** @angular/fw-dev-infra /tools/rxjs/** @angular/dev-infra-framework
/tools/testing/** @angular/fw-dev-infra /tools/source-map-test/** @angular/dev-infra-framework
/tools/ts-api-guardian/** @angular/fw-dev-infra /tools/symbol-extractor/** @angular/dev-infra-framework
/tools/tslint/** @angular/fw-dev-infra /tools/testing/** @angular/dev-infra-framework
/tools/validate-commit-message/** @angular/fw-dev-infra /tools/ts-api-guardian/** @angular/dev-infra-framework
/tools/yarn/** @angular/fw-dev-infra /tools/tslint/** @angular/dev-infra-framework
/tools/* /tools/validate-commit-message/** @angular/dev-infra-framework
*.bzl @angular/fw-dev-infra /tools/yarn/** @angular/dev-infra-framework
/tools/* @angular/dev-infra-framework
*.bzl @angular/dev-infra-framework
# ================================================
# Material CI
# ================================================
/tools/material-ci/** @angular/fw-core @angular/framework-global-approvers
@ -931,6 +925,14 @@ testing/** @angular/fw-test
# ================================================
# Special cases
# ================================================
/aio/content/guide/static-query-migration.md @kara @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
# ================================================ # ================================================
# CODEOWNERS Owners owners ... # CODEOWNERS Owners owners ...
# ================================================ # ================================================

View File

@ -1,18 +1,80 @@
<a name="9.0.0-next.2"></a> <a name="8.2.11"></a>
# [9.0.0-next.2](https://github.com/angular/angular/compare/9.0.0-next.1...9.0.0-next.2) (2019-08-12) ## [8.2.11](https://github.com/angular/angular/compare/8.2.10...8.2.11) (2019-10-15)
### Bug Fixes ### Bug Fixes
* **bazel:** disable treeshaking when generating FESM and UMD bundles ([#32069](https://github.com/angular/angular/issues/32069)) ([4f37487](https://github.com/angular/angular/commit/4f37487)) * **service-worker:** continue serving api requests on cache failure ([#33165](https://github.com/angular/angular/issues/33165)) ([a2716ac](https://github.com/angular/angular/commit/a2716ac)), closes [#32996](https://github.com/angular/angular/issues/32996) [#21412](https://github.com/angular/angular/issues/21412)
* **compiler:** do not remove whitespace wrapping i18n expansions ([#31962](https://github.com/angular/angular/issues/31962)) ([0ddf0c4](https://github.com/angular/angular/commit/0ddf0c4))
* **ivy:** reuse compilation scope for incremental template changes. ([#31932](https://github.com/angular/angular/issues/31932)) ([eb5412d](https://github.com/angular/angular/commit/eb5412d)), closes [#31654](https://github.com/angular/angular/issues/31654)
### Performance Improvements <a name="8.2.10"></a>
## [8.2.10](https://github.com/angular/angular/compare/8.2.9...8.2.10) (2019-10-09)
* **ivy:** don't read global state when interpolated values don't change ([#32093](https://github.com/angular/angular/issues/32093)) ([6eb9c2f](https://github.com/angular/angular/commit/6eb9c2f)) This release contains various API docs improvements.
<a name="8.2.9"></a>
## [8.2.9](https://github.com/angular/angular/compare/8.2.8...8.2.9) (2019-10-02)
### Bug Fixes
* **upgrade:** fix AngularJsUrlCodec to support Safari ([#32959](https://github.com/angular/angular/issues/32959)) ([57457fb](https://github.com/angular/angular/commit/57457fb))
<a name="8.2.8"></a>
## [8.2.8](https://github.com/angular/angular/compare/8.2.7...8.2.8) (2019-09-25)
This release contains various API docs improvements.
<a name="8.2.7"></a>
## [8.2.7](https://github.com/angular/angular/compare/8.2.6...8.2.7) (2019-09-18)
### Bug Fixes
* **bazel:** ng_package(data) should support non-text files ([#32721](https://github.com/angular/angular/issues/32721)) ([ba1ef6b](https://github.com/angular/angular/commit/ba1ef6b))
* **compiler-cli:** fix typo in diagnostic template info. ([#32684](https://github.com/angular/angular/issues/32684)) ([947c076](https://github.com/angular/angular/commit/947c076)), closes [#32662](https://github.com/angular/angular/issues/32662)
* **language-service:** cache module resolution ([#32483](https://github.com/angular/angular/issues/32483)) ([1c5b157](https://github.com/angular/angular/commit/1c5b157))
<a name="8.2.6"></a>
## [8.2.6](https://github.com/angular/angular/compare/8.2.5...8.2.6) (2019-09-11)
This release contains various API docs improvements.
<a name="8.2.5"></a>
## [8.2.5](https://github.com/angular/angular/compare/8.2.4...8.2.5) (2019-09-04)
### Bug Fixes
* **common:** HttpParams fromObject accepts ReadonlyArray<string> ([#31072](https://github.com/angular/angular/issues/31072)) ([b3ea698](https://github.com/angular/angular/commit/b3ea698)), closes [#28452](https://github.com/angular/angular/issues/28452)
<a name="8.2.4"></a>
## [8.2.4](https://github.com/angular/angular/compare/8.2.3...8.2.4) (2019-08-28)
This release contains various API docs improvements.
<a name="8.2.3"></a>
## [8.2.3](https://github.com/angular/angular/compare/8.2.2...8.2.3) (2019-08-21)
### Bug Fixes
* **bazel:** pin `[@microsoft](https://github.com/microsoft)/api-extractor` ([#32187](https://github.com/angular/angular/issues/32187)) ([a7b9478](https://github.com/angular/angular/commit/a7b9478))
@ -25,18 +87,6 @@
* **bazel:** disable treeshaking when generating FESM and UMD bundles ([#32069](https://github.com/angular/angular/issues/32069)) ([3420d29](https://github.com/angular/angular/commit/3420d29)) * **bazel:** disable treeshaking when generating FESM and UMD bundles ([#32069](https://github.com/angular/angular/issues/32069)) ([3420d29](https://github.com/angular/angular/commit/3420d29))
<a name="9.0.0-next.1"></a>
# [9.0.0-next.1](https://github.com/angular/angular/compare/9.0.0-next.0...9.0.0-next.1) (2019-08-08)
### Bug Fixes
* **language-service:** getSourceFile() should only be called on TS files ([#31920](https://github.com/angular/angular/issues/31920)) ([e8b8f6d](https://github.com/angular/angular/commit/e8b8f6d))
* **language-service:** Make Definition and QuickInfo compatible with TS LS ([#31972](https://github.com/angular/angular/issues/31972)) ([a8e2ee1](https://github.com/angular/angular/commit/a8e2ee1))
* **upgrade:** compile downgraded components synchronously (if possible) ([#31840](https://github.com/angular/angular/issues/31840)) ([c1ae612](https://github.com/angular/angular/commit/c1ae612)), closes [#27217](https://github.com/angular/angular/issues/27217) [#30330](https://github.com/angular/angular/issues/30330)
<a name="8.2.1"></a> <a name="8.2.1"></a>
## [8.2.1](https://github.com/angular/angular/compare/8.2.0...8.2.1) (2019-08-08) ## [8.2.1](https://github.com/angular/angular/compare/8.2.0...8.2.1) (2019-08-08)
@ -47,47 +97,38 @@
<a name="9.0.0-next.0"></a>
# [9.0.0-next.0](https://github.com/angular/angular/compare/8.2.0-next.2...9.0.0-next.0) (2019-07-31)
* Ivy related improvements and fixes
<a name="8.2.0"></a> <a name="8.2.0"></a>
# [8.2.0](https://github.com/angular/angular/compare/8.2.0-rc.0...8.2.0) (2019-07-31) # [8.2.0](https://github.com/angular/angular/compare/8.2.0-rc.0...8.2.0) (2019-07-31)
### Bug Fixes
* **core:** DebugElement.listeners not cleared on destroy ([#31820](https://github.com/angular/angular/issues/31820)) ([46b160e](https://github.com/angular/angular/commit/46b160e))
<a name="8.2.0-rc.0"></a>
# [8.2.0-rc.0](https://github.com/angular/angular/compare/8.2.0-next.2...8.2.0-rc.0) (2019-07-26)
### Bug Fixes
* **bazel:** increase memory limit of ngc under bazel from 2 to 4 GB ([#31784](https://github.com/angular/angular/issues/31784)) ([5a8eb92](https://github.com/angular/angular/commit/5a8eb92))
* **core:** allow Z variations of CSS transforms in sanitizer ([#29264](https://github.com/angular/angular/issues/29264)) ([78e7fdd](https://github.com/angular/angular/commit/78e7fdd))
* **elements:** handle falsy initial value ([#31604](https://github.com/angular/angular/issues/31604)) ([7151eae](https://github.com/angular/angular/commit/7151eae)), closes [angular/angular#30834](https://github.com/angular/angular/issues/30834)
* **platform-browser:** debug element query predicates not compatible with strictFunctionTypes ([#30993](https://github.com/angular/angular/issues/30993)) ([10a1e19](https://github.com/angular/angular/commit/10a1e19))
### Features ### Features
* **core:** TypeScript 3.5 support ([#31615](https://github.com/angular/angular/issues/31615)) ([6ece7db](https://github.com/angular/angular/commit/6ece7db))
* **core:** add automatic migration from Renderer to Renderer2 ([#30936](https://github.com/angular/angular/issues/30936)) ([c095597](https://github.com/angular/angular/commit/c095597))
* **bazel:** compile targets used for indexing by Kythe with Ivy ([#31786](https://github.com/angular/angular/issues/31786)) ([82055b2](https://github.com/angular/angular/commit/82055b2)) * **bazel:** compile targets used for indexing by Kythe with Ivy ([#31786](https://github.com/angular/angular/issues/31786)) ([82055b2](https://github.com/angular/angular/commit/82055b2))
* **upgrade:** support $element in upgraded component template/templateUrl functions ([#31637](https://github.com/angular/angular/issues/31637)) ([29e1c53](https://github.com/angular/angular/commit/29e1c53)) * **upgrade:** support $element in upgraded component template/templateUrl functions ([#31637](https://github.com/angular/angular/issues/31637)) ([29e1c53](https://github.com/angular/angular/commit/29e1c53))
* **bazel:** allow passing a custom bazel compiler host to ngc compile ([#31341](https://github.com/angular/angular/issues/31341)) ([a29dc96](https://github.com/angular/angular/commit/a29dc96))
* **bazel:** allow passing and rewriting an old bazel host ([#31381](https://github.com/angular/angular/issues/31381)) ([11a208f](https://github.com/angular/angular/commit/11a208f)), closes [#31341](https://github.com/angular/angular/issues/31341)
### Performance Improvements ### Performance Improvements
* **compiler:** avoid copying from prototype while cloning an object ([#31638](https://github.com/angular/angular/issues/31638)) ([24ca582](https://github.com/angular/angular/commit/24ca582)), closes [#31627](https://github.com/angular/angular/issues/31627) * **compiler:** avoid copying from prototype while cloning an object ([#31638](https://github.com/angular/angular/issues/31638)) ([24ca582](https://github.com/angular/angular/commit/24ca582)), closes [#31627](https://github.com/angular/angular/issues/31627)
### Bug Fixes
* **core:** DebugElement.listeners not cleared on destroy ([#31820](https://github.com/angular/angular/issues/31820)) ([46b160e](https://github.com/angular/angular/commit/46b160e))
* **bazel:** increase memory limit of ngc under bazel from 2 to 4 GB ([#31784](https://github.com/angular/angular/issues/31784)) ([5a8eb92](https://github.com/angular/angular/commit/5a8eb92))
* **core:** allow Z variations of CSS transforms in sanitizer ([#29264](https://github.com/angular/angular/issues/29264)) ([78e7fdd](https://github.com/angular/angular/commit/78e7fdd))
* **elements:** handle falsy initial value ([#31604](https://github.com/angular/angular/issues/31604)) ([7151eae](https://github.com/angular/angular/commit/7151eae)), closes [angular/angular#30834](https://github.com/angular/angular/issues/30834)
* **platform-browser:** debug element query predicates not compatible with strictFunctionTypes ([#30993](https://github.com/angular/angular/issues/30993)) ([10a1e19](https://github.com/angular/angular/commit/10a1e19))
* use the correct WTF array to iterate over ([#31208](https://github.com/angular/angular/issues/31208)) ([9204de9](https://github.com/angular/angular/commit/9204de9))
* **bazel:** pass custom bazel compiler host rather than rewriting one ([#31496](https://github.com/angular/angular/issues/31496)) ([0c61a35](https://github.com/angular/angular/commit/0c61a35))
* **compiler-cli:** Return original sourceFile instead of redirected sourceFile from getSourceFile ([#26036](https://github.com/angular/angular/issues/26036)) ([3166cff](https://github.com/angular/angular/commit/3166cff)), closes [#22524](https://github.com/angular/angular/issues/22524)
* **language-service:** Eagarly initialize data members ([#31577](https://github.com/angular/angular/issues/31577)) ([0110de2](https://github.com/angular/angular/commit/0110de2))
* **bazel:** revert location of xi18n outputs to bazel-genfiles ([#31410](https://github.com/angular/angular/issues/31410)) ([1d3e227](https://github.com/angular/angular/commit/1d3e227))
* **compiler:** give ASTWithSource its own visit method ([#31347](https://github.com/angular/angular/issues/31347)) ([6aaca21](https://github.com/angular/angular/commit/6aaca21))
* **core:** handle `undefined` meta in `injectArgs` ([#31333](https://github.com/angular/angular/issues/31333)) ([80ccd6c](https://github.com/angular/angular/commit/80ccd6c)), closes [CLI #14888](https://github.com/angular/angular-cli/issues/14888)
* **service-worker:** cache opaque responses in data groups with `freshness` strategy ([#30977](https://github.com/angular/angular/issues/30977)) ([d7be38f](https://github.com/angular/angular/commit/d7be38f)), closes [#30968](https://github.com/angular/angular/issues/30968)
* **service-worker:** cache opaque responses when requests exceeds timeout threshold ([#30977](https://github.com/angular/angular/issues/30977)) ([93abc35](https://github.com/angular/angular/commit/93abc35))
<a name="8.1.3"></a> <a name="8.1.3"></a>
@ -104,6 +145,17 @@
* **compiler:** avoid copying from prototype while cloning an object ([#31638](https://github.com/angular/angular/issues/31638)) ([1f3daa0](https://github.com/angular/angular/commit/1f3daa0)), closes [#31627](https://github.com/angular/angular/issues/31627) * **compiler:** avoid copying from prototype while cloning an object ([#31638](https://github.com/angular/angular/issues/31638)) ([1f3daa0](https://github.com/angular/angular/commit/1f3daa0)), closes [#31627](https://github.com/angular/angular/issues/31627)
<a name="8.2.0-next.2"></a>
# [8.2.0-next.2](https://github.com/angular/angular/compare/8.2.0-next.1...8.2.0-next.2) (2019-07-17)
### Bug Fixes
* use the correct WTF array to iterate over ([#31208](https://github.com/angular/angular/issues/31208)) ([9204de9](https://github.com/angular/angular/commit/9204de9))
* **bazel:** pass custom bazel compiler host rather than rewriting one ([#31496](https://github.com/angular/angular/issues/31496)) ([0c61a35](https://github.com/angular/angular/commit/0c61a35))
* **compiler-cli:** Return original sourceFile instead of redirected sourceFile from getSourceFile ([#26036](https://github.com/angular/angular/issues/26036)) ([3166cff](https://github.com/angular/angular/commit/3166cff)), closes [#22524](https://github.com/angular/angular/issues/22524)
* **language-service:** Eagarly initialize data members ([#31577](https://github.com/angular/angular/issues/31577)) ([0110de2](https://github.com/angular/angular/commit/0110de2))
<a name="8.1.2"></a> <a name="8.1.2"></a>
@ -117,6 +169,23 @@
* **core:** export provider interfaces that are part of the public API types ([#31377](https://github.com/angular/angular/issues/31377)) ([bebf089](https://github.com/angular/angular/commit/bebf089)), closes [/github.com/angular/angular/pull/31377#discussion_r299254408](https://github.com//github.com/angular/angular/pull/31377/issues/discussion_r299254408) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L365-L366](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L365-L366) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L283-L284](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L283-L284) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts#L23](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts/issues/L23) * **core:** export provider interfaces that are part of the public API types ([#31377](https://github.com/angular/angular/issues/31377)) ([bebf089](https://github.com/angular/angular/commit/bebf089)), closes [/github.com/angular/angular/pull/31377#discussion_r299254408](https://github.com//github.com/angular/angular/pull/31377/issues/discussion_r299254408) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L365-L366](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L365-L366) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L283-L284](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L283-L284) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts#L23](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts/issues/L23)
<a name="8.2.0-next.1"></a>
# [8.2.0-next.1](https://github.com/angular/angular/compare/8.2.0-next.0...8.2.0-next.1) (2019-07-10)
### Bug Fixes
* **bazel:** revert location of xi18n outputs to bazel-genfiles ([#31410](https://github.com/angular/angular/issues/31410)) ([1d3e227](https://github.com/angular/angular/commit/1d3e227))
* **compiler:** give ASTWithSource its own visit method ([#31347](https://github.com/angular/angular/issues/31347)) ([6aaca21](https://github.com/angular/angular/commit/6aaca21))
### Features
* **core:** add automatic migration from Renderer to Renderer2 ([#30936](https://github.com/angular/angular/issues/30936)) ([c095597](https://github.com/angular/angular/commit/c095597))
<a name="8.1.1"></a> <a name="8.1.1"></a>
## [8.1.1](https://github.com/angular/angular/compare/8.1.0...8.1.1) (2019-07-10) ## [8.1.1](https://github.com/angular/angular/compare/8.1.0...8.1.1) (2019-07-10)
@ -126,6 +195,23 @@
* **core:** export provider interfaces that are part of the public API types ([#31377](https://github.com/angular/angular/issues/31377)) ([bebf089](https://github.com/angular/angular/commit/bebf089)), closes [/github.com/angular/angular/pull/31377#discussion_r299254408](https://github.com//github.com/angular/angular/pull/31377/issues/discussion_r299254408) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L365-L366](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L365-L366) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L283-L284](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L283-L284) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts#L23](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts/issues/L23) * **core:** export provider interfaces that are part of the public API types ([#31377](https://github.com/angular/angular/issues/31377)) ([bebf089](https://github.com/angular/angular/commit/bebf089)), closes [/github.com/angular/angular/pull/31377#discussion_r299254408](https://github.com//github.com/angular/angular/pull/31377/issues/discussion_r299254408) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L365-L366](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L365-L366) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L283-L284](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L283-L284) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts#L23](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts/issues/L23)
<a name="8.2.0-next.0"></a>
# [8.2.0-next.0](https://github.com/angular/angular/compare/8.1.0-rc.0...8.2.0-next.0) (2019-07-02)
### Bug Fixes
* **core:** handle `undefined` meta in `injectArgs` ([#31333](https://github.com/angular/angular/issues/31333)) ([80ccd6c](https://github.com/angular/angular/commit/80ccd6c)), closes [CLI #14888](https://github.com/angular/angular-cli/issues/14888)
* **service-worker:** cache opaque responses in data groups with `freshness` strategy ([#30977](https://github.com/angular/angular/issues/30977)) ([d7be38f](https://github.com/angular/angular/commit/d7be38f)), closes [#30968](https://github.com/angular/angular/issues/30968)
* **service-worker:** cache opaque responses when requests exceeds timeout threshold ([#30977](https://github.com/angular/angular/issues/30977)) ([93abc35](https://github.com/angular/angular/commit/93abc35))
### Features
* **bazel:** allow passing a custom bazel compiler host to ngc compile ([#31341](https://github.com/angular/angular/issues/31341)) ([a29dc96](https://github.com/angular/angular/commit/a29dc96))
* **bazel:** allow passing and rewriting an old bazel host ([#31381](https://github.com/angular/angular/issues/31381)) ([11a208f](https://github.com/angular/angular/commit/11a208f)), closes [#31341](https://github.com/angular/angular/issues/31341)
<a name="8.1.0"></a> <a name="8.1.0"></a>
# [8.1.0](https://github.com/angular/angular/compare/8.1.0-rc.0...8.1.0) (2019-07-02) # [8.1.0](https://github.com/angular/angular/compare/8.1.0-rc.0...8.1.0) (2019-07-02)

View File

@ -201,7 +201,7 @@ Must be one of the following:
* **test**: Adding missing tests or correcting existing tests * **test**: Adding missing tests or correcting existing tests
### Scope ### Scope
The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages. The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages).
The following is the list of supported scopes: The following is the list of supported scopes:
@ -233,6 +233,7 @@ There are currently a few exceptions to the "use package name" rule:
* **docs-infra**: used for docs-app (angular.io) related changes within the /aio directory of the * **docs-infra**: used for docs-app (angular.io) related changes within the /aio directory of the
repo repo
* **ivy**: used for changes to the [Ivy renderer](https://github.com/angular/angular/issues/21706). * **ivy**: used for changes to the [Ivy renderer](https://github.com/angular/angular/issues/21706).
* **ngcc**: used for changes to the [Angular Compatibility Compiler](./packages/compiler-cli/ngcc/README.md)
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all * none/empty string: useful for `style`, `test` and `refactor` changes that are done across all
packages (e.g. `style: add missing semicolons`) and for docs changes that are not related to a packages (e.g. `style: add missing semicolons`) and for docs changes that are not related to a
specific package (e.g. `docs: fix typo in tutorial`). specific package (e.g. `docs: fix typo in tutorial`).

View File

@ -6,7 +6,7 @@
# Angular # Angular
Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages. Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
## Quickstart ## Quickstart

View File

@ -65,6 +65,9 @@ node_repositories(
}, },
node_version = "10.16.0", node_version = "10.16.0",
package_json = ["//:package.json"], package_json = ["//:package.json"],
yarn_repositories = {
"1.17.3": ("yarn-v1.17.3.tar.gz", "yarn-v1.17.3", "e3835194409f1b3afa1c62ca82f561f1c29d26580c9e220c36866317e043c6f3"),
},
# yarn 1.13.0 under Bazel has a regression on Windows that causes build errors on rebuilds: # yarn 1.13.0 under Bazel has a regression on Windows that causes build errors on rebuilds:
# ``` # ```
# ERROR: Source forest creation failed: C:/.../fyuc5c3n/execroot/angular/external (Directory not empty) # ERROR: Source forest creation failed: C:/.../fyuc5c3n/execroot/angular/external (Directory not empty)
@ -73,7 +76,7 @@ node_repositories(
# It possible that versions of yarn past 1.13.0 do not have this issue, however, before # It possible that versions of yarn past 1.13.0 do not have this issue, however, before
# advancing this version we need to test manually on Windows that the above error does not # advancing this version we need to test manually on Windows that the above error does not
# happen as the issue is not caught by CI. # happen as the issue is not caught by CI.
yarn_version = "1.12.1", yarn_version = "1.17.3",
) )
yarn_install( yarn_install(

View File

@ -18,7 +18,7 @@ Here are the most important tasks you might need to use:
* `yarn build` - create a production build of the application (after installing dependencies, boilerplate, etc). * `yarn build` - create a production build of the application (after installing dependencies, boilerplate, etc).
* `yarn build-local` - same as `build`, but use `setup-local` instead of `setup`. * `yarn build-local` - same as `build`, but use `setup-local` instead of `setup`.
* `yarn build-with-ivy` - same as `build-local`, but in addition also turns on `ivy` mode in aio. * `yarn build-local-with-ivy` - same as `build-local`, but in addition also turns on `ivy` mode in aio.
(Note: To turn on `ivy` mode in examples, see `yarn boilerplate:add` below.) (Note: To turn on `ivy` mode in examples, see `yarn boilerplate:add` below.)
* `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary. * `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
@ -46,6 +46,15 @@ Here are the most important tasks you might need to use:
- `yarn example-e2e --filter=foo` - limit e2e tests to those containing the word "foo" - `yarn example-e2e --filter=foo` - limit e2e tests to those containing the word "foo"
- `yarn example-e2e --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder - `yarn example-e2e --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder
> **Note for Windows users**
>
> Setting up the examples involves creating some [symbolic links](https://en.wikipedia.org/wiki/Symbolic_link) (see [here](./tools/examples/README.md#symlinked-node_modules) for details). On Windows, this requires to either have [Developer Mode enabled](https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10) (supported on Windows 10 or newer) or run the setup commands as administrator.
>
> The affected commands are:
> - `yarn setup` / `yarn setup-*`
> - `yarn build` / `yarn build-*`
> - `yarn boilerplate:add`
> - `yarn example-e2e --setup`
## Using ServiceWorker locally ## Using ServiceWorker locally

View File

@ -0,0 +1,21 @@
'use strict'; // necessary for es6 output in node
import { browser, element, by } from 'protractor';
describe('Accessibility example e2e tests', () => {
beforeEach(() => {
browser.get('');
});
it('should display Accessibility Example', function () {
expect(element(by.css('h1')).getText()).toEqual('Accessibility Example');
});
it('should take a number and change progressbar width', function () {
element(by.css('input')).sendKeys('16');
expect(element(by.css('input')).getAttribute('value')).toEqual('016');
expect(element(by.css('app-example-progressbar div')).getCssValue('width')).toBe('48px');
});
});

View File

@ -0,0 +1,13 @@
<h1>Accessibility Example</h1>
<!-- #docregion template -->
<label>
Enter an example progress value
<input type="number" min="0" max="100"
[value]="progress" (input)="progress = $event.target.value">
</label>
<!-- The user of the progressbar sets an aria-label to communicate what the progress means. -->
<app-example-progressbar [value]="progress" aria-label="Example of a progress bar">
</app-example-progressbar>
<!-- #enddocregion template -->

View File

@ -0,0 +1,10 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
progress = 0;
}

View File

@ -0,0 +1,12 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { ExampleProgressbarComponent } from './progress-bar.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent, ExampleProgressbarComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }

View File

@ -0,0 +1,12 @@
:host {
display: block;
width: 300px;
height: 25px;
border: 1px solid black;
margin-top: 16px;
}
.bar {
background: blue;
height: 100%;
}

View File

@ -0,0 +1,28 @@
// #docregion progressbar-component
import { Component, Input } from '@angular/core';
/**
* Example progressbar component.
*/
@Component({
selector: 'app-example-progressbar',
template: `<div class="bar" [style.width.%]="value"></div>`,
styleUrls: ['./progress-bar.component.css'],
host: {
// Sets the role for this component to "progressbar"
role: 'progressbar',
// Sets the minimum and maximum values for the progressbar role.
'aria-valuemin': '0',
'aria-valuemax': '100',
// Binding that updates the current value of the progressbar.
'[attr.aria-valuenow]': 'value',
}
})
export class ExampleProgressbarComponent {
/** Current value of the progressbar. */
@Input() value = 0;
}
// #enddocregion progressbar-component

View File

@ -0,0 +1,14 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Accessibility Example</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>

View File

@ -0,0 +1,11 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -0,0 +1,10 @@
{
"description": "Accessibility",
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.[1,2].*"
],
"file": "src/app/app.component.ts",
"tags": ["Accessibility"]
}

View File

@ -1,6 +1,6 @@
// #docplaster // #docplaster
// #docregion imports // #docregion imports
import { Component } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { CartService } from '../cart.service'; import { CartService } from '../cart.service';
// #enddocregion imports // #enddocregion imports
@ -10,12 +10,14 @@ import { CartService } from '../cart.service';
styleUrls: ['./cart.component.css'] styleUrls: ['./cart.component.css']
}) })
// #docregion props-services, submit // #docregion props-services, submit
export class CartComponent { export class CartComponent implements OnInit {
items; items;
constructor( constructor(
private cartService: CartService private cartService: CartService
) { ) { }
ngOnInit() {
this.items = this.cartService.getItems(); this.items = this.cartService.getItems();
} }
} }

View File

@ -1,6 +1,6 @@
// #docplaster // #docplaster
// #docregion imports // #docregion imports
import { Component } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { CartService } from '../cart.service'; import { CartService } from '../cart.service';
// #enddocregion // #enddocregion
@ -11,7 +11,7 @@ import { CartService } from '../cart.service';
styleUrls: ['./shipping.component.css'] styleUrls: ['./shipping.component.css']
}) })
// #docregion props, ctor // #docregion props, ctor
export class ShippingComponent { export class ShippingComponent implements OnInit {
shippingCosts; shippingCosts;
// #enddocregion props // #enddocregion props
@ -19,10 +19,12 @@ export class ShippingComponent {
constructor( constructor(
private cartService: CartService private cartService: CartService
) { ) {
// #enddocregion inject-cart-service
this.shippingCosts = this.cartService.getShippingPrices();
// #docregion inject-cart-service
} }
// #enddocregion inject-cart-service // #enddocregion inject-cart-service
ngOnInit() {
this.shippingCosts = this.cartService.getShippingPrices();
}
// #docregion props // #docregion props
} }

View File

@ -1,6 +1,6 @@
<h1>HTTP Sample</h1> <h1>HTTP Sample</h1>
<div> <div>
<input type="checkbox" id="heroes" [checked]="toggleHeroes" (click)="toggleHeroes()"> <input type="checkbox" id="heroes" [checked]="showHeroes" (click)="toggleHeroes()">
<label for="heroes">Heroes</label> <label for="heroes">Heroes</label>
<input type="checkbox" id="config" [checked]="showConfig" (click)="toggleConfig()"> <input type="checkbox" id="config" [checked]="showConfig" (click)="toggleConfig()">

View File

@ -12,7 +12,7 @@ if (environment.production) {
// use the require method provided by webpack // use the require method provided by webpack
declare const require; declare const require;
// we use the webpack raw-loader to return the content as a string // we use the webpack raw-loader to return the content as a string
const translations = require(`raw-loader!./locale/messages.fr.xlf`); const translations = require('raw-loader!./locale/messages.fr.xlf').default;
platformBrowserDynamic().bootstrapModule(AppModule, { platformBrowserDynamic().bootstrapModule(AppModule, {
providers: [ providers: [

View File

@ -0,0 +1,24 @@
import { browser, element, by } from 'protractor';
import { logging } from 'selenium-webdriver';
describe('Providers and ViewProviders', function () {
beforeEach(() => {
browser.get('');
});
it('shows basic flower emoji', function() {
expect(element.all(by.css('p')).get(0).getText()).toContain('🌺');
});
it('shows whale emoji', function() {
expect(element.all(by.css('p')).get(1).getText()).toContain('🐳');
});
it('shows sunflower from FlowerService', function() {
expect(element.all(by.css('p')).get(8).getText()).toContain('🌻');
});
});

View File

@ -0,0 +1,10 @@
// #docregion animal-service
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class AnimalService {
emoji = '🐳';
}
// #enddocregion animal-service

View File

@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { FlowerService } from './flower.service';
import { AnimalService } from './animal.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
// #docregion injection
export class AppComponent {
constructor(public flower: FlowerService) {}
}
// #enddocregion injection

View File

@ -0,0 +1,15 @@
<h2>From AppComponent:</h2>
<!-- #docregion binding-flower -->
<p>Emoji from FlowerService: {{flower.emoji}}</p>
<!-- #enddocregion binding-flower -->
<!-- #docregion binding-animal -->
<p>Emoji from AnimalService: {{animal.emoji}}</p>
<!-- #enddocregion binding-animal -->
<hr />
<h2>From ChildComponent:</h2>
<!-- #docregion content-projection -->
<app-child><app-inspector></app-inspector></app-child>
<!-- #enddocregion content-projection -->

View File

@ -0,0 +1,31 @@
import { Component } from '@angular/core';
import { FlowerService } from './flower.service';
import { AnimalService } from './animal.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
// #docregion inject-animal-service
export class AppComponent {
constructor(public flower: FlowerService, public animal: AnimalService) {}
}
// #enddocregion inject-animal-service
// When using @Host() together with @SkipSelf() in
// child.component.ts for the AnimalService, add the
// following viewProviders array to the @Component metadata:
// viewProviders: [{ provide: AnimalService, useValue: { emoji: '🦔' } }]
// So, the entire @ChildComponent() decorator and its
// metadata should be as follows:
// @Component({
// selector: 'app-root',
// templateUrl: './app.component.html',
// styleUrls: [ './app.component.css' ],
// viewProviders: [{ provide: AnimalService, useValue: { emoji: '🦔' } }]
// })

View File

@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { ChildComponent } from './child/child.component';
import { InspectorComponent } from './inspector/inspector.component';
// #docregion appmodule
@NgModule({
imports: [ BrowserModule, FormsModule ],
declarations: [ AppComponent, ChildComponent, InspectorComponent ],
bootstrap: [ AppComponent ],
providers: []
})
export class AppModule { }
// #enddocregion appmodule

View File

@ -0,0 +1,19 @@
import { Component, OnInit, Host, SkipSelf, Optional } from '@angular/core';
import { FlowerService } from '../flower.service';
// #docregion flowerservice
@Component({
selector: 'app-child',
templateUrl: './child.component.html',
styleUrls: ['./child.component.css'],
// use the providers array to provide a service
providers: [{ provide: FlowerService, useValue: { emoji: '🌻' } }]
})
export class ChildComponent {
// inject the service
constructor( public flower: FlowerService) { }
}
// #enddocregion flowerservice

View File

@ -0,0 +1,4 @@
.container {
border: 1px solid darkblue;
padding: 1rem;
}

View File

@ -0,0 +1,24 @@
<!-- #docplaster -->
<!-- #docregion child-component -->
<!-- #docregion flower-binding -->
<p>Emoji from FlowerService: {{flower.emoji}}</p>
<!-- #enddocregion flower-binding -->
<!-- #docregion animal-binding -->
<p>Emoji from AnimalService: {{animal.emoji}}</p>
<!-- #enddocregion animal-binding -->
<div class="container">
<h3>Content projection</h3>
<!-- #enddocregion child-component -->
<p>The following is coming from content. It doesn't get to see the puppy because the puppy is declared inside the view only.</p>
<!-- #docregion child-component -->
<ng-content></ng-content>
</div>
<h3>Inside the view</h3>
<!-- #enddocregion child-component -->
<p>The following is inside the view so it does see the puppy.</p>
<!-- #docregion child-component -->
<app-inspector></app-inspector>
<!-- #enddocregion child-component -->

View File

@ -0,0 +1,44 @@
// #docplaster
import { Component, OnInit, Host, SkipSelf, Optional } from '@angular/core';
import { FlowerService } from '../flower.service';
import { AnimalService } from '../animal.service';
// #docregion provide-animal-service
@Component({
selector: 'app-child',
templateUrl: './child.component.html',
styleUrls: ['./child.component.css'],
// provide services
providers: [{ provide: FlowerService, useValue: { emoji: '🌻' } }],
viewProviders: [{ provide: AnimalService, useValue: { emoji: '🐶' } }]
})
export class ChildComponent {
// inject service
constructor( public flower: FlowerService, public animal: AnimalService) { }
// #enddocregion provide-animal-service
// viewProviders ensures that only the view gets to see this.
// With the AnimalService in the viewProviders, the
// InspectorComponent doesn't get to see it because the
// inspector is in the content.
// constructor( public flower: FlowerService, @Optional() @Host() public animal: AnimalService) { }
// Comment out the above constructor and alternately
// uncomment the two following constructors to see the
// effects of @Host() and @Host() + @SkipSelf().
// constructor(
// @Host() public animal : AnimalService,
// @Host() @Optional() public flower : FlowerService) { }
// constructor(
// @SkipSelf() @Host() public animal : AnimalService,
// @SkipSelf() @Host() @Optional() public flower : FlowerService) { }
// #docregion provide-animal-service
}
// #enddocregion provide-animal-service

View File

@ -0,0 +1,11 @@
import { Injectable } from '@angular/core';
// #docregion flowerservice
@Injectable({
providedIn: 'root'
})
export class FlowerService {
emoji = '🌺';
}
// #enddocregion flowerservice

View File

@ -0,0 +1,4 @@
<!-- #docregion binding -->
<p>Emoji from FlowerService: {{flower.emoji}}</p>
<p>Emoji from AnimalService: {{animal.emoji}}</p>
<!-- #enddocregion binding -->

View File

@ -0,0 +1,14 @@
import { Component } from '@angular/core';
import { FlowerService } from '../flower.service';
import { AnimalService } from '../animal.service';
@Component({
selector: 'app-inspector',
templateUrl: './inspector.component.html',
styleUrls: ['./inspector.component.css']
})
// #docregion injection
export class InspectorComponent {
constructor(public flower: FlowerService, public animal: AnimalService) { }
}
// #enddocregion injection

View File

@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>providers vs. viewProviders</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>

View File

@ -0,0 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));

View File

@ -0,0 +1,10 @@
{
"description": "Inputs and Outputs",
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.[1,2].*"
],
"file": "src/app/app.component.ts",
"tags": ["Inputs and Outputs"]
}

View File

@ -0,0 +1,21 @@
import { browser, element, by } from 'protractor';
describe('Resolution-modifiers-example', function () {
beforeAll(function () {
browser.get('');
});
it('shows basic flower emoji', function() {
expect(element.all(by.css('p')).get(0).getText()).toContain('🌸');
});
it('shows basic leaf emoji', function() {
expect(element.all(by.css('p')).get(1).getText()).toContain('🌿');
});
it('shows yellow flower in host child', function() {
expect(element.all(by.css('p')).get(9).getText()).toContain('🌼');
});
});

View File

@ -0,0 +1,14 @@
<h1>DI resolution modifiers</h1>
<p>Basic flower service: {{flower.emoji}}</p>
<p>Basic leaf service: {{leaf.emoji}}</p>
<app-optional></app-optional>
<app-self></app-self>
<app-self-no-data></app-self-no-data>
<app-skipself></app-skipself>
<app-host-parent></app-host-parent>

View File

@ -0,0 +1,13 @@
import { Component } from '@angular/core';
import { LeafService } from './leaf.service';
import { FlowerService } from './flower.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
name = 'Angular';
constructor(public flower: FlowerService, public leaf: LeafService) {}
}

View File

@ -0,0 +1,33 @@
;
import { OptionalComponent } from './optional/optional.component';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { SelfNoDataComponent } from './self-no-data/self-no-data.component';
import { HostComponent } from './host/host.component';
import { SelfComponent } from './self/self.component';
import { SkipselfComponent } from './skipself/skipself.component';
import { HostParentComponent } from './host-parent/host-parent.component';
import { HostChildComponent } from './host-child/host-child.component';
@NgModule({
imports: [
BrowserModule,
FormsModule
],
declarations: [
AppComponent,
OptionalComponent,
SelfComponent,
SelfNoDataComponent,
HostComponent,
SkipselfComponent,
HostParentComponent,
HostChildComponent
],
bootstrap: [AppComponent],
providers: []
})
export class AppModule { }

View File

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root' // provide this service in the root ModuleInjector
})
export class FlowerService {
emoji = '🌸';
}

View File

@ -0,0 +1,5 @@
.section {
border: 2px solid #369;
padding: 1rem;
margin: 1rem 0;
}

View File

@ -0,0 +1,4 @@
<div class="section">
<h2>Child of @Host() Component</h2>
<p>Flower emoji: {{flower.emoji}}</p>
</div>

View File

@ -0,0 +1,11 @@
import { Component } from '@angular/core';
import { FlowerService } from '../flower.service';
@Component({
selector: 'app-host-child',
templateUrl: './host-child.component.html',
styleUrls: ['./host-child.component.css']
})
export class HostChildComponent {
constructor(public flower: FlowerService) { }
}

View File

@ -0,0 +1,5 @@
.section {
border: 2px solid #369;
padding: 1rem;
margin: 1rem 0;
}

View File

@ -0,0 +1,5 @@
<div class="section">
<h2>Parent of @Host() Component</h2>
<p>Flower emoji: {{flower.emoji}}</p>
<app-host></app-host>
</div>

View File

@ -0,0 +1,16 @@
import { Component } from '@angular/core';
import { FlowerService } from '../flower.service';
@Component({
selector: 'app-host-parent',
templateUrl: './host-parent.component.html',
styleUrls: ['./host-parent.component.css'],
providers: [{ provide: FlowerService, useValue: { emoji: '🌺' } }]
})
export class HostParentComponent {
constructor(public flower: FlowerService) { }
}

View File

@ -0,0 +1,5 @@
.section {
border: 2px solid #369;
padding: 1rem;
margin: 1rem 0;
}

View File

@ -0,0 +1,6 @@
<div class="section">
<h2>@Host() Component</h2>
<p>Flower emoji: {{flower.emoji}}</p>
<p><i>(@Host() stops it here)</i></p>
<app-host-child></app-host-child>
</div>

View File

@ -0,0 +1,21 @@
import { Component, Host, Optional } from '@angular/core';
import { FlowerService } from '../flower.service';
// #docregion host-component
@Component({
selector: 'app-host',
templateUrl: './host.component.html',
styleUrls: ['./host.component.css'],
// provide the service
providers: [{ provide: FlowerService, useValue: { emoji: '🌼' } }]
})
export class HostComponent {
// use @Host() in the constructor when injecting the service
constructor(@Host() @Optional() public flower: FlowerService) { }
}
// #enddocregion host-component
// if you take out @Host() and the providers array, flower will be red hibiscus

View File

@ -0,0 +1,11 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
// #docregion leafservice
export class LeafService {
emoji = '🌿';
}
// #enddocregion leafservice

View File

@ -0,0 +1,7 @@
import { Injectable } from '@angular/core';
@Injectable()
export class OptionalService {
}
// This service isn't provided anywhere.

View File

@ -0,0 +1,5 @@
.section {
border: 2px solid #369;
padding: 1rem;
margin: 1rem 0;
}

View File

@ -0,0 +1,4 @@
<div class="section">
<h2>@Optional() Component</h2>
<p>This component still works even though the OptionalService (notice @Optional() in the consturctor isn't provided or configured anywhere. Angular goes through tree and visibilty rules, and if it doesn't find the requested service, returns null.</p>
</div>

View File

@ -0,0 +1,21 @@
import { Component, Optional } from '@angular/core';
import { OptionalService } from '../optional.service';
@Component({
selector: 'app-optional',
templateUrl: './optional.component.html',
styleUrls: ['./optional.component.css']
})
// #docregion optional-component
export class OptionalComponent {
constructor(@Optional() public optional: OptionalService) {}
}
// #enddocregion optional-component
// The OptionalService isn't provided here, in the @Injectable()
// providers array, or in the NgModule. If you remove @Optional()
// from the constructor, you'll get an error.

View File

@ -0,0 +1,5 @@
.section {
border: 2px solid #369;
padding: 1rem;
margin: 1rem 0;
}

View File

@ -0,0 +1,4 @@
<div class="section">
<h2>@Self() Component (without a provider)</h2>
<p>Leaf emoji: {{leaf?.emoji}}</p>
</div>

View File

@ -0,0 +1,18 @@
import { Component, Self, Optional } from '@angular/core';
import { LeafService } from '../leaf.service';
// #docregion self-no-data-component
@Component({
selector: 'app-self-no-data',
templateUrl: './self-no-data.component.html',
styleUrls: ['./self-no-data.component.css']
})
export class SelfNoDataComponent {
constructor(@Self() @Optional() public leaf: LeafService) { }
}
// #enddocregion self-no-data-component
// The app doesn't break because the value being available at self is optional.
// If you remove @Optional(), the app breaks.

View File

@ -0,0 +1,5 @@
.section {
border: 2px solid #369;
padding: 1rem;
margin: 1rem 0;
}

View File

@ -0,0 +1,4 @@
<div class="section">
<h2>@Self() Component</h2>
<p>Flower emoji: {{flower?.emoji}}</p>
</div>

View File

@ -0,0 +1,19 @@
import { Component, Self } from '@angular/core';
import { FlowerService } from '../flower.service';
// #docregion self-component
@Component({
selector: 'app-self',
templateUrl: './self.component.html',
styleUrls: ['./self.component.css'],
providers: [{ provide: FlowerService, useValue: { emoji: '🌼' } }]
})
export class SelfComponent {
constructor(@Self() public flower: FlowerService) {}
}
// #enddocregion self-component
// This component provides the FlowerService so the injector
// doesn't have to look further up the injector tree

View File

@ -0,0 +1,5 @@
.section {
border: 2px solid #369;
padding: 1rem;
margin: 1rem 0;
}

View File

@ -0,0 +1,4 @@
<div class="section">
<h2>@SkipSelf() Component</h2>
<p>Leaf emoji: {{leaf.emoji}}</p>
</div>

View File

@ -0,0 +1,18 @@
import { Component, SkipSelf } from '@angular/core';
import { LeafService } from '../leaf.service';
// #docregion skipself-component
@Component({
selector: 'app-skipself',
templateUrl: './skipself.component.html',
styleUrls: ['./skipself.component.css'],
// Angular would ignore this LeafService instance
providers: [{ provide: LeafService, useValue: { emoji: '🍁' } }]
})
export class SkipselfComponent {
// Use @SkipSelf() in the constructor
constructor(@SkipSelf() public leaf: LeafService) { }
}
// #enddocregion skipself-component
// @SkipSelf(): Specifies that the dependency resolution should start from the parent injector, not here.

View File

@ -0,0 +1,14 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>DI Resolution Modifiers Example</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>

View File

@ -0,0 +1,11 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -0,0 +1,10 @@
{
"description": "NgModules",
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.[1,2].*"
],
"file": "src/app/app.component.ts",
"tags": ["NgModules"]
}

View File

@ -12,7 +12,7 @@ import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';
* then the templated elements are removed removed from the DOM, * then the templated elements are removed removed from the DOM,
* the templated elements are (re)inserted into the DOM. * the templated elements are (re)inserted into the DOM.
* *
* <div *ngUnless="errorCount" class="success"> * <div *appUnless="errorCount" class="success">
* Congrats! Everything is great! * Congrats! Everything is great!
* </div> * </div>
* *

View File

@ -206,6 +206,7 @@ function heroModuleSetup() {
nameInput.value = 'quick BROWN fOx'; nameInput.value = 'quick BROWN fOx';
// dispatch a DOM event so that Angular learns of input value change. // dispatch a DOM event so that Angular learns of input value change.
// use newEvent utility function (not provided by Angular) for better browser compatibility
nameInput.dispatchEvent(newEvent('input')); nameInput.dispatchEvent(newEvent('input'));
// Tell Angular to update the display binding through the title pipe // Tell Angular to update the display binding through the title pipe

View File

@ -28,7 +28,7 @@ export class KeyUpComponent_v1 {
// #docregion key-up-component-1-class // #docregion key-up-component-1-class
onKey(event: KeyboardEvent) { // with type info onKey(event: KeyboardEvent) { // with type info
this.values += (<HTMLInputElement>event.target).value + ' | '; this.values += (event.target as HTMLInputElement).value + ' | ';
} }
// #docregion key-up-component-1-class-no-type // #docregion key-up-component-1-class-no-type
} }

View File

@ -84,48 +84,15 @@ The following example shows how to make a simple progress bar accessible by usin
* The component defines an accessibility-enabled element with both the standard HTML attribute `role`, and ARIA attributes. The ARIA attribute `aria-valuenow` is bound to the user's input. * The component defines an accessibility-enabled element with both the standard HTML attribute `role`, and ARIA attributes. The ARIA attribute `aria-valuenow` is bound to the user's input.
```ts <code-example path="accessibility/src/app/progress-bar.component.ts" header="src/app/progress-bar.component.ts" region="progressbar-component"></code-example>
import { Component, Input } from '@angular/core';
/**
* Example progressbar component.
*/
@Component({
selector: 'example-progressbar',
template: `<div class="bar" [style.width.%]="value"></div>`,
styleUrls: ['./progress-bar.css'],
host: {
// Sets the role for this component to "progressbar"
role: 'progressbar',
// Sets the minimum and maximum values for the progressbar role.
'aria-valuemin': '0',
'aria-valuemax': '0',
// Binding that updates the current value of the progressbar.
'[attr.aria-valuenow]': 'value',
}
})
export class ExampleProgressbar {
/** Current value of the progressbar. */
@Input() value: number = 0;
}
```
* In the template, the `aria-label` attribute ensures that the control is accessible to screen readers. * In the template, the `aria-label` attribute ensures that the control is accessible to screen readers.
```html <code-example path="accessibility/src/app/app.component.html" header="src/app/app.component.html" region="template"></code-example>
<label>
Enter an example progress value
<input type="number" min="0" max="100"
[value]="progress" (input)="progress = $event.target.value">
</label>
<!-- The user of the progressbar sets an aria-label to communicate what the progress means. -->
<example-progressbar [value]="progress" aria-label="Example of a progress bar">
</example-progressbar>
```
[See the full example in StackBlitz](https://stackblitz.com/edit/angular-kn5jdi?file=src%2Fapp%2Fapp.component.html). To see the progress bar in a working example app, refer to the <live-example></live-example>.
## Routing and focus management ## Routing and focus management

View File

@ -1,6 +1,6 @@
# Angular compiler options # Angular compiler options
When you use [AOT compilation](guide/aot-compiler), you can control how your application is compiled by specifying *template* compiler options in the `tsconfig.json` [TypeScript configuration file](guide/typescript-configuration). When you use [AoT compilation](guide/aot-compiler), you can control how your application is compiled by specifying *template* compiler options in the `tsconfig.json` [TypeScript configuration file](guide/typescript-configuration).
The template options object, `angularCompilerOptions`, is a sibling to the `compilerOptions` object that supplies standard options to the TypeScript compiler. The template options object, `angularCompilerOptions`, is a sibling to the `compilerOptions` object that supplies standard options to the TypeScript compiler.
@ -17,7 +17,38 @@ The template options object, `angularCompilerOptions`, is a sibling to the `comp
} }
} }
``` ```
This page describes the available Angular template compiler options.
{@a tsconfig-extends}
## Configuration inheritance with extends
Like the TypeScript compiler, The Angular AoT compiler also supports `extends` in the `angularCompilerOptions` section of the TypeScript configuration file, `tsconfig.json`.
The `extends` property is at the top level, parallel to `compilerOptions` and `angularCompilerOptions`.
A TypeScript configuration can inherit settings from another file using the `extends` property.
The configuration options from the base file are loaded first, then overridden by those in the inheriting `tsconfig` file.
For example:
```json
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"experimentalDecorators": true,
...
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"preserveWhitespaces": true,
...
}
}
```
For more information, see the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
## Template options
The following options are available for configuring the AoT template compiler.
### `allowEmptyCodegenFiles` ### `allowEmptyCodegenFiles`
@ -29,7 +60,7 @@ Modifies how Angular-specific annotations are emitted to improve tree-shaking. N
* By default, the compiler replaces decorators with a static field in the class, which allows advanced tree-shakers like [Closure compiler](https://github.com/google/closure-compiler) to remove unused classes. * By default, the compiler replaces decorators with a static field in the class, which allows advanced tree-shakers like [Closure compiler](https://github.com/google/closure-compiler) to remove unused classes.
* The `decorators` value leaves the decorators in place, which makes compilation faster. TypeScript emits calls to the` __decorate` helper. Use `--emitDecoratorMetadata` for runtime reflection (but note taht the resulting code will not properly tree-shake. * The `decorators` value leaves the decorators in place, which makes compilation faster. TypeScript emits calls to the` __decorate` helper. Use `--emitDecoratorMetadata` for runtime reflection (but note that the resulting code will not properly tree-shake.
### `annotateForClosureCompiler` ### `annotateForClosureCompiler`
@ -57,7 +88,7 @@ When enabled, the `.js` output of `ngc` does not include any lazy-loaded templat
### `enableLegacyTemplate` ### `enableLegacyTemplate`
When true, enables use of the `<template>` element, which was deprecated in Angular 4.0, in favor of `<ng-template>` (to avoid colliding with the DOM's element of the same name). Default is false. Might be required by some third-party Angular libraries. | When true, enables use of the `<template>` element, which was deprecated in Angular 4.0, in favor of `<ng-template>` (to avoid colliding with the DOM's element of the same name). Default is false. Might be required by some third-party Angular libraries.
### `flatModuleId` ### `flatModuleId`

View File

@ -93,7 +93,7 @@ In the `closed` state, shown below, the button has a height of 100 pixels, an op
In Angular, you can set multiple styles without any animation. However, without further refinement, the button instantly transforms with no fade, no shrinkage, or other visible indicator that a change is occurring. In Angular, you can set multiple styles without any animation. However, without further refinement, the button instantly transforms with no fade, no shrinkage, or other visible indicator that a change is occurring.
To make the change less abrupt, we need to define an animation *transition* to specify the changes that occur between one state and another over a period of time. The `transition()` function accepts two arguments: the first argument accepts an expression that defines the direction between two transition states, and the second argument accepts an `animate()` function. To make the change less abrupt, we need to define an animation *transition* to specify the changes that occur between one state and another over a period of time. The `transition()` function accepts two arguments: the first argument accepts an expression that defines the direction between two transition states, and the second argument accepts one or a series of `animate()` steps.
Use the `animate()` function to define the length, delay, and easing of a transition, and to designate the style function for defining styles while transitions are taking place. You can also use the `animate()` function to define the `keyframes()` function for multi-step animations. These definitions are placed in the second argument of the `animate()` function. Use the `animate()` function to define the length, delay, and easing of a transition, and to designate the style function for defining styles while transitions are taking place. You can also use the `animate()` function to define the `keyframes()` function for multi-step animations. These definitions are placed in the second argument of the `animate()` function.
@ -260,7 +260,7 @@ What it does
</tr> </tr>
<tr> <tr>
<td><code>state()</code></td> <td><code><a href="api/animations/state" class="code-anchor">state()</a></code></td>
<td>Creates a named set of CSS styles that should be applied on successful transition to a given state. The state can then be referenced by name within other animation functions.</td> <td>Creates a named set of CSS styles that should be applied on successful transition to a given state. The state can then be referenced by name within other animation functions.</td>
</tr> </tr>
@ -280,7 +280,7 @@ What it does
</tr> </tr>
<tr> <tr>
<td><code>group()</code></td> <td><code><a href="api/animations/group" class="code-anchor">group()</a></code></td>
<td>Specifies a group of animation steps (<em>inner animations</em>) to be run in parallel. Animation continues only after all inner animation steps have completed. Used within <code>sequence()</code> or <code>transition().</code></td> <td>Specifies a group of animation steps (<em>inner animations</em>) to be run in parallel. Animation continues only after all inner animation steps have completed. Used within <code>sequence()</code> or <code>transition().</code></td>
</tr> </tr>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,540 @@
# AoT metadata errors
The following are metadata errors you may encounter, with explanations and suggested corrections.
[Expression form not supported](#expression-form-not-supported)<br>
[Reference to a local (non-exported) symbol](#reference-to-a-local-symbol)<br>
[Only initialized variables and constants](#only-initialized-variables)<br>
[Reference to a non-exported class](#reference-to-a-non-exported-class)<br>
[Reference to a non-exported function](#reference-to-a-non-exported-function)<br>
[Function calls are not supported](#function-calls-not-supported)<br>
[Destructured variable or constant not supported](#destructured-variable-not-supported)<br>
[Could not resolve type](#could-not-resolve-type)<br>
[Name expected](#name-expected)<br>
[Unsupported enum member name](#unsupported-enum-member-name)<br>
[Tagged template expressions are not supported](#tagged-template-expressions-not-supported)<br>
[Symbol reference expected](#symbol-reference-expected)<br>
<hr>
{@a expression-form-not-supported}
## Expression form not supported
<div class="alert is-helpful">
*The compiler encountered an expression it didn't understand while evaluating Angular metadata.*
</div>
Language features outside of the compiler's [restricted expression syntax](guide/aot-compiler#expression-syntax)
can produce this error, as seen in the following example:
```ts
// ERROR
export class Fooish { ... }
...
const prop = typeof Fooish; // typeof is not valid in metadata
...
// bracket notation is not valid in metadata
{ provide: 'token', useValue: { [prop]: 'value' } };
...
```
You can use `typeof` and bracket notation in normal application code.
You just can't use those features within expressions that define Angular metadata.
Avoid this error by sticking to the compiler's [restricted expression syntax](guide/aot-compiler#expression-syntax)
when writing Angular metadata
and be wary of new or unusual TypeScript features.
<hr>
{@a reference-to-a-local-symbol}
## Reference to a local (non-exported) symbol
<div class="alert is-helpful">
_Reference to a local (non-exported) symbol 'symbol name'. Consider exporting the symbol._
</div>
The compiler encountered a referenced to a locally defined symbol that either wasn't exported or wasn't initialized.
Here's a `provider` example of the problem.
```ts
// ERROR
let foo: number; // neither exported nor initialized
@Component({
selector: 'my-component',
template: ... ,
providers: [
{ provide: Foo, useValue: foo }
]
})
export class MyComponent {}
```
The compiler generates the component factory, which includes the `useValue` provider code, in a separate module. _That_ factory module can't reach back to _this_ source module to access the local (non-exported) `foo` variable.
You could fix the problem by initializing `foo`.
```ts
let foo = 42; // initialized
```
The compiler will [fold](guide/aot-compiler#code-folding) the expression into the provider as if you had written this.
```ts
providers: [
{ provide: Foo, useValue: 42 }
]
```
Alternatively, you can fix it by exporting `foo` with the expectation that `foo` will be assigned at runtime when you actually know its value.
```ts
// CORRECTED
export let foo: number; // exported
@Component({
selector: 'my-component',
template: ... ,
providers: [
{ provide: Foo, useValue: foo }
]
})
export class MyComponent {}
```
Adding `export` often works for variables referenced in metadata such as `providers` and `animations` because the compiler can generate _references_ to the exported variables in these expressions. It doesn't need the _values_ of those variables.
Adding `export` doesn't work when the compiler needs the _actual value_
in order to generate code.
For example, it doesn't work for the `template` property.
```ts
// ERROR
export let someTemplate: string; // exported but not initialized
@Component({
selector: 'my-component',
template: someTemplate
})
export class MyComponent {}
```
The compiler needs the value of the `template` property _right now_ to generate the component factory.
The variable reference alone is insufficient.
Prefixing the declaration with `export` merely produces a new error, "[`Only initialized variables and constants can be referenced`](#only-initialized-variables)".
<hr>
{@a only-initialized-variables}
## Only initialized variables and constants
<div class="alert is-helpful">
_Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler._
</div>
The compiler found a reference to an exported variable or static field that wasn't initialized.
It needs the value of that variable to generate code.
The following example tries to set the component's `template` property to the value of
the exported `someTemplate` variable which is declared but _unassigned_.
```ts
// ERROR
export let someTemplate: string;
@Component({
selector: 'my-component',
template: someTemplate
})
export class MyComponent {}
```
You'd also get this error if you imported `someTemplate` from some other module and neglected to initialize it there.
```ts
// ERROR - not initialized there either
import { someTemplate } from './config';
@Component({
selector: 'my-component',
template: someTemplate
})
export class MyComponent {}
```
The compiler cannot wait until runtime to get the template information.
It must statically derive the value of the `someTemplate` variable from the source code
so that it can generate the component factory, which includes
instructions for building the element based on the template.
To correct this error, provide the initial value of the variable in an initializer clause _on the same line_.
```ts
// CORRECTED
export let someTemplate = '<h1>Greetings from Angular</h1>';
@Component({
selector: 'my-component',
template: someTemplate
})
export class MyComponent {}
```
<hr>
{@a reference-to-a-non-exported-class}
## Reference to a non-exported class
<div class="alert is-helpful">
_Reference to a non-exported class <class name>. Consider exporting the class._
</div>
Metadata referenced a class that wasn't exported.
For example, you may have defined a class and used it as an injection token in a providers array
but neglected to export that class.
```ts
// ERROR
abstract class MyStrategy { }
...
providers: [
{ provide: MyStrategy, useValue: ... }
]
...
```
Angular generates a class factory in a separate module and that
factory [can only access exported classes](guide/aot-compiler#exported-symbols).
To correct this error, export the referenced class.
```ts
// CORRECTED
export abstract class MyStrategy { }
...
providers: [
{ provide: MyStrategy, useValue: ... }
]
...
```
<hr>
{@a reference-to-a-non-exported-function}
## Reference to a non-exported function
<div class="alert is-helpful">
*Metadata referenced a function that wasn't exported.*
</div>
For example, you may have set a providers `useFactory` property to a locally defined function that you neglected to export.
```ts
// ERROR
function myStrategy() { ... }
...
providers: [
{ provide: MyStrategy, useFactory: myStrategy }
]
...
```
Angular generates a class factory in a separate module and that
factory [can only access exported functions](guide/aot-compiler#exported-symbols).
To correct this error, export the function.
```ts
// CORRECTED
export function myStrategy() { ... }
...
providers: [
{ provide: MyStrategy, useFactory: myStrategy }
]
...
```
<hr>
{@a function-calls-not-supported}
## Function calls are not supported
<div class="alert is-helpful">
_Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function._
</div>
The compiler does not currently support [function expressions or lambda functions](guide/aot-compiler#function-expression).
For example, you cannot set a provider's `useFactory` to an anonymous function or arrow function like this.
```ts
// ERROR
...
providers: [
{ provide: MyStrategy, useFactory: function() { ... } },
{ provide: OtherStrategy, useFactory: () => { ... } }
]
...
```
You also get this error if you call a function or method in a provider's `useValue`.
```ts
// ERROR
import { calculateValue } from './utilities';
...
providers: [
{ provide: SomeValue, useValue: calculateValue() }
]
...
```
To correct this error, export a function from the module and refer to the function in a `useFactory` provider instead.
```ts
// CORRECTED
import { calculateValue } from './utilities';
export function myStrategy() { ... }
export function otherStrategy() { ... }
export function someValueFactory() {
return calculateValue();
}
...
providers: [
{ provide: MyStrategy, useFactory: myStrategy },
{ provide: OtherStrategy, useFactory: otherStrategy },
{ provide: SomeValue, useFactory: someValueFactory }
]
...
```
<hr>
{@a destructured-variable-not-supported}
## Destructured variable or constant not supported
<div class="alert is-helpful">
_Referencing an exported destructured variable or constant is not supported by the template compiler. Consider simplifying this to avoid destructuring._
</div>
The compiler does not support references to variables assigned by [destructuring](https://www.typescriptlang.org/docs/handbook/variable-declarations.html#destructuring).
For example, you cannot write something like this:
```ts
// ERROR
import { configuration } from './configuration';
// destructured assignment to foo and bar
const {foo, bar} = configuration;
...
providers: [
{provide: Foo, useValue: foo},
{provide: Bar, useValue: bar},
]
...
```
To correct this error, refer to non-destructured values.
```ts
// CORRECTED
import { configuration } from './configuration';
...
providers: [
{provide: Foo, useValue: configuration.foo},
{provide: Bar, useValue: configuration.bar},
]
...
```
<hr>
{@a could-not-resolve-type}
## Could not resolve type
<div class="alert is-helpful">
*The compiler encountered a type and can't determine which module exports that type.*
</div>
This can happen if you refer to an ambient type.
For example, the `Window` type is an ambient type declared in the global `.d.ts` file.
You'll get an error if you reference it in the component constructor,
which the compiler must statically analyze.
```ts
// ERROR
@Component({ })
export class MyComponent {
constructor (private win: Window) { ... }
}
```
TypeScript understands ambient types so you don't import them.
The Angular compiler does not understand a type that you neglect to export or import.
In this case, the compiler doesn't understand how to inject something with the `Window` token.
Do not refer to ambient types in metadata expressions.
If you must inject an instance of an ambient type,
you can finesse the problem in four steps:
1. Create an injection token for an instance of the ambient type.
1. Create a factory function that returns that instance.
1. Add a `useFactory` provider with that factory function.
1. Use `@Inject` to inject the instance.
Here's an illustrative example.
```ts
// CORRECTED
import { Inject } from '@angular/core';
export const WINDOW = new InjectionToken('Window');
export function _window() { return window; }
@Component({
...
providers: [
{ provide: WINDOW, useFactory: _window }
]
})
export class MyComponent {
constructor (@Inject(WINDOW) private win: Window) { ... }
}
```
The `Window` type in the constructor is no longer a problem for the compiler because it
uses the `@Inject(WINDOW)` to generate the injection code.
Angular does something similar with the `DOCUMENT` token so you can inject the browser's `document` object (or an abstraction of it, depending upon the platform in which the application runs).
```ts
import { Inject } from '@angular/core';
import { DOCUMENT } from '@angular/platform-browser';
@Component({ ... })
export class MyComponent {
constructor (@Inject(DOCUMENT) private doc: Document) { ... }
}
```
<hr>
{@a name-expected}
## Name expected
<div class="alert is-helpful">
*The compiler expected a name in an expression it was evaluating.*
</div>
This can happen if you use a number as a property name as in the following example.
```ts
// ERROR
provider: [{ provide: Foo, useValue: { 0: 'test' } }]
```
Change the name of the property to something non-numeric.
```ts
// CORRECTED
provider: [{ provide: Foo, useValue: { '0': 'test' } }]
```
<hr>
{@a unsupported-enum-member-name}
## Unsupported enum member name
<div class="alert is-helpful">
*Angular couldn't determine the value of the [enum member](https://www.typescriptlang.org/docs/handbook/enums.html) that you referenced in metadata.*
</div>
The compiler can understand simple enum values but not complex values such as those derived from computed properties.
```ts
// ERROR
enum Colors {
Red = 1,
White,
Blue = "Blue".length // computed
}
...
providers: [
{ provide: BaseColor, useValue: Colors.White } // ok
{ provide: DangerColor, useValue: Colors.Red } // ok
{ provide: StrongColor, useValue: Colors.Blue } // bad
]
...
```
Avoid referring to enums with complicated initializers or computed properties.
<hr>
{@a tagged-template-expressions-not-supported}
## Tagged template expressions are not supported
<div class="alert is-helpful">
_Tagged template expressions are not supported in metadata._
</div>
The compiler encountered a JavaScript ES2015 [tagged template expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) such as the following.
```ts
// ERROR
const expression = 'funky';
const raw = String.raw`A tagged template ${expression} string`;
...
template: '<div>' + raw + '</div>'
...
```
[`String.raw()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw)
is a _tag function_ native to JavaScript ES2015.
The AoT compiler does not support tagged template expressions; avoid them in metadata expressions.
<hr>
{@a symbol-reference-expected}
## Symbol reference expected
<div class="alert is-helpful">
*The compiler expected a reference to a symbol at the location specified in the error message.*
</div>
This error can occur if you use an expression in the `extends` clause of a class.
<!--
Chuck: After reviewing your PR comment I'm still at a loss. See [comment there](https://github.com/angular/angular/pull/17712#discussion_r132025495).
-->

View File

@ -44,6 +44,12 @@ After running this command you will notice that the `angular.json` configuration
"browserTarget": "my-app:build", "browserTarget": "my-app:build",
"serverTarget": "my-app:server", "serverTarget": "my-app:server",
"route": "shell" "route": "shell"
},
"configurations": {
"production": {
"browserTarget": "my-app:build:production",
"serverTarget": "my-app:server:production"
}
} }
} }
</code-example> </code-example>
@ -56,4 +62,12 @@ Use the CLI to build the `app-shell` target.
ng run my-app:app-shell ng run my-app:app-shell
</code-example> </code-example>
Or to use the production configuration.
<code-example language="bash">
ng run my-app:app-shell:production
</code-example>
To verify the build output, open `dist/my-app/index.html`. Look for default text `app-shell works!` to show that the app shell route was rendered as part of the output. To verify the build output, open `dist/my-app/index.html`. Look for default text `app-shell works!` to show that the app shell route was rendered as part of the output.

View File

@ -142,7 +142,7 @@ Begin by adding `HostListener` to the list of imported symbols.
<code-example path="attribute-directives/src/app/highlight.directive.2.ts" header="src/app/highlight.directive.ts (imports)" region="imports"></code-example> <code-example path="attribute-directives/src/app/highlight.directive.2.ts" header="src/app/highlight.directive.ts (imports)" region="imports"></code-example>
Then add two eventhandlers that respond when the mouse enters or leaves, Then add two event handlers that respond when the mouse enters or leaves,
each adorned by the `HostListener` decorator. each adorned by the `HostListener` decorator.
<code-example path="attribute-directives/src/app/highlight.directive.2.ts" header="src/app/highlight.directive.ts (mouse-methods)" region="mouse-methods"></code-example> <code-example path="attribute-directives/src/app/highlight.directive.2.ts" header="src/app/highlight.directive.ts (mouse-methods)" region="mouse-methods"></code-example>

View File

@ -8,13 +8,7 @@ This page discusses build-specific configuration options for Angular projects.
You can define different named build configurations for your project, such as *stage* and *production*, with different defaults. You can define different named build configurations for your project, such as *stage* and *production*, with different defaults.
Each named build configuration can have defaults for any of the options that apply to the various build targets, such as `build`, `serve`, and `test`. The [Angular CLI](cli) `build`, `serve`, and `test` commands can then replace files with appropriate versions for your intended target environment. Each named configuration can have defaults for any of the options that apply to the various [builder targets](guide/glossary#target), such as `build`, `serve`, and `test`. The [Angular CLI](cli) `build`, `serve`, and `test` commands can then replace files with appropriate versions for your intended target environment.
The following figure shows how a project has multiple build targets, which can be executed using the named configurations that you define.
<figure>
<img src="generated/images/guide/build/build-config-targets.gif" alt="build configurations and targets">
</figure>
### Configure environment-specific defaults ### Configure environment-specific defaults
@ -170,8 +164,9 @@ You can also configure the `serve` command to use the targeted build configurati
``` ```
{@a size-budgets} {@a size-budgets}
{@a configure-size-budgets}
## Configure size budgets ## Configuring size budgets
As applications grow in functionality, they also grow in size. As applications grow in functionality, they also grow in size.
The CLI allows you to set size thresholds in your configuration to ensure that parts of your application stay within size boundaries that you define. The CLI allows you to set size thresholds in your configuration to ensure that parts of your application stay within size boundaries that you define.
@ -296,10 +291,9 @@ Autoprefixer looks for the `browserslist` configuration when it prefixes your CS
See the [browserslist repo](https://github.com/browserslist/browserslist) for more examples of how to target specific browsers and versions. See the [browserslist repo](https://github.com/browserslist/browserslist) for more examples of how to target specific browsers and versions.
<div class="alert is-helpful"> ### Backward compatibility with Lighthouse
Backward compatibility
If you want to produce a progressive web app and are using [Lighthouse](https://developers.google.com/web/tools/lighthouse/) to grade the project, add the following browserslist entry to your `package.json` file, in order to eliminate the [old flexbox](https://developers.google.com/web/tools/lighthouse/audits/old-flexbox) prefixes: If you want to produce a progressive web app and are using [Lighthouse](https://developers.google.com/web/tools/lighthouse/) to grade the project, add the following `browserslist` entry to your `package.json` file, in order to eliminate the [old flexbox](https://developers.google.com/web/tools/lighthouse/audits/old-flexbox) prefixes:
``` ```
"browserslist": [ "browserslist": [
@ -309,7 +303,23 @@ If you want to produce a progressive web app and are using [Lighthouse](https://
] ]
``` ```
</div> ### Backward compatibility with CSS grid
CSS grid layout support in Autoprefixer, which was previously on by default, is off by default in Angular 8 and higher.
To use CSS grid with IE10/11, you must explicitly enable it using the `autoplace` option.
To do this, add the following to the top of the global styles file (or within a specific css selector scope):
```
/* autoprefixer grid: autoplace /
```
or
```
/ autoprefixer grid: no-autoplace */
```
For more information, see [Autoprefixer documentation](https://autoprefixer.github.io/).
{@a proxy} {@a proxy}

View File

@ -59,8 +59,7 @@ npm install @example/my-builder
As an example, lets create a builder that executes a shell command. As an example, lets create a builder that executes a shell command.
To create a builder, use the `createBuilder()` CLI Builder function, and return a `BuilderOutput` object. To create a builder, use the `createBuilder()` CLI Builder function, and return a `BuilderOutput` object.
``` <code-example language="typescript" header="/command/index.ts">
import { BuilderOutput, createBuilder } from '@angular-devkit/architect'; import { BuilderOutput, createBuilder } from '@angular-devkit/architect';
export default createBuilder(_commandBuilder); export default createBuilder(_commandBuilder);
@ -72,13 +71,13 @@ function _commandBuilder(
... ...
} }
``` </code-example>
Now lets add some logic to it. Now lets add some logic to it.
The following code retrieves the command and arguments from the user options, spawns the new process, and waits for the process to finish. The following code retrieves the command and arguments from the user options, spawns the new process, and waits for the process to finish.
If the process is successful (returns a code of 0), it resolves the return value. If the process is successful (returns a code of 0), it resolves the return value.
``` <code-example language="typescript" header="/command/index.ts">
import { BuilderOutput, createBuilder } from '@angular-devkit/architect'; import { BuilderOutput, createBuilder } from '@angular-devkit/architect';
import * as childProcess from 'child_process'; import * as childProcess from 'child_process';
@ -95,7 +94,8 @@ function _commandBuilder(
}); });
}); });
} }
```
</code-example>
### Handling output ### Handling output
@ -105,7 +105,7 @@ This also allows the builder itself to be executed in a separate process, even i
We can retrieve a Logger instance from the context. We can retrieve a Logger instance from the context.
``` <code-example language="typescript" header="/command/index.ts">
import { BuilderOutput, createBuilder, BuilderContext } from '@angular-devkit/architect'; import { BuilderOutput, createBuilder, BuilderContext } from '@angular-devkit/architect';
import * as childProcess from 'child_process'; import * as childProcess from 'child_process';
@ -130,7 +130,7 @@ function _commandBuilder(
}); });
} }
``` </code-example>
### Progress and status reporting ### Progress and status reporting
@ -147,7 +147,7 @@ Use the `BuilderContext.reportStatus()` method to generate a status string of an
(Note that theres no guarantee that a long string will be shown entirely; it could be cut to fit the UI that displays it.) (Note that theres no guarantee that a long string will be shown entirely; it could be cut to fit the UI that displays it.)
Pass an empty string to remove the status. Pass an empty string to remove the status.
``` <code-example language="typescript" header="/command/index.ts">
import { BuilderOutput, createBuilder, BuilderContext } from '@angular-devkit/architect'; import { BuilderOutput, createBuilder, BuilderContext } from '@angular-devkit/architect';
import * as childProcess from 'child_process'; import * as childProcess from 'child_process';
@ -174,7 +174,8 @@ function _commandBuilder(
}); });
}); });
} }
```
</code-example>
## Builder input ## Builder input
@ -191,8 +192,7 @@ For our example builder, we expect the `options` value to be a `JsonObject` with
We can provide the following schema for type validation of these values. We can provide the following schema for type validation of these values.
<code-example language="json"> <code-example language="json" header="command/schema.json">
{ {
"$schema": "http://json-schema.org/schema", "$schema": "http://json-schema.org/schema",
"type": "object", "type": "object",
@ -222,7 +222,7 @@ To link our builder implementation with its schema and name, we need to create a
Create a file named `builders.json` file that looks like this. Create a file named `builders.json` file that looks like this.
<code-example language="json"> <code-example language="json" header="builders.json">
{ {
"builders": { "builders": {
@ -238,7 +238,7 @@ Create a file named `builders.json` file that looks like this.
In the `package.json` file, add a `builders` key that tells the Architect tool where to find our builder definition file. In the `package.json` file, add a `builders` key that tells the Architect tool where to find our builder definition file.
<code-example language="json"> <code-example language="json" header="package.json">
{ {
"name": "@example/command-runner", "name": "@example/command-runner",
@ -257,7 +257,7 @@ The first part of this is the package name (resolved using node resolution), an
Using one of our `options` is very straightforward, we did this in the previous section when we accessed `options.command`. Using one of our `options` is very straightforward, we did this in the previous section when we accessed `options.command`.
<code-example language="typescript"> <code-example language="typescript" header="/command/index.ts">
context.reportStatus(`Executing "${options.command}"...`); context.reportStatus(`Executing "${options.command}"...`);
const child = childProcess.spawn(options.command, options.args, { stdio: 'pipe' }); const child = childProcess.spawn(options.command, options.args, { stdio: 'pipe' });
@ -267,14 +267,14 @@ Using one of our `options` is very straightforward, we did this in the previous
A builder must have a defined target that associates it with a specific input configuration and [project](guide/glossary#project). A builder must have a defined target that associates it with a specific input configuration and [project](guide/glossary#project).
Targets are defined in the `angular.json` [workspace configuration file](guide/workspace-config). Targets are defined in the `angular.json` [CLI configuration file](guide/workspace-config).
A target specifies the builder to use, its default options configuration, and named alternative configurations. A target specifies the builder to use, its default options configuration, and named alternative configurations.
The Architect tool uses the target definition to resolve input options for a given run. The Architect tool uses the target definition to resolve input options for a given run.
The `angular.json` file has a section for each project, and the "architect" section of each project configures targets for builders used by CLI commands such as 'build', 'test', and 'lint'. The `angular.json` file has a section for each project, and the "architect" section of each project configures targets for builders used by CLI commands such as 'build', 'test', and 'lint'.
By default, for example, the `build` command runs the builder `@angular-devkit/build-angular:browser` to perform the build task, and passes in default option values as specified for the `build` target in `angular.json`. By default, for example, the `build` command runs the builder `@angular-devkit/build-angular:browser` to perform the build task, and passes in default option values as specified for the `build` target in `angular.json`.
<code-example language="json"> <code-example language="json" header="angular.json">
{ {
"myApp": { "myApp": {
... ...
@ -361,7 +361,7 @@ npm install @example/command-runner
If we create a new project with `ng new builder-test`, the generated `angular.json` file looks something like this, with only default builder configurations. If we create a new project with `ng new builder-test`, the generated `angular.json` file looks something like this, with only default builder configurations.
<code-example language="json"> <code-example language="json" header="angular.json">
{ {
// ... // ...
@ -413,7 +413,7 @@ We need to update the `angular.json` file to add a target for this builder to th
* The configurations key is optional, we'll leave it out for now. * The configurations key is optional, we'll leave it out for now.
<code-example language="json"> <code-example language="json" header="angular.json">
{ {
"projects": { "projects": {
@ -493,7 +493,7 @@ Use integration testing for your builder, so that you can use the Architect sche
Heres an example of a test that runs the command builder. Heres an example of a test that runs the command builder.
The test uses the builder to run the `ls` command, then validates that it ran successfully and listed the proper files. The test uses the builder to run the `ls` command, then validates that it ran successfully and listed the proper files.
<code-example language="typescript"> <code-example language="typescript" header="command/index_spec.ts">
import { Architect } from '@angular-devkit/architect'; import { Architect } from '@angular-devkit/architect';
import { TestingArchitectHost } from '@angular-devkit/architect/testing'; import { TestingArchitectHost } from '@angular-devkit/architect/testing';

View File

@ -1,4 +1,4 @@
# Creating Libraries # Creating Libraries
You can create and publish new libraries to extend Angular functionality. If you find that you need to solve the same problem in more than one app (or want to share your solution with other developers), you have a candidate for a library. You can create and publish new libraries to extend Angular functionality. If you find that you need to solve the same problem in more than one app (or want to share your solution with other developers), you have a candidate for a library.
@ -13,9 +13,15 @@ A simple example might be a button that sends users to your company website, tha
Use the Angular CLI to generate a new library skeleton with the following command: Use the Angular CLI to generate a new library skeleton with the following command:
<code-example language="bash"> <code-example language="bash">
ng new my-workspace --create-application=false
cd my-workspace
ng generate library my-lib ng generate library my-lib
</code-example> </code-example>
<div class="alert is-helpful">
<p>You can use the monorepo model to use the same workspace for multiple projects. See <a href="guide/file-structure#multiple-projects">Setting up for a multi-project workspace</a>.</p>
</div>
This creates the `projects/my-lib` folder in your workspace, which contains a component and a service inside an NgModule. This creates the `projects/my-lib` folder in your workspace, which contains a component and a service inside an NgModule.
The workspace configuration file, `angular.json`, is updated with a project of type 'library'. The workspace configuration file, `angular.json`, is updated with a project of type 'library'.
@ -188,8 +194,23 @@ You can rebuild your library whenever you make changes to it, but this extra ste
*Incremental builds* functionality improves the library-development experience. *Incremental builds* functionality improves the library-development experience.
Every time a file is changed a partial build is performed that emits the amended files. Every time a file is changed a partial build is performed that emits the amended files.
Incremental builds can be run as a backround process in your dev environment. To take advantage of this feature add the `--watch` flag to the build command: Incremental builds can be run as a background process in your dev environment. To take advantage of this feature add the `--watch` flag to the build command:
<code-example language="bash"> <code-example language="bash">
ng build my-lib --watch ng build my-lib --watch
</code-example> </code-example>
<div class="alert is-important">
The CLI `build` command uses a different builder and invokes a different build tool for libraries than it does for applications.
* The build system for apps, `@angular-devkit/build-angular`, is based on `webpack`, and is included in all new Angular CLI projects.
* The build system for libraries is based on `ng-packagr`. It is only added to your dependencies when you add a library using `ng generate library my-lib`.
The two build systems support different things, and even where they support the same things, they do those things differently.
This means that the TypeScript source can result in different JavaScript code in a built library than it would in a built application.
For this reason, an app that depends on a library should only use TypeScript path mappings that point to the *built library*.
TypeScript path mappings should *not* point to the library source `.ts` files.
</div>

View File

@ -262,7 +262,7 @@ Providers can also be scoped by injector through constructor parameter decorator
</code-example> </code-example>
Using the `@Self` decorator, the injector only looks at the component's injector for its providers. The `@SkipSelf` decorator allows you to skip the local injector and look up in the hierarchy to find a provider that satisfies this dependency. The `sessionStorageService` instance interacts with the `BrowserStorageService` using the `sessionStorage` browser API, while the `localStorageService` skips the local injector and uses the root `BrowserStorageService` that uses the `localStorage` browswer API. Using the `@Self` decorator, the injector only looks at the component's injector for its providers. The `@SkipSelf` decorator allows you to skip the local injector and look up in the hierarchy to find a provider that satisfies this dependency. The `sessionStorageService` instance interacts with the `BrowserStorageService` using the `sessionStorage` browser API, while the `localStorageService` skips the local injector and uses the root `BrowserStorageService` that uses the `localStorage` browser API.
{@a component-element} {@a component-element}

View File

@ -134,7 +134,7 @@ The `@NgModule()` and `@Component()` decorators have the `providers` metadata op
Components are directives, and the `providers` option is inherited from `@Directive()`. You can also configure providers for directives and pipes at the same level as the component. Components are directives, and the `providers` option is inherited from `@Directive()`. You can also configure providers for directives and pipes at the same level as the component.
Learn more about [where to configure providers](guide/hierarchical-dependency-injection#where-to-register). Learn more about [where to configure providers](guide/hierarchical-dependency-injection).
</div> </div>

View File

@ -8,7 +8,7 @@ When you are ready to deploy your Angular application to a remote server, you ha
## Simple deployment options ## Simple deployment options
Before fully deploying your application, you can test the process, build configuration, and deployed behavior by using one of these interim techniques Before fully deploying your application, you can test the process, build configuration, and deployed behavior by using one of these interim techniques.
### Building and serving from disk ### Building and serving from disk
@ -41,7 +41,7 @@ You will need two terminals to get the live-reload experience.
<code-example language="none" class="code-shell"> <code-example language="none" class="code-shell">
lite-server --baseDir="dist" lite-server --baseDir="dist/project-name"
</code-example> </code-example>
@ -53,6 +53,35 @@ This method is for development and testing only, and is not a supported or secur
</div> </div>
### Automatic deployment with the CLI
The Angular CLI command `ng deploy` (introduced in version 8.3.0) executes the `deploy` [CLI builder](https://angular.io/guide/cli-builder) associated with your project. A number of third-party builders implement deployment capabilities to different platforms. You can add any of them to your project by running `ng add [package name]`.
When you add a package with deployment capability, it'll automatically update your workspace configuration (`angular.json` file) with a `deploy` section for the selected project. You can then use the `ng deploy` command to deploy that project.
For example, the following command automatically deploys a project to Firebase.
<code-example language="none" class="code-shell">
ng add @angular/fire
ng deploy
</code-example>
The command is interactive. In this case, you must have or create a Firebase account, and authenticate using that account. The command prompts you to select a Firebase project for deployment
After the command produces an optimal build of your application (equivalent to `ng deploy --prod`), it'll upload the production assets to Firebase.
In the table below, you can find a list of packages which implement deployment functionality to different platforms. The `deploy` command for each package may require different command line options. You can read more by following the links associated with the package names below:
| Deployment to | Package |
|---------------------------------------------------------------|--------------------------------------------------------------------------------|
| [Firebase hosting](https://firebase.google.com/docs/hosting) | [`@angular/fire`](https://npmjs.org/package/@angular/fire) |
| [Azure](https://azure.microsoft.com/en-us/) | [`@azure/ng-deploy`](https://npmjs.org/package/@azure/ng-deploy) |
| [Now](https://zeit.co/now) | [`@zeit/ng-deploy`](https://npmjs.org/package/@zeit/ng-deploy) |
| [Netlify](https://www.netlify.com/) | [`@netlify-builder/deploy`](https://npmjs.org/package/@netlify-builder/deploy) |
| [GitHub pages](https://pages.github.com/) | [`angular-cli-ghpages`](https://npmjs.org/package/angular-cli-ghpages) |
If you're deploying to a self-managed server or there's no builder for your favorite cloud platform, you can either create a builder that allows you to use the `ng deploy` command, or read through this guide to learn how to manually deploy your app.
### Basic deployment to a remote server ### Basic deployment to a remote server
For the simplest deployment, create a production build and copy the output directory to a web server. For the simplest deployment, create a production build and copy the output directory to a web server.
@ -275,7 +304,7 @@ Configure the Angular Router to defer loading of all other modules (and their as
or by [_lazy loading_](guide/router#asynchronous-routing "Lazy loading") or by [_lazy loading_](guide/router#asynchronous-routing "Lazy loading")
them on demand. them on demand.
<div class="callout is-helpful> <div class="callout is-helpful">
<header>Don't eagerly import something from a lazy-loaded module</header> <header>Don't eagerly import something from a lazy-loaded module</header>
@ -589,14 +618,14 @@ In `angular.json` add two new configuration sections under the `build` and `serv
... ...
}, },
"es5": { "es5": {
"browserTarget": "app:build:es5" "browserTarget": "<app-name>:build:es5"
} }
} }
}, },
</code-example> </code-example>
You can then run the serve with this configuration. You can then run the `ng serve` command with this configuration. Make sure to replace `<app-name>` (in `"<app-name>:build:es5"`) with the actual name of the app, as it appears under `projects` in `angular.json`. For example, if your app name is `myAngularApp` the config will become `"browserTarget": "myAngularApp:build:es5"`.
<code-example language="none" class="code-shell"> <code-example language="none" class="code-shell">
@ -651,24 +680,24 @@ Create an [ES5 serve configuration](guide/deployment#configuring-serve-for-es5)
<code-example language="json"> <code-example language="json">
"test": { "e2e": {
"builder": "@angular-devkit/build-angular:protractor", "builder": "@angular-devkit/build-angular:protractor",
"options": { "options": {
... ...
}, },
"configurations": { "configurations": {
"production": { "production": {
... ...
}, },
"es5": { "es5": {
"devServerTarget": "app:serve:es5" "devServerTarget": "<app-name>:serve:es5"
} }
} }
}, },
</code-example> </code-example>
You can then run the e2e's with this configuration You can then run the `ng e2e` command with this configuration. Make sure to replace `<app-name>` (in `"<app-name>:serve:es5"`) with the actual name of the app, as it appears under `projects` in `angular.json`. For example, if your app name is `myAngularApp` the config will become `"devServerTarget": "myAngularApp:serve:es5"`.
<code-example language="none" class="code-shell"> <code-example language="none" class="code-shell">

View File

@ -396,10 +396,10 @@ The following APIs have been removed starting with version 8.0.0:
| Package | API | Replacement | Notes | | Package | API | Replacement | Notes |
| ------- | -------------- | ----------- | ----- | | ------- | -------------- | ----------- | ----- |
| [`@angular/http`](https://v7.angular.io/api/http) | All exports | [`@angular/common/http`](https://v7.angular.io/api/common/http) | See [below](#http). | | [`@angular/http`](https://v7.angular.io/api/http) | All exports | [`@angular/common/http`](api/common/http) | See [below](#http). |
[`@angular/http/testing`](https://v7.angular.io/api/http/testing) | All exports | [`@angular/common/http/testing`](https://v7.angular.io/api/common/http/testing) | See [below](#http). | [`@angular/http/testing`](https://v7.angular.io/api/http/testing) | All exports | [`@angular/common/http/testing`](api/common/http/testing) | See [below](#http). |
| `@angular/platform-browser` | [`DOCUMENT`](https://v7.angular.io/api/platform-browser/DOCUMENT) | [`DOCUMENT` in `@angular/common`](https://v7.angular.io/api/common/DOCUMENT) | Updating to version 8 with [`ng update`](cli/update) changes this automatically. | | `@angular/platform-browser` | [`DOCUMENT`](https://v7.angular.io/api/platform-browser/DOCUMENT) | [`DOCUMENT` in `@angular/common`](api/common/DOCUMENT) | Updating to version 8 with [`ng update`](cli/update) changes this automatically. |
| `@angular/core/testing` | [`TestBed.deprecatedOverrideProvider()`](https://v7.angular.io/api/core/testing/TestBed#deprecatedoverrideprovider) | [`TestBed.overrideProvider()`] (api/core/testing/TestBed#overrideprovider) | none | | `@angular/core/testing` | [`TestBed.deprecatedOverrideProvider()`](https://v7.angular.io/api/core/testing/TestBed#deprecatedoverrideprovider) | [`TestBed.overrideProvider()`](api/core/testing/TestBed#overrideprovider) | none |
| `@angular/core/testing` | [`TestBedStatic.deprecatedOverrideProvider()`](https://v7.angular.io/api/core/testing/TestBedStatic#deprecatedoverrideprovider) | [`TestBedStatic.overrideProvider()`](api/core/testing/TestBedStatic#overrideprovider) | none | | `@angular/core/testing` | [`TestBedStatic.deprecatedOverrideProvider()`](https://v7.angular.io/api/core/testing/TestBedStatic#deprecatedoverrideprovider) | [`TestBedStatic.overrideProvider()`](api/core/testing/TestBedStatic#overrideprovider) | none |
@ -464,100 +464,3 @@ For more information about using `@angular/common/http`, see the [HttpClient gui
| --------------------- | ------------------------------------------- | | --------------------- | ------------------------------------------- |
| `MockBackend` | [`HttpTestingController`](/api/common/http/testing/HttpTestingController) | | `MockBackend` | [`HttpTestingController`](/api/common/http/testing/HttpTestingController) |
| `MockConnection` | [`HttpTestingController`](/api/common/http/testing/HttpTestingController) | | `MockConnection` | [`HttpTestingController`](/api/common/http/testing/HttpTestingController) |
## Renderer to Renderer2 migration
### Migration Overview
The `Renderer` class has been marked as deprecated since Angular version 4. This section provides guidance on migrating from this deprecated API to the newer `Renderer2` API and what it means for your app.
### Why should I migrate to Renderer2?
The deprecated `Renderer` class has been removed in version 9 of Angular, so it's necessary to migrate to a supported API. Using `Renderer2` is the recommended strategy because it supports a similar set of functionality to `Renderer`. The API surface is quite large (with 19 methods), but the schematic should simplify this process for your applications.
### Is there action required on my end?
No. The schematic should handle most cases with the exception of `Renderer.animate()` and `Renderer.setDebugInfo()`, which already arent supported.
### What are the `__ngRendererX` methods? Why are they necessary?
Some methods either don't have exact equivalents in `Renderer2`, or they correspond to more than one expression. For example, both renderers have a `createElement()` method, but they're not equal because a call such as `renderer.createElement(parentNode, namespaceAndName)` in the `Renderer` corresponds to the following block of code in `Renderer2`:
```ts
const [namespace, name] = splitNamespace(namespaceAndName);
const el = renderer.createElement(name, namespace);
if (parentNode) {
renderer.appendChild(parentNode, el);
}
return el;
```
Migration has to guarantee that the return values of functions and types of variables stay the same. To handle the majority of cases safely, the schematic declares helper functions at the bottom of the user's file. These helpers encapsulate your own logic and keep the replacements inside your code down to a single function call. Here's an example of how the `createElement()` migration looks:
**Before:**
```ts
public createAndAppendElement() {
const el = this.renderer.createElement('span');
el.textContent = 'hello world';
return el;
}
```
**After:**
<code-example>
public createAndAppendElement() {
const el = __ngRendererCreateElement(this.renderer, this.element, 'span');
el.textContent = 'hello world';
return el;
}
// Generated code at the bottom of the file
__ngRendererCreateElement(renderer: any, parentNode: any, nameAndNamespace: any) {
const [namespace, name] = __ngRendererSplitNamespace(namespaceAndName);
const el = renderer.createElement(name, namespace);
if (parentNode) {
renderer.appendChild(parentNode, el);
}
return el;
}
__ngRendererSplitNamespace(nameAndNamespace: any) {
// returns the split name and namespace
}
</code-example>
When implementing these helper functions, the schematic ensures that they're only declared once per file and that their names are unique enough that there's a small chance of colliding with pre-existing functions in your code. The schematic also keeps their parameter types as `any` so that it doesn't have to insert extra logic that ensures that their values have the correct type.
### Im a library author. Should I run this migration?
**Library authors should definitely use this migration to move away from the `Renderer`. Otherwise, the libraries won't work with applications built with version 9.**
### Full list of method migrations
The following table shows all methods that the migration maps from `Renderer` to `Renderer2`.
|Renderer|Renderer2|
|---|---|
|`listen(renderElement, name, callback)`|`listen(renderElement, name, callback)`|
|`setElementProperty(renderElement, propertyName, propertyValue)`|`setProperty(renderElement, propertyName, propertyValue)`|
|`setText(renderNode, text)`|`setValue(renderNode, text)`|
|`listenGlobal(target, name, callback)`|`listen(target, name, callback)`|
|`selectRootElement(selectorOrNode, debugInfo?)`|`selectRootElement(selectorOrNode)`|
|`createElement(parentElement, name, debugInfo?)`|`appendChild(parentElement, createElement(name))`|
|`setElementStyle(el, style, value?)`|`value == null ? removeStyle(el, style) : setStyle(el, style, value)`
|`setElementAttribute(el, name, value?)`|`attributeValue == null ? removeAttribute(el, name) : setAttribute(el, name, value)`
|`createText(parentElement, value, debugInfo?)`|`appendChild(parentElement, createText(value))`|
|`createTemplateAnchor(parentElement)`|`appendChild(parentElement, createComment(''))`|
|`setElementClass(renderElement, className, isAdd)`|`isAdd ? addClass(renderElement, className) : removeClass(renderElement, className)`|
|`projectNodes(parentElement, nodes)`|`for (let i = 0; i < nodes.length; i<ins></ins>) { appendChild(parentElement, nodes<i>); }`|
|`attachViewAfter(node, viewRootNodes)`|`const parentElement = parentNode(node); const nextSibling = nextSibling(node); for (let i = 0; i < viewRootNodes.length; i<ins></ins>) { insertBefore(parentElement, viewRootNodes<i>, nextSibling);}`|
|`detachView(viewRootNodes)`|`for (let i = 0; i < viewRootNodes.length; i<ins></ins>) {const node = viewRootNodes<i>; const parentElement = parentNode(node); removeChild(parentElement, node);}`|
|`destroyView(hostElement, viewAllNodes)`|`for (let i = 0; i < viewAllNodes.length; i<ins></ins>) { destroyNode(viewAllNodes<i>); }`|
|`setBindingDebugInfo()`|This function is a noop in `Renderer2`.|
|`createViewRoot(hostElement)`|Should be replaced with a reference to `hostElement`|
|`invokeElementMethod(renderElement, methodName, args?)`|`(renderElement as any)<methodName>.apply(renderElement, args);`|
|`animate(element, startingStyles, keyframes, duration, delay, easing, previousPlayers?)`|Throws an error (same behavior as `Renderer.animate()`)|

View File

@ -322,6 +322,7 @@ The <code class="no-auto-link">item</code> property is `true`.
For block code snippets, we generally prefer to display code with For block code snippets, we generally prefer to display code with
the Angular documentation _code-example_ component represented by the `<code-example>` tag. the Angular documentation _code-example_ component represented by the `<code-example>` tag.
The `<code-example>` tag has a `header` attribute that you use to identify the file that the example comes from. The header should be used whenever possible to establish the context of the example.
See [Code snippets and code examples](guide/docs-style-guide#code-snippets-and-code-samples) for more details. See [Code snippets and code examples](guide/docs-style-guide#code-snippets-and-code-samples) for more details.
<h3 class="no-toc">Inline code-snippets</h3> <h3 class="no-toc">Inline code-snippets</h3>
@ -348,6 +349,8 @@ user input in a command shell or the _output_ of some process.
**Do not write inline code snippets** unless you have a good reason and the editor's permission to do so. **Do not write inline code snippets** unless you have a good reason and the editor's permission to do so.
In all other cases, code snippets should be generated automatically from tested code samples. In all other cases, code snippets should be generated automatically from tested code samples.
For hypothetical examples such as illustrations of configuration options in a JSON file, you should still use The `<code-example>` tag with the `header` attribute to identify the context.
{@a from-code-samples} {@a from-code-samples}
<h3 class="no-toc">Code snippets and code samples</h3> <h3 class="no-toc">Code snippets and code samples</h3>

View File

@ -170,7 +170,7 @@ You can download the full code for the example <live-example downloadOnly>here</
Generic DOM APIs, such as `document.createElement()` or `document.querySelector()`, return an element type that is appropriate for the specified arguments. For example, calling `document.createElement('a')` will return an `HTMLAnchorElement`, which TypeScript knows has an `href` property. Similarly, `document.createElement('div')` will return an `HTMLDivElement`, which TypeScript knows has no `href` property. Generic DOM APIs, such as `document.createElement()` or `document.querySelector()`, return an element type that is appropriate for the specified arguments. For example, calling `document.createElement('a')` will return an `HTMLAnchorElement`, which TypeScript knows has an `href` property. Similarly, `document.createElement('div')` will return an `HTMLDivElement`, which TypeScript knows has no `href` property.
When called with unknown elements, such as a custom element name (`popup-element` in our example), the methods will return a generic type, such as `HTMLELement`, since TypeScript can't infer the correct type of the returned element. When called with unknown elements, such as a custom element name (`popup-element` in our example), the methods will return a generic type, such as `HTMLElement`, since TypeScript can't infer the correct type of the returned element.
Custom elements created with Angular extend `NgElement` (which in turn extends `HTMLElement`). Additionally, these custom elements will have a property for each input of the corresponding component. For example, our `popup-element` will have a `message` property of type `string`. Custom elements created with Angular extend `NgElement` (which in turn extends `HTMLElement`). Additionally, these custom elements will have a property for each input of the corresponding component. For example, our `popup-element` will have a `message` property of type `string`.
@ -194,7 +194,7 @@ aDialog.body = 'News'; // <-- ERROR: TypeScript knows there is no `body` proper
This is a good way to quickly get TypeScript features, such as type checking and autocomplete support, for you custom element. But it can get cumbersome if you need it in several places, because you have to cast the return type on every occurrence. This is a good way to quickly get TypeScript features, such as type checking and autocomplete support, for you custom element. But it can get cumbersome if you need it in several places, because you have to cast the return type on every occurrence.
An alternative way, that only requires defining each custom element's type once, is augmenting the `HTMLELementTagNameMap`, which TypeScript uses to infer the type of a returned element based on its tag name (for DOM methods such as `document.createElement()`, `document.querySelector()`, etc.): An alternative way, that only requires defining each custom element's type once, is augmenting the `HTMLElementTagNameMap`, which TypeScript uses to infer the type of a returned element based on its tag name (for DOM methods such as `document.createElement()`, `document.querySelector()`, etc.):
```ts ```ts
declare global { declare global {

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@ into an application class as shown in the following `ConfigService` example.
header="app/config/config.service.ts (excerpt)"> header="app/config/config.service.ts (excerpt)">
</code-example> </code-example>
## Getting JSON data ## Requesting data from server
Applications often request JSON data from the server. Applications often request JSON data from the server.
For example, the app might need a configuration file on the server, `config.json`, For example, the app might need a configuration file on the server, `config.json`,
@ -73,45 +73,37 @@ the component **subscribes** to the method's return value.
The subscription callback copies the data fields into the component's `config` object, The subscription callback copies the data fields into the component's `config` object,
which is data-bound in the component template for display. which is data-bound in the component template for display.
### Why write a service <div class="callout is-helpful">
<header>Why write a service?</header>
This example is so simple that it is tempting to write the `Http.get()` inside the This example is so simple that it is tempting to write the `Http.get()` inside the
component itself and skip the service. component itself and skip the service.
In practice, however, data access rarely stays this simple.
However, data access rarely stays this simple. You typically need to post-process the data, add error handling, and maybe some retry logic to
You typically post-process the data, add error handling, and maybe some retry logic to
cope with intermittent connectivity. cope with intermittent connectivity.
The component quickly becomes cluttered with data access minutia. The component quickly becomes cluttered with data access minutia.
The component becomes harder to understand, harder to test, and the data access logic can't be re-used or standardized. The component becomes harder to understand, harder to test, and the data access logic can't be re-used or standardized.
That's why it is a best practice to separate presentation of data from data access by That's why it's a best practice to separate presentation of data from data access by
encapsulating data access in a separate service and delegating to that service in encapsulating data access in a separate service and delegating to that service in
the component, even in simple cases like this one. the component, even in simple cases like this one.
</div>
### Type-checking the response ### Requesting a typed response
The subscribe callback above requires bracket notation to extract the data values. You can structure your `HttpClient` request to declare the type of the response object, to make consuming the output easier and more obvious.
Specifying the response type acts as a type assertion during the compile time.
<code-example To specify the response object type, first define an interface with the required properties.
path="http/src/app/config/config.component.ts" (Use an interface rather than a class; a response cannot be automatically converted to an instance of a class.)
region="v1_callback">
</code-example>
You can't write `data.heroesUrl` because TypeScript correctly complains that the `data` object from the service does not have a `heroesUrl` property.
The `HttpClient.get()` method parsed the JSON server response into the anonymous `Object` type. It doesn't know what the shape of that object is.
You can tell `HttpClient` the type of the response to make consuming the output easier and more obvious.
First, define an interface with the correct shape:
<code-example <code-example
path="http/src/app/config/config.service.ts" path="http/src/app/config/config.service.ts"
region="config-interface"> region="config-interface">
</code-example> </code-example>
Then, specify that interface as the `HttpClient.get()` call's type parameter in the service: Next, specify that interface as the `HttpClient.get()` call's type parameter in the service.
<code-example <code-example
path="http/src/app/config/config.service.ts" path="http/src/app/config/config.service.ts"
@ -119,6 +111,12 @@ Then, specify that interface as the `HttpClient.get()` call's type parameter in
header="app/config/config.service.ts (getConfig v.2)"> header="app/config/config.service.ts (getConfig v.2)">
</code-example> </code-example>
<div class="alert is-helpful">
When you pass an interface as a type parameter to the `HttpClient.get()` method, use the RxJS `map` operator to transform the response data as needed by the UI. You can then pass the transformed data to the [async pipe](api/common/AsyncPipe).
</div>
The callback in the updated component method receives a typed data object, which is The callback in the updated component method receives a typed data object, which is
easier and safer to consume: easier and safer to consume:
@ -128,6 +126,24 @@ easier and safer to consume:
header="app/config/config.component.ts (showConfig v.2)"> header="app/config/config.component.ts (showConfig v.2)">
</code-example> </code-example>
<div class="alert is-important">
Specifying the response type is a declaration to TypeScript that it should expect your response to be of the given type.
This is a build-time check and doesn't guarantee that the server will actually respond with an object of this type. It is up to the server to ensure that the type specified by the server API is returned.
</div>
To access properties that are defined in an interface, you must explicitly convert the Object you get from the JSON to the required response type.
For example, the following `subscribe` callback receives `data` as an Object, and then type-casts it in order to access the properties.
<code-example>
.subscribe(data => this.config = {
heroesUrl: (data as any).heroesUrl,
textfile: (data as any).textfile,
});
</code-example>
### Reading the full response ### Reading the full response
The response body doesn't return all the data you may need. Sometimes servers return special headers or status codes to indicate certain conditions that are important to the application workflow. The response body doesn't return all the data you may need. Sometimes servers return special headers or status codes to indicate certain conditions that are important to the application workflow.
@ -139,7 +155,7 @@ Tell `HttpClient` that you want the full response with the `observe` option:
region="getConfigResponse"> region="getConfigResponse">
</code-example> </code-example>
Now `HttpClient.get()` returns an `Observable` of typed `HttpResponse` rather than just the JSON data. Now `HttpClient.get()` returns an `Observable` of type `HttpResponse` rather than just the JSON data.
The component's `showConfigResponse()` method displays the response headers as well as the configuration: The component's `showConfigResponse()` method displays the response headers as well as the configuration:
@ -152,6 +168,54 @@ The component's `showConfigResponse()` method displays the response headers as w
As you can see, the response object has a `body` property of the correct type. As you can see, the response object has a `body` property of the correct type.
### Making a JSONP request
Apps can use the the `HttpClient` to make [JSONP](https://en.wikipedia.org/wiki/JSONP) requests across domains when the server doesn't support [CORS protocol](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
Angular JSONP requests return an `Observable`.
Follow the pattern for subscribing to observables and use the RxJS `map` operator to transform the response before using the [async pipe](api/common/AsyncPipe) to manage the results.
In Angular, use JSONP by including `HttpClientJsonpModule` in the `NgModule` imports.
In the following example, the `searchHeroes()` method uses a JSONP request to query for heroes whose names contain the search term.
```ts
/* GET heroes whose name contains search term */
searchHeroes(term: string): Observable {
term = term.trim();
let heroesURL = `${this.heroesURL}?${term}`;
return this.http.jsonp(heroesUrl, 'callback').pipe(
catchError(this.handleError('searchHeroes', []) // then handle the error
);
};
```
This request passes the `heroesURL` as the first parameter and the callback function name as the second parameter.
The response is wrapped in the callback function, which takes the observables returned by the JSONP method and pipes them through to the error handler.
### Requesting non-JSON data
Not all APIs return JSON data.
In this next example, a `DownloaderService` method reads a text file from the server and logs the file contents, before returning those contents to the caller as an `Observable<string>`.
<code-example
path="http/src/app/downloader/downloader.service.ts"
region="getTextFile"
header="app/downloader/downloader.service.ts (getTextFile)" linenums="false">
</code-example>
`HttpClient.get()` returns a string rather than the default JSON because of the `responseType` option.
The RxJS `tap` operator (as in "wiretap") lets the code inspect both success and error values passing through the observable without disturbing them.
A `download()` method in the `DownloaderComponent` initiates the request by subscribing to the service method.
<code-example
path="http/src/app/downloader/downloader.component.ts"
region="download"
header="app/downloader/downloader.component.ts (download)" linenums="false">
</code-example>
## Error handling ## Error handling
What happens if the request fails on the server, or if a poor network connection prevents it from even reaching the server? `HttpClient` will return an _error_ object instead of a successful response. What happens if the request fails on the server, or if a poor network connection prevents it from even reaching the server? `HttpClient` will return an _error_ object instead of a successful response.
@ -204,7 +268,7 @@ and _pipe them through_ to the error handler.
header="app/config/config.service.ts (getConfig v.3 with error handler)"> header="app/config/config.service.ts (getConfig v.3 with error handler)">
</code-example> </code-example>
### `retry()` ### Retrying
Sometimes the error is transient and will go away automatically if you try again. Sometimes the error is transient and will go away automatically if you try again.
For example, network interruptions are common in mobile scenarios, and trying again For example, network interruptions are common in mobile scenarios, and trying again
@ -242,29 +306,34 @@ If you're following along with these code snippets, note that you must import th
header="app/config/config.service.ts (RxJS imports)"> header="app/config/config.service.ts (RxJS imports)">
</code-example> </code-example>
## Requesting non-JSON data ## HTTP headers
Not all APIs return JSON data. In this next example, Many servers require extra headers for save operations.
a `DownloaderService` method reads a text file from the server For example, they may require a "Content-Type" header to explicitly declare the MIME type of the request body; or the server may require an authorization token.
and logs the file contents, before returning those contents to the caller
as an `Observable<string>`. ### Adding headers
The `HeroesService` defines such headers in an `httpOptions` object that will be passed
to every `HttpClient` save method.
<code-example <code-example
path="http/src/app/downloader/downloader.service.ts" path="http/src/app/heroes/heroes.service.ts"
region="getTextFile" region="http-options"
header="app/downloader/downloader.service.ts (getTextFile)"> header="app/heroes/heroes.service.ts (httpOptions)">
</code-example> </code-example>
`HttpClient.get()` returns a string rather than the default JSON because of the `responseType` option. ### Updating headers
The RxJS `tap` operator (as in "wiretap") lets the code inspect good and error values passing through the observable without disturbing them. You can't directly modify the existing headers within the previous options
object because instances of the `HttpHeaders` class are immutable.
A `download()` method in the `DownloaderComponent` initiates the request by subscribing to the service method. Use the `set()` method instead, to return a clone of the current instance with the new changes applied.
Here's how you might update the authorization header (after the old token expired) before making the next request.
<code-example <code-example
path="http/src/app/downloader/downloader.component.ts" path="http/src/app/heroes/heroes.service.ts"
region="download" region="update-headers" linenums="false">
header="app/downloader/downloader.component.ts (download)">
</code-example> </code-example>
## Sending data to the server ## Sending data to the server
@ -276,22 +345,6 @@ that fetches heroes and enables users to add, delete, and update them.
The following sections excerpt methods of the sample's `HeroesService`. The following sections excerpt methods of the sample's `HeroesService`.
### Adding headers
Many servers require extra headers for save operations.
For example, they may require a "Content-Type" header to explicitly declare
the MIME type of the request body.
Or perhaps the server requires an authorization token.
The `HeroesService` defines such headers in an `httpOptions` object that will be passed
to every `HttpClient` save method.
<code-example
path="http/src/app/heroes/heroes.service.ts"
region="http-options"
header="app/heroes/heroes.service.ts (httpOptions)">
</code-example>
### Making a POST request ### Making a POST request
Apps often POST data to a server. They POST when submitting a form. Apps often POST data to a server. They POST when submitting a form.
@ -413,118 +466,8 @@ in order to initiate the request.
We have discussed the basic HTTP functionality in `@angular/common/http`, but sometimes you need to do more than make simple requests and get data back. We have discussed the basic HTTP functionality in `@angular/common/http`, but sometimes you need to do more than make simple requests and get data back.
### Configuring the request {@a intercepting-requests-and-responses }
### HTTP interceptors
Other aspects of an outgoing request can be configured via the options object
passed as the last argument to the `HttpClient` method.
You [saw earlier](#adding-headers) that the `HeroesService` sets the default headers by
passing an options object (`httpOptions`) to its save methods.
You can do more.
#### Update headers
You can't directly modify the existing headers within the previous options
object because instances of the `HttpHeaders` class are immutable.
Use the `set()` method instead.
It returns a clone of the current instance with the new changes applied.
Here's how you might update the authorization header (after the old token expired)
before making the next request.
<code-example
path="http/src/app/heroes/heroes.service.ts"
region="update-headers">
</code-example>
#### URL Parameters
Adding URL search parameters works a similar way.
Here is a `searchHeroes` method that queries for heroes whose names contain the search term.
<code-example
path="http/src/app/heroes/heroes.service.ts"
region="searchHeroes">
</code-example>
If there is a search term, the code constructs an options object with an HTML URL-encoded search parameter. If the term were "foo", the GET request URL would be `api/heroes/?name=foo`.
The `HttpParams` are immutable so you'll have to use the `set()` method to update the options.
### Debouncing requests
The sample includes an _npm package search_ feature.
When the user enters a name in a search-box, the `PackageSearchComponent` sends
a search request for a package with that name to the NPM web API.
Here's a pertinent excerpt from the template:
<code-example
path="http/src/app/package-search/package-search.component.html"
region="search"
header="app/package-search/package-search.component.html (search)">
</code-example>
The `(keyup)` event binding sends every keystroke to the component's `search()` method.
Sending a request for every keystroke could be expensive.
It's better to wait until the user stops typing and then send a request.
That's easy to implement with RxJS operators, as shown in this excerpt.
<code-example
path="http/src/app/package-search/package-search.component.ts"
region="debounce"
header="app/package-search/package-search.component.ts (excerpt)">
</code-example>
The `searchText$` is the sequence of search-box values coming from the user.
It's defined as an RxJS `Subject`, which means it is a multicasting `Observable`
that can also produce values for itself by calling `next(value)`,
as happens in the `search()` method.
Rather than forward every `searchText` value directly to the injected `PackageSearchService`,
the code in `ngOnInit()` _pipes_ search values through three operators:
1. `debounceTime(500)` - wait for the user to stop typing (1/2 second in this case).
1. `distinctUntilChanged()` - wait until the search text changes.
1. `switchMap()` - send the search request to the service.
The code sets `packages$` to this re-composed `Observable` of search results.
The template subscribes to `packages$` with the [AsyncPipe](api/common/AsyncPipe)
and displays search results as they arrive.
A search value reaches the service only if it's a new value and the user has stopped typing.
<div class="alert is-helpful">
The `withRefresh` option is explained [below](#cache-refresh).
</div>
#### _switchMap()_
The `switchMap()` operator has three important characteristics.
1. It takes a function argument that returns an `Observable`.
`PackageSearchService.search` returns an `Observable`, as other data service methods do.
2. If a previous search request is still _in-flight_ (as when the connection is poor),
it cancels that request and sends a new one.
3. It returns service responses in their original request order, even if the
server returns them out of order.
<div class="alert is-helpful">
If you think you'll reuse this debouncing logic,
consider moving it to a utility function or into the `PackageSearchService` itself.
</div>
### Intercepting requests and responses
_HTTP Interception_ is a major feature of `@angular/common/http`. _HTTP Interception_ is a major feature of `@angular/common/http`.
With interception, you declare _interceptors_ that inspect and transform HTTP requests from your application to the server. With interception, you declare _interceptors_ that inspect and transform HTTP requests from your application to the server.
@ -642,7 +585,7 @@ You may have expected the `intercept()` and `handle()` methods to return observa
Instead they return observables of `HttpEvent<any>`. Instead they return observables of `HttpEvent<any>`.
That's because interceptors work at a lower level than those `HttpClient` methods. A single HTTP request can generate multiple _events_, including upload and download progress events. The `HttpResponse` class itself is actually an event, whose type is `HttpEventType.HttpResponseEvent`. That's because interceptors work at a lower level than those `HttpClient` methods. A single HTTP request can generate multiple _events_, including upload and download progress events. The `HttpResponse` class itself is actually an event, whose type is `HttpEventType.Response`.
Many interceptors are only concerned with the outgoing request and simply return the event stream from `next.handle()` without modifying it. Many interceptors are only concerned with the outgoing request and simply return the event stream from `next.handle()` without modifying it.
@ -845,6 +788,117 @@ the cached response first (and immediately), followed later
by the response from the server. by the response from the server.
Subscribers see a sequence of _two_ responses. Subscribers see a sequence of _two_ responses.
### Configuring the request
Other aspects of an outgoing request can be configured via the options object
passed as the last argument to the `HttpClient` method.
In [Adding headers](#adding-headers), the `HeroesService` set the default headers by
passing an options object (`httpOptions`) to its save methods.
You can do more.
#### URL query strings
In this section, you will see how to use the `HttpParams` class to add URL query strings in your `HttpRequest`.
The following `searchHeroes` method queries for heroes whose names contain the search term.
Start by importing `HttpParams` class.
<code-example hideCopy language="typescript">
import {HttpParams} from "@angular/common/http";
</code-example>
<code-example
path="http/src/app/heroes/heroes.service.ts"
region="searchHeroes" linenums="false">
</code-example>
If there is a search term, the code constructs an options object with an HTML URL-encoded search parameter.
If the term were "foo", the GET request URL would be `api/heroes?name=foo`.
The `HttpParams` are immutable so you'll have to save the returned value of the `.set()` method in order to update the options.
#### Use `fromString` to create HttpParams
You can also create HTTP parameters directly from a query string by using the `fromString` variable:
<code-example hideCopy language="typescript">
const params = new HttpParams({fromString: 'name=foo'});
</code-example>
### Debouncing requests
The sample includes an _npm package search_ feature.
When the user enters a name in a search-box, the `PackageSearchComponent` sends
a search request for a package with that name to the NPM web API.
Here's a pertinent excerpt from the template:
<code-example
path="http/src/app/package-search/package-search.component.html"
region="search"
header="app/package-search/package-search.component.html (search)">
</code-example>
The `keyup` event binding sends every keystroke to the component's `search()` method.
Sending a request for every keystroke could be expensive.
It's better to wait until the user stops typing and then send a request.
That's easy to implement with RxJS operators, as shown in this excerpt.
<code-example
path="http/src/app/package-search/package-search.component.ts"
region="debounce"
header="app/package-search/package-search.component.ts (excerpt)">
</code-example>
The `searchText$` is the sequence of search-box values coming from the user.
It's defined as an RxJS `Subject`, which means it is a multicasting `Observable`
that can also emit values for itself by calling `next(value)`,
as happens in the `search()` method.
Rather than forward every `searchText` value directly to the injected `PackageSearchService`,
the code in `ngOnInit()` _pipes_ search values through three operators:
1. `debounceTime(500)` - wait for the user to stop typing (1/2 second in this case).
2. `distinctUntilChanged()` - wait until the search text changes.
3. `switchMap()` - send the search request to the service.
The code sets `packages$` to this re-composed `Observable` of search results.
The template subscribes to `packages$` with the [AsyncPipe](api/common/AsyncPipe)
and displays search results as they arrive.
A search value reaches the service only if it's a new value and the user has stopped typing.
<div class="alert is-helpful">
The `withRefresh` option is explained [below](#cache-refresh).
</div>
#### _switchMap()_
The `switchMap()` operator has three important characteristics.
1. It takes a function argument that returns an `Observable`.
`PackageSearchService.search` returns an `Observable`, as other data service methods do.
2. If a previous search request is still _in-flight_ (as when the network connection is poor),
it cancels that request and sends a new one.
3. It returns service responses in their original request order, even if the
server returns them out of order.
<div class="alert is-helpful">
If you think you'll reuse this debouncing logic,
consider moving it to a utility function or into the `PackageSearchService` itself.
</div>
### Listening to progress events ### Listening to progress events
Sometimes applications transfer large amounts of data and those transfers can take a long time. Sometimes applications transfer large amounts of data and those transfers can take a long time.
@ -895,22 +949,26 @@ by returning an observable of simulated events.
</div> </div>
## Security: XSRF Protection ## Security: XSRF protection
[Cross-Site Request Forgery (XSRF)](https://en.wikipedia.org/wiki/Cross-site_request_forgery) is an attack technique by which the attacker can trick an authenticated user into unknowingly executing actions on your website. `HttpClient` supports a [common mechanism](https://en.wikipedia.org/wiki/Cross-site_request_forgery#Cookie-to-Header_Token) used to prevent XSRF attacks. When performing HTTP requests, an interceptor reads a token from a cookie, by default `XSRF-TOKEN`, and sets it as an HTTP header, `X-XSRF-TOKEN`. Since only code that runs on your domain could read the cookie, the backend can be certain that the HTTP request came from your client application and not an attacker. [Cross-Site Request Forgery (XSRF)](https://en.wikipedia.org/wiki/Cross-site_request_forgery) is an attack technique by which the attacker can trick an authenticated user into unknowingly executing actions on your website.
`HttpClient` supports a [common mechanism](https://en.wikipedia.org/wiki/Cross-site_request_forgery#Cookie-to-Header_Token) used to prevent XSRF attacks.
When performing HTTP requests, an interceptor reads a token from a cookie, by default `XSRF-TOKEN`, and sets it as an HTTP header, `X-XSRF-TOKEN`.
Since only code that runs on your domain could read the cookie, the backend can be certain that the HTTP request came from your client application and not an attacker.
By default, an interceptor sends this header on all mutating requests (POST, etc.) By default, an interceptor sends this header on all mutating requests (such as POST)
to relative URLs but not on GET/HEAD requests or to relative URLs, but not on GET/HEAD requests or on requests with an absolute URL.
on requests with an absolute URL.
To take advantage of this, your server needs to set a token in a JavaScript readable session cookie called `XSRF-TOKEN` on either the page load or the first GET request. On subsequent requests the server can verify that the cookie matches the `X-XSRF-TOKEN` HTTP header, and therefore be sure that only code running on your domain could have sent the request. The token must be unique for each user and must be verifiable by the server; this prevents the client from making up its own tokens. Set the token to a digest of your site's authentication To take advantage of this, your server needs to set a token in a JavaScript readable session cookie called `XSRF-TOKEN` on either the page load or the first GET request.
cookie with a salt for added security. On subsequent requests the server can verify that the cookie matches the `X-XSRF-TOKEN` HTTP header, and therefore be sure that only code running on your domain could have sent the request.
The token must be unique for each user and must be verifiable by the server; this prevents the client from making up its own tokens.
Set the token to a digest of your site's authentication cookie with a salt for added security.
In order to prevent collisions in environments where multiple Angular apps share the same domain or subdomain, give each application a unique cookie name. In order to prevent collisions in environments where multiple Angular apps share the same domain or subdomain, give each application a unique cookie name.
<div class="alert is-important"> <div class="alert is-important">
*Note that `HttpClient` supports only the client half of the XSRF protection scheme.* *`HttpClient` supports only the client half of the XSRF protection scheme.*
Your backend service must be configured to set the cookie for your page, and to verify that Your backend service must be configured to set the cookie for your page, and to verify that
the header is present on all eligible requests. the header is present on all eligible requests.
If not, Angular's default protection will be ineffective. If not, Angular's default protection will be ineffective.
@ -929,19 +987,13 @@ use `HttpClientXsrfModule.withOptions()` to override the defaults.
## Testing HTTP requests ## Testing HTTP requests
Like any external dependency, the HTTP backend needs to be mocked As for any external dependency, you must mock the HTTP backend so your tests can simulate interaction with a remote server.
so your tests can simulate interaction with a remote server. The `@angular/common/http/testing` library makes it straightforward to set up such mocking .
The `@angular/common/http/testing` library makes
setting up such mocking straightforward.
### Mocking philosophy Angular's HTTP testing library is designed for a pattern of testing in which the app executes code and makes requests first.
The test then expects that certain requests have or have not been made,
Angular's HTTP testing library is designed for a pattern of testing wherein
the app executes code and makes requests first.
Then a test expects that certain requests have or have not been made,
performs assertions against those requests, performs assertions against those requests,
and finally provide responses by "flushing" each expected request. and finally provides responses by "flushing" each expected request.
At the end, tests may verify that the app has made no unexpected requests. At the end, tests may verify that the app has made no unexpected requests.

View File

@ -193,7 +193,7 @@ text messages with different descriptions (not different meanings), then they ar
The angular i18n extractor tool generates a file with a translation unit entry for each `i18n` The angular i18n extractor tool generates a file with a translation unit entry for each `i18n`
attribute in a template. By default, it assigns each translation unit a unique id such as this one: attribute in a template. By default, it assigns each translation unit a unique id such as this one:
<code-example path="i18n/doc-files/messages.fr.xlf.html" region="generated-id"></code-example> <code-example path="i18n/doc-files/messages.fr.xlf.html" header="messages.fr.xlf.html" region="generated-id"></code-example>
When you change the translatable text, the extractor tool generates a new id for that translation unit. When you change the translatable text, the extractor tool generates a new id for that translation unit.
You must then update the translation file with the new id. You must then update the translation file with the new id.
@ -206,7 +206,7 @@ The example below defines the custom id `introductionHeader`:
When you specify a custom id, the extractor tool and compiler generate a translation unit with that When you specify a custom id, the extractor tool and compiler generate a translation unit with that
custom id. custom id.
<code-example path="i18n/doc-files/messages.fr.xlf.html" region="custom-id"></code-example> <code-example path="i18n/doc-files/messages.fr.xlf.html" header="messages.fr.xlf.html" region="custom-id"></code-example>
The custom id is persistent. The extractor tool does not change it when the translatable text changes. The custom id is persistent. The extractor tool does not change it when the translatable text changes.
Therefore, you do not need to update the translation. This approach makes maintenance easier. Therefore, you do not need to update the translation. This approach makes maintenance easier.
@ -379,7 +379,7 @@ Open a terminal window at the root of the app project and run the CLI command `x
ng xi18n ng xi18n
</code-example> </code-example>
By default, the command creates a file named `messages.xlf` in your `src/` folder. By default, the command creates a file named `messages.xlf` in your project's root directory.
<div class="alert is-helpful"> <div class="alert is-helpful">
@ -388,7 +388,7 @@ If you don't use the CLI, you have two options:
For more information, see the [`ng xi18n` command documentation](cli/xi18n). For more information, see the [`ng xi18n` command documentation](cli/xi18n).
* You can use the CLI Webpack plugin `AngularCompilerPlugin` from the `@ngtools/webpack` package. * You can use the CLI Webpack plugin `AngularCompilerPlugin` from the `@ngtools/webpack` package.
Set the parameters `i18nOutFile` and `i18nOutFormat` to trigger the extraction. Set the parameters `i18nOutFile` and `i18nOutFormat` to trigger the extraction.
For more information, see the [Angular Ahead-of-Time Webpack Plugin documentation](https://github.com/angular/angular-cli/tree/master/packages/%40ngtools/webpack). For more information, see the [Angular Ahead-of-Time Webpack Plugin documentation](https://github.com/angular/angular-cli/tree/master/packages/ngtools/webpack).
</div> </div>
@ -645,9 +645,9 @@ ready-to-run application package, typically for production.
When you internationalize with the AOT compiler, you must pre-build a separate application When you internationalize with the AOT compiler, you must pre-build a separate application
package for each language and serve the appropriate package based on either server-side language package for each language and serve the appropriate package based on either server-side language
detection or url parameters. detection or URL parameters.
To instruct the AOT compiler to use your translation configuration, set the three "i18n" build configuration options in your `angular.json` file. To instruct the AOT compiler to use your translation configuration, set the three "i18n" build configuration options in your CLI configuration file, `angular.json`.
* `i18nFile`: the path to the translation file. * `i18nFile`: the path to the translation file.
* `i18nFormat`: the format of the translation file. * `i18nFormat`: the format of the translation file.
@ -707,22 +707,24 @@ the CLI configuration file, `angular.json`.
"i18nLocale": "fr", "i18nLocale": "fr",
"i18nMissingTranslation": "error", "i18nMissingTranslation": "error",
} }
// ... }
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "my-project:build"
}, },
"configurations": { ...
"production": { "serve": {
"browserTarget": "my-project:build:production" "builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "my-project:build"
}, },
"fr": { "configurations": {
"browserTarget": "my-project:build:fr" "production": {
"browserTarget": "my-project:build:production"
},
"fr": {
"browserTarget": "my-project:build:fr"
}
} }
} }
}, }
``` ```
The same configuration options can also be provided through the CLI with your existing `production` configuration. The same configuration options can also be provided through the CLI with your existing `production` configuration.
@ -761,6 +763,7 @@ Then provide the `LOCALE_ID` in the main module:
{@a missing-translation} {@a missing-translation}
### Report missing translations ### Report missing translations
By default, when a translation is missing, the build succeeds but generates a warning such as By default, when a translation is missing, the build succeeds but generates a warning such as
`Missing translation for message "foo"`. You can configure the level of warning that is generated by `Missing translation for message "foo"`. You can configure the level of warning that is generated by
the Angular compiler: the Angular compiler:
@ -770,7 +773,7 @@ compilation, the app will fail to load.
* Warning (default): show a 'Missing translation' warning in the console or shell. * Warning (default): show a 'Missing translation' warning in the console or shell.
* Ignore: do nothing. * Ignore: do nothing.
You specify the warning level in the `configurations` section your Angular CLI build configuration. The example below shows how to set the warning level to error: You specify the warning level in the `configurations` section of your Angular CLI configuration file, `angular.json`. The example below shows how to set the warning level to error.
``` ```
"configurations": { "configurations": {
@ -784,7 +787,7 @@ You specify the warning level in the `configurations` section your Angular CLI b
If you use the JIT compiler, specify the warning level in the compiler config at bootstrap by adding If you use the JIT compiler, specify the warning level in the compiler config at bootstrap by adding
the 'MissingTranslationStrategy' property. The example below shows how to set the warning level to the 'MissingTranslationStrategy' property. The example below shows how to set the warning level to
error: error.
<code-example path="i18n/doc-files/main.3.ts" header="src/main.ts"> <code-example path="i18n/doc-files/main.3.ts" header="src/main.ts">
</code-example> </code-example>
@ -794,7 +797,7 @@ error:
When you use the CLI `build` or `serve` command to build your application for different locales, change the output path using the `--outputPath` command option (along with the i18n-specific command options), so that the translation files are saved to different locations. When you use the CLI `build` or `serve` command to build your application for different locales, change the output path using the `--outputPath` command option (along with the i18n-specific command options), so that the translation files are saved to different locations.
When you are serving a locale-specific version from a subdirectory, you can also change the base URL used by your app by specifying the `--baseHref` option. When you are serving a locale-specific version from a subdirectory, you can also change the base URL used by your app by specifying the `--baseHref` option.
For example, if the French version of your application is served from https://myapp.com/fr/, configure the build for the French version as follows. For example, if the French version of your application is served from https://example.com/fr/, configure the build for the French version as follows.
``` ```
"configurations": { "configurations": {

Some files were not shown because too many files have changed in this diff Show More