19580 Commits

Author SHA1 Message Date
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
Andrew Scott 141fd3a0ea refactor(router): Update recognize to return null when there is no match (#40029) (#40315)
This commit updates the `recognize` algorithm to return `null` when a
segment does not match a given config rather than throwing an error.
This makes the code much easier to follow because the "no match" result
has to be explicitly handled rather than catching the error in very
specific places.

PR Close #40029

PR Close #40315
2021-01-05 13:51:42 -08:00
Andrew Scott ed42c93636 refactor(router): Use for...of rather than mapChildrenIntoArray helper (#40029) (#40315)
When stepping through the `recognize` algorithm, it is much easier to
follow when using a simple `for...of` rather than the helper
`mapChildrenIntoArray` with the passed closure. The only special thing that
`mapChildrenIntoArray` does is ensure the primary route appears first.
This change will have no affect on the result because `processChildren` later calls
`sortActivatedRouteSnapshots`, which does the same thing.

PR Close #40029

PR Close #40315
2021-01-05 13:51:42 -08:00
Joey Perrott 7e583abfe0 ci: remove autolabeling from pullapprove config (#40314)
Remove the autolabeling configuration from the pullapprove config as it conflicts
too often with other tooling.

PR Close #40314
2021-01-05 12:30:43 -08:00
Andrew Kushnir 45838c033e fix(core): take @Host into account while processing useFactory arguments (#40122) (#40313)
DI providers can be defined via `useFactory` function, which may have arguments configured via `deps` array.
The `deps` array may contain DI flags represented by DI decorators (such as `@Self`, `@SkipSelf`, etc). Prior to this
commit, having the `@Host` decorator in `deps` array resulted in runtime error in Ivy. The problem was that the `@Host`
decorator was not taken into account while `useFactory` argument list was constructed, the `@Host` decorator was
treated as a token that should be looked up.

This commit updates the logic which prepares `useFactory` arguments to recognize the `@Host` decorator.

PR Close #40122

PR Close #40313
2021-01-05 10:56:14 -08:00
George Kalpakas ec5b09b6f3 build(docs-infra): upgrade cli command docs sources to 5dd818279 (#40251)
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/715d873ae...5dd818279):

**Modified**
- help/test.json

PR Close #40251
2021-01-05 10:03:53 -08:00
Andrew Scott a1dcfc58ae fix(router): Router should focus element after scrolling (#40241)
According to the [spec](https://html.spec.whatwg.org/#scroll-to-fragid),
we should attempt to set the browser focus after scrolling to a
fragment. Note that this change does not exactly follow the robust steps
outlined in the spec by finding a fallback target if the original is not
focusable. Instead, we simply attempt to focus the element by calling
`focus` on it, which will do nothing if the element is not focusable.

fixes #30067

PR Close #40241
2021-01-05 09:48:49 -08:00
Andrew Scott 426653e35c test(router): update scroller tests to use real objects (#40241)
The current tests in the router scroller are
[change-detector tests](https://testing.googleblog.com/2015/01/testing-on-toilet-change-detector-tests.html)
and do not ensure the correct behavior of the scroller.
This commit updates the tests to assert actual scrolling behavior of the
browser.

PR Close #40241
2021-01-05 09:48:48 -08:00
Andrew Scott a96189345c refactor(router): Remove unused property in BrowserViewportScroller (#40241)
The `BrowserViewportScroller` injects but does not use the `ErrorHandler`.
This commit removes the `ErrorHandler` from the constructor.

PR Close #40241
2021-01-05 09:48:48 -08:00
Mario Sabo 938f417875 docs: fix interchanged values (#40302)
PR Close #40302
2021-01-05 09:46:57 -08:00
Howard Jing c83163ecfe docs(router): fix typo (#40244)
Replace the word Angualr with Angular.

PR Close #40244
2020-12-23 10:05:31 -08:00
Alan Agius 002806beb0 docs: update boolean and enumerated CLI section (#40224)
With this change we change the `Boolean and enumerated options` to use kebab-case flags
 as the camelCase variant are deprecated. We also remove the `enumerated option description`
 as this is no longer correct and needed following the CLI MAN page update in #40038

PR Close #40224
2020-12-23 09:51:29 -08:00
Keen Yee Liau 9a149d4c49 docs: use kebab-case for CLI commands (#40240)
Kebab-case is preferred over camelCase in Angular CLI.
camelCase support is deprecated and will be removed eventually.

PR Close #40240
2020-12-23 08:36:32 -08:00
Kristiyan Kostadinov ef13e834fe fix(core): error if detectChanges is called at the wrong time under specific circumstances (#40206)
Internally we store lifecycle hooks in the format `[index, hook, index, hook]` and when
iterating over them, we check one place ahead to figure out whether we've hit found
a hook or an index. The problem is that the loop is set up to iterate up to `hooks.length`
which means that we may go out of bounds on the last iteration, depending on where
we started. This appears to happen under a specific set of circumstances where a
directive calls `detectChanges` from an input setter while it has `ngOnChanges` and
`ngAfterViewInit` hooks.

These changes resolve the issue by only iterating up to `length - 1` which guarantees that
we can always look one place ahead.

This appears to have regressed some time in version 10.

Fixes #38611.

PR Close #40206
2020-12-22 14:52:12 -08:00
Pete Bacon Darwin b865b32ffa fix(compiler-cli): handle \r\n line-endings correctly in source-mapping (#40187)
Previously `\r\n` was being treated as a single character in source-map
line start positions, which caused segment positions to become offset.

Now the `\r` is ignored when splitting, leaving it at the end of the
previous line, which solves the offsetting problem, and does not affect
source-mappings.

Fixes #40169
Fixes #39654

PR Close #40187
2020-12-22 14:50:57 -08:00
Misko Hevery 632fe6011d fix(core): Call onDestroy in production mode as well (#40120)
PR #39876 introduced an error where the `onDestroy` of `ComponentRef`
would only get called if `ngDevMode` was set to true. This was because
in dev mode we would freeze `TCleanup` to verify that no more
static cleanup would get added to `TCleanup` array. This ensured
that `TCleanup` was always present in dev mode. In production the
`TCleanup` would get created only when needed. The resulting cleanup
code was incorrectly indented and would only run if `TCleanup` was
present causing this issue.

Fix #40105

PR Close #40120
2020-12-22 08:02:27 -08:00
George Kalpakas b3041aeee3 docs: fix SpyDirective in lifecycle-hooks docs example to use one ID per instance (#40208)
Previously, the `SpyDirective` in the `lifecycle-hooks` docs example
would use a different ID when logging `onInit` and when logging
`onDestroy` for the same instance, making it impossible to associate the
two calls. This was not helpful and came in constrast with how the
directive was described in the corresponding guide and shown in the
accompanying `spy-directive.gif` image.

This commit fixes the logic of the `SpyDirective` class to use the same
ID for all log operations of an instance.

Partially addresses #40193.

PR Close #40208
2020-12-21 14:22:16 -08:00
George Kalpakas 92a9c66341 docs: make the spy-directive docregion (in lifecycle-hooks example) easier to follow (#40208)
Previously, the docregion code referenced a `nextId` variable that was
not shown in the code, which was confusing for the reader.

This commit makes the declaration of the `nextId` variable part of the
docregion, so it is clear to the reader where it comes from and how it
is initialized.
This commit also removes the `logIt()` helper method, which didn't seem
to add value and calls `logger.log()` directly instead.

PR Close #40208
2020-12-21 14:22:16 -08:00
George Kalpakas 4a29b986a5 docs: fix the order of links in lifecycle-hooks docs example (#40208)
This commit aligns the order of the links to the various sections of the
`lifecycle-hooks` docs example with the order in which the sections
appear in the template (which also coincides with the order in which
they are presented/discussed in the corresponding guide).

PR Close #40208
2020-12-21 14:22:16 -08:00
Amadou Sall 7519cbf74b docs: HTTP in HttpClient should not be written in uppercase (#40195)
PR Close #40195
2020-12-21 14:21:33 -08:00
George Kalpakas 09ebd534bf build: use the latest versions of Chrome (v87) and Firefox (v84) in tests (#40150)
This commit updates the versions of Chrome and Firefox used in tests -
both with Bazel and without (via Puppeteer) - to the latest:
- Chrome v87
- Firefox v84

PR Close #40150
2020-12-21 14:15:32 -08:00
George Kalpakas 19eba4bca0 docs(dev-infra): add instructions for updating GeckoDriver in browsers/README.md (#40150)
This commit adds instructions in `dev-infra/browsers/README.md` on how
to update the version of GeckoDriver (the WebDriver implementation for
Firefox browsers).

NOTE:
The gecko driver download URLs perform redirection, so the `curl`
command needs to be run with the `-L/--location` option to follow
redirects. I updated all `curl` commands (even those that are not used
on gecko driver download URLs) for consistency.

PR Close #40150
2020-12-21 14:15:32 -08:00
George Kalpakas 8d22e73341 build: fix instructions and process for updating Chrome version (#40150)
Previously, the instructions and process for updating the version of
Chrome ued in tests assumed that there was always going to be a
ChromeDriver version that corresponded to a Chrome version. For example,
if we wanted to use Chrome v87.0.4272.x, we assumed that there was going
to be ChromeDriver v87.0.4272.x. It turns out that this is not always
the case.

This commit updates the instructions and process for updating the Chrome
version to ensure a valid version of ChromeDriver will be used as well.

PR Close #40150
2020-12-21 14:15:32 -08:00
George Kalpakas bfb9b40884 docs(dev-infra): fix command and typos in browsers/README.md (#40150)
This commit fixes the instructions in `dev-infra/browsers/README.md` to
use the `shasum` executable (instead of `sha256`, which does not exist
afaict).

The commit also fixes a couple of typos.

PR Close #40150
2020-12-21 14:15:31 -08:00
George Kalpakas 6c0270ad93 docs(dev-infra): refactor browsers/README.md to use one sentence per line (#40150)
This commit refactor the `dev-infra/browsers/README.md` file to have one
sentence per line. This makes it consistent with other Markdown files in
the repository and makes diffs for future changes more readable.

This commit also uses proper Markdown numbered lists and fixes
indentation.

PR Close #40150
2020-12-21 14:15:31 -08:00
George Kalpakas 3f4a1d6154 build(docs-infra): update Lighthouse to v7.0.0 (#40198)
This commit updates `lighthouse` to version 7.0.0.

It also adds a `width` attribute to the `code-icon.svg` image on the
homepage, which was pointed out as missing in the Lighthouse report.
(Explicit `width`/`height` attributes on images help reduce the
[layout shift][1] of the page.)

[1]: https://web.dev/cls/

PR Close #40198
2020-12-21 10:36:02 -08:00
Alexey Elin 353b9db535 docs: remove -webkit-transition-timing-function CSS property (#40153)
Angular has stopped to support browser that requires that CSS property.
All supported browsers support standard transition-timing-function CSS property

PR Close #40153
2020-12-21 10:23:58 -08:00
Aristeidis Bampakos 1d13073173 docs: fix styles in binding guides (#40182)
Fix styling issues with the visual representation of the content

PR Close #40182
2020-12-21 10:22:32 -08:00
Hadrien TOMA d3afcc5fb0 docs: update App Shell guide to reflect its actual behavior (#40210)
PR Close #40210
2020-12-21 10:21:00 -08:00
George Kalpakas 089cc174da ci: correctly rebase PRs for branches contain a slash (/) (#40184)
Previously, due to a bug in `rebase-pr.js`, PRs for branches containing
a slash (/) in their name would fail to be rebased
([example failure][1]).

This commit ensures that such branch names are handled correctly.

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

PR Close #40184
2020-12-21 10:12:03 -08:00