19632 Commits

Author SHA1 Message Date
Andrew Scott c6ca7b4a12 release: cut the v11.0.9 release (#40414) 11.0.9 2021-01-13 10:49:09 -08:00
Kristiyan Kostadinov 642c45bbf1 fix(compiler): incorrectly inferring content type of SVG-specific title tag (#40259)
The parser has a list of tag definitions that it uses when parsing the template. Each tag has a
`contentType` which tells the parser what kind of content the tag should contain. The problem is
that the browser has two separate `title` tags (`HTMLTitleElement` and `SVGTitleElement`) and each
of them has to have a different `contentType`, otherwise the parser will throw an error further down
the pipeline.

These changes update the tag definitions so that each tag name can have multiple content types
associated with it and the correct one can be returned based on the element's prefix.

Fixes #31503.

PR Close #40259
2021-01-11 15:35:24 -08:00
Kapunahele Wong 3a5142a9b6 docs: edit getting started start-forms.md (#39681)
PR Close #39681
2021-01-11 15:34:13 -08:00
Kapunahele Wong 14983cc114 docs: edit getting started start-deployment.md (#40135)
PR Close #40135
2021-01-11 15:33:19 -08:00
Kapunahele Wong f73705ee66 docs: edit gh-pages instructions in deployment guide (#40139)
PR Close #40139
2021-01-11 15:32:48 -08:00
Andrew Kushnir bdb03aeaeb docs: resolve non-exiting references in contributors.json (#40369)
The previous commit introduced extra checks to verify contributors.json data and this commit contains the necessary
fixes to the problems identified by the new set of checks.

PR Close #40369
2021-01-11 15:32:22 -08:00
Andrew Kushnir eddf6fd8ba build(docs-infra): add more checks to verify contributors.json data (#40369)
This commit adds extra steps to verify contributors.json data, such as checking `lead` and `mentor` field as well as
making sure the list is sorted alphabetically.

PR Close #40369
2021-01-11 15:32:22 -08:00
Andrew Kushnir 7e0b9fd004 refactor(docs-infra): rename contributors/check-pictures.js to validate-data.js (#40369)
This commit renames contributors/check-pictures.js to contributors/validate-data.js, since this file script will also
be used to include other checks.

PR Close #40369
2021-01-11 15:32:22 -08:00
Andrew Kushnir bebf30a26c docs: include a note that all entries in contributors.json should be present in alphabetical order (#40369)
PR Close #40369
2021-01-11 15:32:22 -08:00
Andrew Kushnir 424b595bd0 docs: sort entries in contributors.json alphabetically (#40369)
Currently entries in the `contributors.json` file are not sorted and new entries are typically added at the very
end of the file, which is often causing merge conflicts. This commit updates the `contributors.json` to have all
entries sorted in alphabetical order (based on GitHub handles), which should reduce the number of merge conflicts.

PR Close #40369
2021-01-11 15:32:21 -08:00
Martin Sikora 95a7dcaf21 refactor(router): refactor and simplify router RxJS chains (#40290)
Refactor and simplifiy RxJS usage in the router package
in order to reduce its size and increase performance.

PR Close #40290
2021-01-11 15:30:56 -08:00
markostanimirovic f8495ca1c4 docs(router): clarify the description of legacy relativeLinkResolution (#40384)
PR Close #40384
2021-01-11 14:09:41 -08:00
Trotyl adf42daed6 fix(router): better ngZone checking for warning (#25839)
Do not warn that navigation was triggered outside Angular zone if the
Router was created outside Angular zone in the first place.

Closes #25837

PR Close #25839
2021-01-11 10:49:45 -08:00
George Kalpakas 001ada1bd6 refactor(service-worker): remove work-around for Chrome code highlighting bug (#40234)
Chrome debugger code highlighting bug [659515][1] has been fixed, so we
can remove the work-around.
(See #38332 for more details on the work-around.)

[1]: https://bugs.chromium.org/p/chromium/issues/detail?id=659515

PR Close #40234
2021-01-11 10:42:51 -08:00
George Kalpakas a7befd53de fix(service-worker): allow checking for updates when constantly polling the server (#40234)
Previously, the SW would wait to become idle before executing scheduled
tasks (including checks for newer app versions). It was considered idle
when it hadn't received any request for at least 5 seconds. As a result,
if the app performed polling (i.e. sent requests to the server) in a
shorter than 5 seconds interval, the SW would never detect and update to
a newer app version.
Related issue: #40207

This commit fixes this by adding a max delay to `IdleScheduler` to
ensure that no scheduled task will remain pending for longer than the
specified max delay.

PR Close #40234
2021-01-11 10:42:51 -08:00
George Kalpakas eb6ed422a9 refactor(service-worker): simplify Driver#handleFetch() method (#40234)
This commit refactors the `Driver#handleFetch()` method to not have to
call `event.waitUntil(this.idle.trigger())` in multiple places.

PR Close #40234
2021-01-11 10:42:51 -08:00
George Kalpakas 3a99adab7a refactor(service-worker): avoid unnecessarily creating Promises in Driver#deleteAllCaches() (#40234)
This commit refactors `Driver#deleteAllCaches()` to use `Array#map()`
instead of `Array#reduce()` for running async operations in parallel.
This allows avoiding having to recursively wrap Promises with
`Promise.all()`.

PR Close #40234
2021-01-11 10:42:51 -08:00
George Kalpakas 631f75d99f refactor(service-worker): notify clients about updates in parallel (#40234)
Previously, clients were notified about updates sequentially. This
wasn't necessary.

This commit changes the `Driver#notifyClientsAboutUpdate()` method to
notify the clients in parallel (by switching from `Array#reduce()` to
`Array#map()` and `Promise.all()`).

This also aligns the `notifyClientsAboutUpdate()` method with the
`notifyClientsAboutUnrecoverableState()` method.

PR Close #40234
2021-01-11 10:42:51 -08:00
George Kalpakas c01b5eabf0 fix(service-worker): ensure SW stays alive while notifying clients about unrecoverable state (#40234)
Previously, the `Driver#notifyClientsAboutUnrecoverableState()` method
would not wait for the completion of the promises created to notify the
clients. Theoretically, this could result in the SW instance's getting
destroyed by the browser before all clients have been notified. This is
extremely unlikely to happen in practice, since the async operations are
very quick, but it _is_ theoretically possible.

This commit ensures that the SW instance will remain alive while
notifying the clients by making `notifyClientsAboutUnrecoverableState()`
await the notification promises.

PR Close #40234
2021-01-11 10:42:50 -08:00
JoostK ff36485eb7 fix(compiler-cli): prevent stack overflow in decorator transform for large number of files (#40374)
The decorator downleveling transform patches `ts.EmitResolver.isReferencedAliasDeclaration`
to prevent elision of value imports that occur only in a type-position, which would
inadvertently install the patch repeatedly for each source file in the program.
This could potentially result in a stack overflow when a very large number of files is
present in the program.

This commit fixes the issue by ensuring that the patch is only applied once.
This is also a slight performance improvement, as `isReferencedAliasDeclaration`
is no longer repeatedly calling into all prior installed patch functions.

Fixes #40276

PR Close #40374
2021-01-11 10:39:10 -08:00
Pete Bacon Darwin 584b78a37e fix(ngcc): compute the correct package paths for target entry-points (#40376)
Previously, if there were path-mapped entry-points, where one contaied the
string of another - for example `worker-client` and `worker` - then the
base paths were incorrectly computed resulting in the wrong package path
for the longer entry-point. This was because, when searching for a matching
base path, the strings were tested using `startsWith()`, whereas we should
only match if the path was contained in a directory from a file-system
point of view.

Now we not only check whether the target path "starts with" the base path
but then also whether the target path is actually contained in the base path
using `fs.relative()`.

Fixes #40352
Fixes #40357

PR Close #40376
2021-01-11 10:38:17 -08:00
Pete Bacon Darwin 6c8cb5b71d refactor(compiler-cli): split up NodeJSFileSystem class (#40363)
This class is refactored to extend the new `NodeJSReadonlyFileSystem`
which itself extends `NodeJSPathManipulation`. These new classes allow
consumers to create file-systems that provide a subset of the full file-system.

PR Close #40363
2021-01-11 10:30:26 -08:00
Pete Bacon Darwin 4f533765d9 refactor(localize): update to use new file-system interfaces (#40363)
Now that `ReadonlyFileSystem` and `PathManipulation` interfaces are
available, this commit updates the localize package to use these more
focussed interfaces.

PR Close #40363
2021-01-11 10:30:26 -08:00
Pete Bacon Darwin 18d3653236 refactor(compiler-cli): update to use new file-system interfaces (#40363)
Now that `ReadonlyFileSystem` and `PathManipulation` interfaces are
available, this commit updates the compiler-cli to use these more
focussed interfaces.

PR Close #40363
2021-01-11 10:30:26 -08:00
Pete Bacon Darwin ef01e5a859 refactor(compiler-cli): split the FileSystem interface up (#40363)
This interface now extends `ReadonlyFileSystem` which in turn
extends `PathManipulation`. This means consumers of these
interfaces can be more specific about what is needed, and so
providers do not need to implement unnecessary methods.

PR Close #40363
2021-01-11 10:30:26 -08:00
Pedro 6438a29eb4 docs(router): fix minor grammatical issue (#40380)
PR Close #40380
2021-01-11 09:57:35 -08:00
Joey Perrott e88828f48c fix(dev-infra): detect multiple target labels as invalid (#40156)
When multiple target labels are applied to a PR, it should be considered
invalid as our tooling does not support a single PR targetting multiple
trains/versions.

PR Close #40156
2021-01-11 09:56:22 -08:00
Pete Bacon Darwin e1e6128f70 docs: remove invalid style binding example (#40334)
Providing an array to `[style]` bindings is not supported and the behavior
of the rendered style attribute is not as one might expect.

This commit removes that array example from the table to discourage its
use.

Fixes #40147

PR Close #40334
2021-01-11 09:55:49 -08:00
Lincoln Baxter, III 701115a55a docs: Fix compiler option name reference (#40362)
The `skipTemplateCodegen` option was incorrectly referenced using camelcase `skipTemplateCodeGen`.

PR Close #40362
2021-01-11 09:54:40 -08:00
Andrew Kushnir 39787cca78 ci: add new group to approve contributor list changes (#40368)
This commit adds a new `docs-contributors` group (with Emma and Minko as members) which will be used as reviewers
for PRs that update the list of contributors.

PR Close #40368
2021-01-11 09:48:49 -08:00
Anuj Bhatnagar 7a97f52f3f docs: fix incorrect link "Debugging tests" (#40379)
update the "Debugging tests" link from "guide/testing-attribute-directives" to "guide/test-debugging"
PR Close #40379
2021-01-11 09:45:00 -08:00
Andrew Scott ec3987ede6 release: cut the v11.0.8 release (#40391) 11.0.8 2021-01-11 09:25:48 -08:00
Andrew Scott c44dd84a71 fix(router): Remove usage of Object.values to avoid the need for a polyfill (#40370)
`Object.values` is not supported in IE11 without a polyfill. The quickest,
most straightfoward fix for this is to simply use `Object.keys` instead.
We may want to consider including the polyfill in the CLI in the future
or just wait until IE11 support is dropped before using
`Object.values`.

PR Close #40370
2021-01-09 16:36:23 -08:00
Andrew Scott 5319eea87c docs(router): Clearly document how to retrieve all params in the router tree (#40306)
This commit documents how to add a helper function which combines all the params
in the router state tree into a single object. It provides a starting point for
developers to reference if they require a more fine-tuned approach.

Fixes #11023

PR Close #40306
2021-01-08 11:47:48 -08:00
Christian Liebel 6ccdb2ddba docs: add @christianliebel to list of GDEs (#39788)
PR Close #39788
2021-01-08 09:50:53 -08:00
George Kalpakas be1ff38507 build(docs-infra): upgrade cli command docs sources to 2677dd0a6 (#40356)
Updating [angular#11.0.x](https://github.com/angular/angular/tree/11.0.x) from
[cli-builds#11.0.x](https://github.com/angular/cli-builds/tree/11.0.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/5dd818279...2677dd0a6):

**Modified**
- help/test.json

PR Close #40356
2021-01-08 09:48:54 -08:00
Che Liu 42f066f2f8 fix(zone.js): fix typo in zone_externs (#40348)
This change fixes a typo in zone.js externs definition and avoids Closure
compiler renaming Task.cancelScheduleRequest() unexpectedly.

PR Close #40348
2021-01-08 09:47:47 -08:00
Kristiyan Kostadinov f691e85e5e fix(core): memory leak if view container host view is destroyed while view ref is not (#40219)
When we attach a `ViewRef` to a `ViewContainerRef`, we save a reference to the container
onto the `ViewRef` so that we can remove it when the ref is destroyed. The problem is
that if the container's `hostView` is destroyed first, the `ViewRef` has no way of knowing
that it should stop referencing the container.

These changes remove the leak by not saving a reference at all. Instead, when a `ViewRef`
is destroyed, we clean it up through the `LContainer` directly. We don't need to worry
about the case where the container is destroyed before the view, because containers
automatically clean up all of their views upon destruction.

Fixes #38648.

PR Close #40219
2021-01-08 09:45:13 -08:00
Andrew Kushnir b3f322f245 fix(forms): handle standalone <form> tag correctly in NgControlStatusGroup directive (#40344)
The `NgControlStatusGroup` directive is shared between template-driven and reactive form modules. In cases when
only reactive forms module is present, the `NgControlStatusGroup` directive is still activated on all `<form>`
elements, but if there is no other reactive directive applied (such as `formGroup`), corresponding `ControlContainer`
token is missing, thus causing exceptions (since `NgControlStatusGroup` directive relies on it to determine the
status). This commit updates the logic to handle the case when no `ControlContainer` is present (effectively making
directive logic a noop in this case).

Alternative approach (more risky) worth considering in the future is to split the `NgControlStatusGroup` into
2 directives with different set of selectors and include them into template-driven and reactive modules separately.
The downside is that these directives might be activated simultaneously on the same element (e.g. `<form>`),
effectively doing the work twice.

Resolves #38391.

PR Close #40344
2021-01-08 09:44:43 -08:00
Joey Perrott fcbf71472c fix(dev-infra): delay checking if a closed pr has been merged by 30 seconds (#40181)
Delaying the check if a closed PR was closed by a merge or just closed by 30 seconds
allows for Github to have time to update the PR to be associated to the commit which
closed the PR.  Without this delay, a race condition can exist in which we check for
how a PR was closed before this association is made.

PR Close #40181
2021-01-08 09:38:21 -08:00
George Kalpakas 50dc63f409 build: remove redundant node_repositories dictionary from node_repositories rules (#40151)
According to a [discussion with Alex Eagle][1], the `node_repositories`
dictionary is no longer necessary, since the `node_repositories` rule
will ensure all Node.js versions are available.

From the [`node_repositories` docs][2]:

> By default, if this attribute has no items, we’ll use a list of all
> public NodeJS releases.

[1]: https://angular-team.slack.com/archives/C042EU9T5/p1606841390116500?thread_ts=1606838958
[2]: https://bazelbuild.github.io/rules_nodejs/Built-ins.html#node_repositories-node_repositories

PR Close #40151
2021-01-08 09:37:52 -08:00
Alexey Elin 40a03f0f28 docs: lifecycle-hooks example - extract things (components, directives) into their own files (#40212)
This change is in line with Angular Style Guide rule 01-01
https://angular.io/guide/styleguide#style-01-01.

PR Close #40212
2021-01-07 13:10:42 -08:00
Alexey Elin 69b672161b docs: remove duplicated 'the' (#40333)
PR Close #40333
2021-01-07 13:09:35 -08:00
Craig Spence 59573ff3bc docs: add Craig Spence to contributor list (#40335)
PR Close #40335
2021-01-07 13:09:05 -08:00
Joey Perrott 806bbbeb88 build: use reviewed_for: ignored for required-minimum-review group (#40338)
Since all PRs will need to have this review, all reviews should apply
to this group even if someone is reviewing for another group.

PR Close #40338
2021-01-07 13:07:16 -08:00
Andrew Scott 64d94e8a68 release: cut the v11.0.7 release (#40343) 11.0.7 2021-01-07 12:29:20 -08:00
Andrew Scott 6429be1c15 fix(router): Remove usage of Object.entries to avoid the need for a polyfill (#40340)
`Object.entries` is not supported in IE11 without a polyfill. The quickest,
most straightfoward fix for this is to simply use `Object.keys` instead.
We may want to consider including the polyfill in the CLI in the future
or just wait until IE11 support is dropped before using
`Object.entries`.

PR Close #40340
2021-01-07 11:45:58 -08:00
George Kalpakas 48526ccdf1 docs: fix instructions for setting up ProductDetailsComponent in start-routing.md (#40197)
PR #34934 switched the `getting-started` docs example from using the
index of a product in the `products` array to using the product's ID
property for indentifiying each product in the `ProductDetailsComponent`
component. However, some necessary changes in the example code and the
`start-routing.md` guide were missed in #34934, resulting in broken
instructions for the readers (see #40189).

This commit is essentially a follow-up to #34934, making the remaining
changes in the example code and the guide instructions.

Fixes #40189

PR Close #40197
2021-01-06 13:54:56 -08:00
George Kalpakas 84580967ca docs: refactor code in get-product docregion of getting-started docs example (#40197)
This commit slightly refactors the code in the `get-product` docregion
of the `getting-started` docs example to make it easier to follow.

PR Close #40197
2021-01-06 13:54:55 -08:00
George Kalpakas 917da32397 docs: clean up docregions in the getting-started docs example (#40197)
This commit does some minor clean-up in docregions of the
`getting-started` docs example. More specifically, it:
- Removes redundant docregion markers.
- Fixes whitespace inconsistencies.
- Adds `/* ... */` to indicate that there is more code before the end of
  a docregion (in order to avoid confusion).

PR Close #40197
2021-01-06 13:54:55 -08:00