21621 Commits

Author SHA1 Message Date
George Kalpakas
6c3ad1f1a4 fix(docs-infra): correctly detect chunk load errors (#43088)
It seems that at some point (potentially with the switch to Webpack 5)
Webpack started using the full chunk name (instead of just a numeric
identifier) in `ChunkLoadError` messages. So the error messages changed
from:
```
ChunkLoadError: Loading chunk 2 failed.
```

...to:
```
ChunkLoadError: Loading chunk src_app_something_some_module_ts failed.
```

This commit updates the regex that is used to detect such errors (in
order to print ServiceWorker-related debug info) to correctly recognize
the new error message format.

PR Close #43088
2021-08-09 12:25:41 -07:00
Andrew Scott
bbad42310b fix(router): ensure check for match options is compatible with property renaming (#43086)
After renaming, 'paths' is not in routerLinkOptions since it's been renamed.

PR Close #43086
2021-08-09 10:26:07 -07:00
Jeroen van Warmerdam
04879a1007 docs: fix cli link (#43085)
PR Close #43085
2021-08-09 09:41:40 -07:00
George Kalpakas
93590895b5 build(docs-infra): update docs examples to Angular v12.1.3 (#42949)
This commit updates the docs examples to Angular v12.1.3. In addition to
updating the dependencies versions, it also updates the projects'
structure and configs to more closely match what a new v12 CLI app would
look like. See, also, the [diff][1] between a basic v11.2.11 CLI app and
a v12.1.3 one.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/11.2.11..12.1.3

PR Close #42949
2021-08-09 09:41:00 -07:00
George Kalpakas
14ebd82333 docs: fix typo in Compiler Options guide (#42949)
PR Close #42949
2021-08-09 09:41:00 -07:00
Jon Rimmer
784671597e fix(router): Allow question marks in query param values (#31187)
According to the URI spec, question mark characters are valid in query data,
so these should accepted by the param parsing.

See https://tools.ietf.org/html/rfc3986#section-3.4

Fixes #31116

BREAKING CHANGE: The default url serializer would previously drop
everything after and including a question mark in query parameters. That
is, for a navigation to `/path?q=hello?&other=123`, the query
params would be parsed to just `{q: 'hello'}`. This is
incorrect because the URI spec allows for question mark characers in
query data. This change will now correctly parse the params for the
above example to be `{v: 'hello?', other: '123'}`.

PR Close #31187
2021-08-06 10:49:37 -07:00
Joey Perrott
d8690d867c fix(dev-infra): search since HEAD on the local branch for version tags when creating stamps (#43065)
Using `HEAD~100` was errantly left in the snapshot stamping logic.

PR Close #43065
2021-08-06 08:54:21 -07:00
Joey Perrott
4db80d69d7 ci: stop publishing snapshots to angular/dev-infra-private-builds (#43059)
We no longer publish to angular/dev-infra-private-builds as the dev-infra
content has been moved to angular/dev-infra.

PR Close #43059
2021-08-05 16:05:03 -07:00
Fabien BERNARD
644f1b3924 docs: fix interval type in the example (#43042)
`window.setInterval` returns a `number`, let's fix this example.

PR Close #43042
2021-08-05 15:33:13 -07:00
Dylan Hunn
e49fc96ed3 feat(forms): Make Form Statuses use stricter types. (#42952)
Specifically: narrow the type used for form statuses from string to a union of possible statuses. Change the API methods from any to use the new type.

This is a breaking change. However, as discussed in the PR, breakage seems minimal, and google3 has been prepped to land this.

Background: we uncovered these any typings in the course of design work for typed forms. They could be fixed in a non-breaking manner by piggybacking them on top of the new typed forms generics, but it would be much cleaner to fix them separately if possible.

BREAKING CHANGE:

A new type called `FormControlStatus` has been introduced, which is a union of all possible status strings for form controls. `AbstractControl.status` has been narrowed from `string` to `FormControlStatus`, and `statusChanges` has been narrowed from `Observable<any>` to `Observable<FormControlStatus>`. Most applications should consume the new types seamlessly. Any breakage caused by this change is likely due to one of the following two problems: (1) the app is comparing `AbstractControl.status` against a string which is not a valid status; or, (2) the app is using `statusChanges` events as if they were something other than strings.

PR Close #42952
2021-08-04 16:28:20 -07:00
George Kalpakas
3107988e6e build(docs-infra): upgrade cli command docs sources to cf835b898 (#43039)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](129d45cfa...cf835b898):

**Modified**
- help/build.json
- help/e2e.json
- help/serve.json

##
Relevant changes in
[commit range](edfd9b4ae...cf835b898) since PR #43024:

**Modified**
- help/build.json
- help/serve.json

##
Closes #43024

PR Close #43039
2021-08-04 12:14:25 -07:00
Andrew Scott
a99892e62f
release: cut the v13.0.0-next.0 release (#43049) 2021-08-04 11:43:40 -07:00
Andrew Scott
4f93984e41
docs: release notes for the v12.2.0 release (#43048) 2021-08-04 10:36:28 -07:00
Andrew Scott
82c8393d37
docs: release notes for the v12.1.5 release (#43046) 2021-08-04 10:07:10 -07:00
Kristiyan Kostadinov
8628826535 fix(core): incorrect error reported when trying to re-create view which had an error during creation (#43005)
Currently if a view throws an error during creation mode, we mark it as `incompleteFirstPass` so that we can try to recover later. The recovery is only possible inside component views.

The problem is that when this was introduced, I forgot to flip the `firstCreatePass` when an error is thrown which meant that calling `renderView` on the same component again is allowed. It will eventually hit an assertion which can be confusing for the end user. This issue only manifests itself when rendering views "manually" through `ViewContainerRef` (e.g. using `NgIf`).

These changes flip the `firstCreatePass` back to false on errors so that trying to re-render the same view will throw an error which is consistent to the one that broke the view during creation.

Fixes #41383.

PR Close #43005
2021-08-04 08:58:28 -07:00
atscott
f99ec27596 Revert "refactor(ngcc): remove unused import (#42062)" (#43033)
This reverts commit 42265cca1c0088b9623a94cfb4a39e9690e75234.

PR Close #43033
2021-08-03 15:38:55 -07:00
atscott
064e705eef Revert "test(compiler-cli): clarify source-map expectations in compliance tests (#42062)" (#43033)
This reverts commit 29f9888a985b14cf1025105baa1fd262c751cc10.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
9436f4bf77 Revert "refactor(compiler): remove cyclic dependencies (#42062)" (#43033)
This reverts commit 75855196e320022e79202ccaeb9be000da55b9eb.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
dda75ca1d0 Revert "refactor(compiler): support interpolation tokens when lexing markup (#42062)" (#43033)
This reverts commit c8a46bfdcd5dac0044c4322a5b3967163056b339.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
443ece4587 Revert "refactor(compiler): share isQuote() via chars.ts (#42062)" (#43033)
This reverts commit 3d3b69ff81c593602b75ee8eec60b36ecc09c767.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
77731b8fe8 Revert "refactor(compiler): support interpolation tokens when lexing attribute values (#42062)" (#43033)
This reverts commit c516e252fcb199f2f503db5dc6ce563a299da010.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
8d8ab4775c Revert "refactor(compiler): support encoded entity tokens when lexing markup (#42062)" (#43033)
This reverts commit 942b24d5ea5d36ad4e53ed435bda35a6ae6876c9.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
ea5ed4e4d4 Revert "refactor(compiler): expose token parts in Text nodes (#42062)" (#43033)
This reverts commit 8a54896a91512131fbfb0b3d2f5440aec792cbfd.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
6f05dd8062 Revert "test(compiler): check fullStart source-span (#42062)" (#43033)
This reverts commit 973f9b8d1957d5479f5813664d35fd445f38e525.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
dd82bbfa27 Revert "fix(compiler): include leading whitespace in source-spans of i18n messages (#42062)" (#43033)
This reverts commit f08516db09df64c075f273159a15f80c792c96f0.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
8b6f7ac36b Revert "refactor(compiler): define interfaces for each lexer token (#42062)" (#43033)
This reverts commit 9b3d4f5575bfccfbbfb943dc9689f3915dd63752.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
fac6ea5fae Revert "test(compiler): check that the parser supports prematurely terminated interpolations (#42062)" (#43033)
This reverts commit 11ebe21d0dc8d82970153007e780800c87a76021.

PR Close #43033
2021-08-03 15:38:54 -07:00
atscott
28651eb9c1 Revert "refactor(compiler): use === rather than == in the ml_parser (#42062)" (#43033)
This reverts commit 28b0c45fde59da35a797cbdcceba973dbbb497a4.

PR Close #43033
2021-08-03 15:38:53 -07:00
atscott
f85b5f9dbd Revert "test(compiler): add a test for parsing multiline expressions in attributes (#42062)" (#43033)
This reverts commit fe1265158051ec3a90945bbc199af8c271b52842.

PR Close #43033
2021-08-03 15:38:53 -07:00
ivanwonder
f0c5ba08f6 fix(language-service): global autocomplete doesn't work when the user tries to modify the symbol (#42923)
When the user tries to trigger suggestions from an interruption,
the LS should provide the global completions. For example,
`[input]="t¦"`, the `t` can be the `true` or the symbol from
the component context.

PR Close #42923
2021-08-02 17:08:30 -07:00
dario-piotrowicz
f62366fd16 docs: amend links in content-projection guide (#43009)
PR Close #43009
2021-08-02 15:36:51 -07:00
Kristiyan Kostadinov
9a3cf661a2 refactor(core): update peerDependencies to allow rxjs7 (#42991)
We can't update the framework to rxjs7 until version 13, because it contains breaking changes, but we can allow users to opt into it since all of our code should be compatible.

These changes expand the allowed version range of rxjs and add an integration test to verify that we don't get compilation errors. Note that we also have a test that runs the AIO examples against rxjs 7 already (#42660).

Fixes #41897.

PR Close #42991
2021-08-02 13:55:01 -07:00
George Kalpakas
5d8759b6a2 build(docs-infra): upgrade cli command docs sources to 129d45cfa (#43004)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](a57976b98...129d45cfa):

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

PR Close #43004
2021-08-02 10:42:06 -07:00
Andrew Kushnir
8861d73e7f build: rename shims_for_IE.js -> shims_for_internal_tests.js (#43002)
This commit renames shims_for_IE.js -> shims_for_internal_tests.js, since there are no IE shims there anymore (there are still shims for older Safari and Android versions).

PR Close #43002
2021-08-02 10:38:42 -07:00
Andrew Kushnir
892ae85873 ci: remove IE11 from the list of browsers used during CI (#43002)
This commit performs several updates to stop running tests in IE11 on CI (since IE11 support was deprecated in v12 and will be dropped in v13).

PR Close #43002
2021-08-02 10:38:42 -07:00
Pete Bacon Darwin
fe12651580 test(compiler): add a test for parsing multiline expressions in attributes (#42062)
This tests a scenario that was failing in an internal project.

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
28b0c45fde refactor(compiler): use === rather than == in the ml_parser (#42062)
This is a simple tidy up commit to move to the more specific `===`
comparison operator in the HTML lexer/parser.

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
11ebe21d0d test(compiler): check that the parser supports prematurely terminated interpolations (#42062)
Such interpolations turned up during internal testing at Google, so this
commit adds a test to prevent regressions.

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
9b3d4f5575 refactor(compiler): define interfaces for each lexer token (#42062)
These token interfaces will make it easier to reason about tokens in the
parser and in specs.

Previously, it was never clear what items could appear in the `parts`
array of a token given a particular `TokenType`. Now, each token interface
declares a labelled tuple for the parts, which helps to document the token
better.

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
f08516db09 fix(compiler): include leading whitespace in source-spans of i18n messages (#42062)
Previously, the way templates were tokenized meant that we lost information
about the location of interpolations if the template contained encoded HTML
entities. This meant that the mapping back to the source interpolated strings
could be offset incorrectly.

Also, the source-span assigned to an i18n message did not include leading
whitespace. This confused the output source-mappings so that the first text
nodes of the message stopped at the first non-whitespace character.

This commit makes use of the previous refactorings, where more fine grain
information was provided in text tokens, to enable the parser to identify
the location of the interpolations in the original source more accurately.

Fixes #41034

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
973f9b8d19 test(compiler): check fullStart source-span (#42062)
The tests were checking that the source-span of parsed HTML nodes were
accurate, but they were not checking the span when it includes the
"leading trivia", which are given by the `fullStart` rather than `start`
location.

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
8a54896a91 refactor(compiler): expose token parts in Text nodes (#42062)
When it was tokenized, text content is split into parts that can include
interpolations and encoded entities tokens.

To make this information available to downstream processing, this commit
adds these tokens to the `Text` AST nodes, with suitable processing.

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
942b24d5ea refactor(compiler): support encoded entity tokens when lexing markup (#42062)
The lexer now splits encoded entity tokens out from text and attribute value tokens.

Previously encoded entities would be decoded and the decoded value would be
included as part of the text token of the surrounding text. Now the entities
have their own tokens. There are two scenarios: text and attribute values.

Previously the contents of `<div>Hello &amp; goodbye</div>` would be a single
TEXT token. Now it will be three tokens:

```
TEXT: "Hello "
ENCODED_ENTITY: "&", "&amp;"
TEXT: " goodbye"
```

Previously the attribute value in `<div title="Hello &amp; goodbye">` would be
a single text token. Now it will be three tokens:

```
ATTR_VALUE_TEXT: "Hello "
ENCODED_ENTITY: "&", "&amp;"
ATTR_VALUE_TEXT: " goodbye"
```

- ENCODED_ENTITY tokens have two parts: "decoded" and "encoded".
- ENCODED_ENTITY tokens are always preceded and followed by either TEXT tokens
  or ATTR_VALUE_TEXT tokens, depending upon the context, even if they represent
  an empty string.

The HTML parser has been modified to recombine these tokens to allow this
refactoring to have limited effect in this commit. Further refactorings
to use these new tokens will follow in subsequent commits.

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
c516e252fc refactor(compiler): support interpolation tokens when lexing attribute values (#42062)
The lexer now splits interpolation tokens out from attribute value tokens.
Previously the attribute value of `<div attr="Hello, {{ name}}">` would be a single
token. Now it will be three tokens:

```
ATTR_VALUE_TEXT: "Hello, "
ATTR_VALUE_INTERPOLATION: "{{", " name", "}}"
ATTR_VALUE_TEXT: ""
```

- ATTR_VALUE_INTERPOLATION tokens have three parts, "start marker",
  "expression" and "end marker".
- ATTR_VALUE_INTERPOLATION tokens are always preceded and followed
  by TEXT tokens, even if they represent an empty string.

The HTML parser has been modified to recombine these tokens to allow this
refactoring to have limited effect in this commit. Further refactorings
to use these new tokens will follow in subsequent commits.

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
3d3b69ff81 refactor(compiler): share isQuote() via chars.ts (#42062)
This function is general purpose and by moving it into the
`chars.ts` file along with similar helpers, it can be reused
in the lexer, for instance.

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
c8a46bfdcd refactor(compiler): support interpolation tokens when lexing markup (#42062)
The lexer now splits interpolation tokens out from text tokens.

Previously the contents of `<div>Hello, {{ name}}<div>` would be a single
text token. Now it will be three tokens:

```
TEXT: "Hello, "
INTERPOLATION: "{{", " name", "}}"
TEXT: ""
```

- INTERPOLATION tokens have three parts, "start marker", "expression"
  and "end marker".
- INTERPOLATION tokens are always preceded and followed by TEXT tokens,
  even if they represent an empty string.

The HTML parser has been modified to recombine these tokens to allow this
refactoring to have limited effect in this commit. Further refactorings
to use these new tokens will follow in subsequent commits.

PR Close #42062
2021-08-02 09:53:13 -07:00
Pete Bacon Darwin
75855196e3 refactor(compiler): remove cyclic dependencies (#42062)
This commit removes 9 cycles in the dependency graph of the compiler code.

PR Close #42062
2021-08-02 09:53:12 -07:00
Pete Bacon Darwin
29f9888a98 test(compiler-cli): clarify source-map expectations in compliance tests (#42062)
The compliance tests can check source-map segments against expectations
encoded into the expectation files. Previously, the encoding of the expected
segment was only delimited by whitespace, but this made it difficult to identify
segments that started or ended with whitespace.

Now these segment expectations are wrapped in double-quotes which makes
it easier to read and understand the expectation files.

PR Close #42062
2021-08-02 09:53:12 -07:00
Pete Bacon Darwin
42265cca1c refactor(ngcc): remove unused import (#42062)
This import is not used in the file, so can be removed.

PR Close #42062
2021-08-02 09:53:12 -07:00
Alex Rickabaugh
0af354ce05 refactor(bazel): extract function to patch fileNameToModuleName on host (#42974)
This commit extracts the patching operation that adds `fileNameToModuleName`
to the Angular compiler's `ts.CompilerHost` into a separate function, so
that it can be invoked in other compilation flows besides the one outlined
in `ngc-wrapped`. This is primarily needed for the xi18n operation in g3.

PR Close #42974
2021-07-30 09:29:42 -07:00