19659 Commits

Author SHA1 Message Date
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
George Kalpakas 7e7e89616e docs: more closely align the getting-started-v0 and getting-started docs examples (#40197)
This commit aligns the code and style in the `getting-started-v0` docs
example with that of the `getting-started` example more closely (except
for the the parts that are intentionally different between the two).

PR Close #40197
2021-01-06 13:54:55 -08:00
Andrew Scott 7060ae2d59 fix(router): correctly deactivate children with componentless parent (#40196)
During route activation, a componentless route will not have a context created
for it, but the logic continues to recurse so that children are still
activated. This can be seen here:
https://github.com/angular/angular/blob/362f45c4bf1bb49a90b014d2053f4c4474d132c0/packages/router/src/operators/activate_routes.ts#L151-L158

The current deactivation logic does not currently account for componentless routes.

This commit adjusts the deactivation logic so that if a context cannot
be retrieved for a given route (because it is componentless), we
continue to recurse and deactivate the children using the same
`parentContexts` in the same way that activation does.

Fixes #20694

PR Close #40196
2021-01-06 13:49:30 -08:00
Joey Perrott 5b9c981b6d release: cut the v11.0.6 release (#40328) 11.0.6 2021-01-06 16:13:21 -05:00
Joey Perrott b6a9717597 test(core): fix invalid symbol used in html sanitizier spec (#40325)
Change `sanitizeHtml` to `_sanitizeHtml` as `sanitizeHtml` is not a symbol on the
patch branch version of this file.

PR Close #40325
2021-01-06 11:56:28 -08:00
Kristiyan Kostadinov 1bfbfaab5f fix(compiler): incorrectly encapsulating selectors with escape sequences (#40264)
CSS supports escaping in selectors, e.g. writing `.foo:bar` will match an element with the
`foo` class and `bar` pseudo-class, but `.foo\:bar` will match the `foo:bar` class. Our
shimmed shadow DOM encapsulation always assumes that `:` means a pseudo selector
which breaks a selector like `.foo\:bar`.

These changes add some extra logic so that escaped characters in selectors are preserved.

Fixes #31844.

PR Close #40264
2021-01-06 10:33:50 -08:00
Pete Bacon Darwin add7cbb466 fix(core): ensure sanitizer works if DOMParser return null body (#40107)
In some browsers, notably a mobile version of webkit on iPad, the
result of calling `DOMParser.parseFromString()` returns a document
whose `body` property is null until the next tick of the browser.
Since this is of no use to us for sanitization, we now fall back to the
"inert document" strategy for this case.

Fixes #39834

PR Close #40107
2021-01-06 10:32:25 -08:00
Andrew Kushnir 738b8f12da fix(dev-infra): fix yarn symbol-extractor command (#40163)
The `yarn symbol-extractor:check` and `yarn symbol-extractor:update` commands don't seem to work currently -
the script is unable to calculate the list of relevant targets. Running the `bazel query ...` command used in the
script fails due to the missing quotes around the query argument. This commit fixes the problem by updating the
script to wrap query argument into single quotes.

PR Close #40163
2021-01-06 10:31:24 -08:00
SylvainJanet bad171754e docs(forms): typo word "property" was missing (#40323)
Word "property" was missing in @returns description of minLength
PR Close #40323
2021-01-06 08:44:04 -08:00
Harshit Chhipa 67ab59b502 docs: correct some spellings (#40322)
PR Close #40322
2021-01-06 07:31:33 -08:00
Christoph Preuß 8dfd8f478d docs: fix fullTemplateTypeCheck compiler option description (#40253)
PR Close #40253
2021-01-06 07:29:52 -08:00
Pete Bacon Darwin 0b00d6599e fix(compiler-cli): ngcc - remove outdated link (#40285)
The link to the "speeding-up-ngcc-compilation" URL does not exist,
it was removed shortly after it was added, but the link in the ngcc
error message was not updated.

Fixes #39837

PR Close #40285
2021-01-06 07:10:39 -08:00
Alexey Elin f6c9133897 docs: specify fallback generic font family (#40254)
https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
"You should always include at least one generic family name in a font-family list,
 since there's no guarantee that any given font is available. This lets the browser
 select an acceptable fallback font when necessary."

PR Close #40254
2021-01-06 07:09:27 -08:00
Aristeidis Bampakos 617cc03821 docs: add Aristeidis Bampakos to contributor list (#40165)
PR Close #40165
2021-01-06 07:04:44 -08:00
Jessica Janiuk bcc257cd1c ci: add jessicajaniuk to pullapprove groups (#40176)
This adds jessicajaniuk to size-tracking, public-api, and circular-dependencies.

PR Close #40176
2021-01-06 07:04:08 -08:00
mgechev 4edf00b548 docs: update homepage headline (#40056)
Reviving @stephenfluin's PR https://github.com/angular/angular/pull/37517

PR Close #40056
2021-01-06 07:02:30 -08:00
Kristiyan Kostadinov 7977509b18 fix(compiler): don't report parse error for interpolation inside string in property binding (#40267)
Currently we check whether a property binding contains an interpolation using a regex so
that we can throw an error. The problem is that the regex doesn't account for quotes
which means that something like `[prop]="'{{ foo }}'"` will be considered an error, even
though it's not actually an interpolation.

These changes build on top of the logic from #39826 to account for interpolation
characters inside quotes.

Fixes #39601.

PR Close #40267
2021-01-05 13:57:23 -08:00
akashnishant1031 6b56bdfad5 docs(core): fix typo in component overview (#40269)
There is a sentence that mentions `stylesUrls` but should be changed to `styleUrls`.

PR Close #40269
2021-01-05 13:55:43 -08:00
Loic Yondjeu ff7cbdc7b3 docs(core): Fix spelling (#40296)
PR Close #40296
2021-01-05 13:55:15 -08:00
Andrew Scott 72ef4b3365 docs(router): Clarify 'parent' for params inheritance (#40304)
When talking about parameter inheritance, one might think that matrix
parameters can be inherited from the "parent" segment, or the segment
which appears immediately to the left. In reality, when we talk about
a "parent" in the `Router`, we mean the parent `Route` config. This
config may contain more than one segment and matrix parameters must
appear at the end or they do not "belong" to any config.

PR Close #40304
2021-01-05 13:54:41 -08:00
Andrew Scott f542e4ee99 fix(router): apply redirects should match named outlets with empty path parents (#40029) (#40315)
There are two parts to this commit:
1. Revert the changes from #38379. This change had an incomplete view of
how things worked and also diverged the implementations of
`applyRedirects` and `recognize` even more.
2. Apply the fixes from the `recognize` algorithm to ensure that named
outlets with empty path parents can be matched. This change also passes
all the tests that were added in #38379 with the added benefit of being
a more complete fix that stays in-line with the `recognize` algorithm.
This was made possible by using the same approach for `split` by
always creating segments for empty path matches (previously, this was
only done in `applyRedirects` if there was a `redirectTo` value). At the
end of the expansions, we need to squash all empty segments so that
serializing the final `UrlTree` returns the same result as before.

Fixes #39952
Fixes #10726
Closes #30410

PR Close #40029

PR Close #40315
2021-01-05 13:51:42 -08:00
Andrew Scott 68a951171b refactor(router): Extract common functions for config matching (#40029) (#40315)
The `applyRedirects` and `recognize` algorithms have the same overall goal:
match a `UrlTree` with the application's `Routes` config. There are a
few key functions in these algorithms which can be shared rather than
duplicated between the two. This also makes it easier to see how the two
are similar and where they diverge.

PR Close #40029

PR Close #40315
2021-01-05 13:51:42 -08:00
Andrew Scott c722c4307d fix(router): Ensure named outlets with empty path parents are recognized (#40029) (#40315)
This commit updates the `recognize` algorithm to work with named outlets
which have empty path parents. For example, given the following config

```
  const routes = [
    {
      path: '',
      children: [
        {path: 'a', outlet: 'aux', component: AuxComponent}
    ]}
  ];
```

The url `/(aux:a)` should match this config. In order to do so, we need
to allow the children of `UrlSegmentGroup`s to match a `Route` config
for a different outlet (in this example, the `primary`) when it's an
empty path. This should also *only* happen if we were unable to find a
match for the outlet in the level above. That is, the matching strategy
is to find the first `Route` in the list which _matches the given
outlet_. If we are unable to do that, then we allow empty paths from
other outlets to match and try to find some child there whose outlet
matches our segment.

PR Close #40029

PR Close #40315
2021-01-05 13:51:42 -08:00
Andrew Scott 718aa3623e refactor(router): make recognize synchronous (#40029) (#40315)
To make the tests suite easier to follow, `Recognize#apply` can be made
into a synchronous function rather than one that return an `Observable`.

Also, as a chore, remove as many `any` types as possible.

PR Close #40029

PR Close #40315
2021-01-05 13:51:42 -08:00