Commit graph

21650 commits

Author SHA1 Message Date
Andrew Scott
286b2807de fix(router): eagerly update internal state on browser-triggered navigations (#43102)
The management of `browserUrlTree` currently has several problems with
correctly tracking the actual state of the browser.

This change makes the Router eagerly update the `browserUrlTree` when
handling navigations triggered by browser events (i.e., not 'imperative'). This
is because with those types of navigations, the browser URL bar is
_already_ updated. If we do not update the internal tracking of the
`browserUrlTree`, we will be out of sync with the real URL if the
navigation is rejected.

It would be best if we could remove `browserUrlTree` completely, but doing that
would require a lot more investigation and is blocked by #27059 because
the SpyLocation used in tests does not emulate real browser behavior.

fixes #43101

PR Close #43102
2021-08-16 09:33:23 -07:00
ali
b3bb6ec161 docs: add example for template local variable (#43137)
PR Close #43137
2021-08-16 09:24:12 -07:00
dario-piotrowicz
971f8572d2 refactor(compiler-cli): remove extra 'diagnostic' from readResource comment (#43147)
remove the extra 'diagnostic' present in the comment for the
ResourceHost's readResource method

PR Close #43147
2021-08-16 09:23:39 -07:00
dario-piotrowicz
0c84f6fd52 refactor(compiler): fix lateron typo in i18n ExtractorHost (#43160)
fix typo put in the ExtractorHosts's resourceNameToFileName comment
in which "later on" is spelled "lateron"

PR Close #43160
2021-08-16 09:23:13 -07:00
Renovate Bot
b0b7ef2985 build: update dependency build_bazel_rules_nodejs to v3.8.0 (#43136)
PR Close #43136
2021-08-13 14:59:52 -07:00
Joey Perrott
2a1aa5867d ci: add breaking changes auto labeling action (#43141)
Automatically add/remove `breaking changes` label to PRs as needed based on whether
the PR contains a commit with a breaking change.

PR Close #43141
2021-08-13 14:58:45 -07:00
pichuser
470371f1b2 docs: fix description: "property decorator" (not parameter) (#43068) (#43128)
PR Close #43068

PR Close #43128
2021-08-12 15:36:59 -07:00
Renovate Bot
398be10262 build: update all non-major dependencies (#42922)
PR Close #42922
2021-08-12 15:36:07 -07:00
Andrew Scott
c7d305b072 refactor(compiler): Remove compileUndecoratedClasses config file (#43043)
This config file was added to support g3 patches. Now that the patch is removed internally,
we can remove the file completely

PR Close #43043
2021-08-12 15:35:07 -07:00
Theoklitos Bampouris
a2a9b917b5 docs: adjust description to code example (#43127)
Remove promise's then(...) callback from description to match the code example's async/await syntax.
PR Close #43127
2021-08-12 15:32:47 -07:00
ivanwonder
d5f9890c92 feat(language-service): auto-apply optional chaining on nullable symbol (#42995)
Support automatically inserts the optional chaining operator (`?.`)
when property access (`.`) is done on a nullable symbol.

Fixes https://github.com/angular/vscode-ng-language-service/issues/1094

PR Close #42995
2021-08-12 09:23:21 -07:00
George Kalpakas
9fb79d38aa build(docs-infra): upgrade cli command docs sources to 81ba264f9 (#43114)
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](a52ca2236...81ba264f9):

**Modified**
- help/build.json

PR Close #43114
2021-08-11 10:40:21 -07:00
Andrew Kushnir
1f1822216e
release: cut the v13.0.0-next.1 release (#43119) 2021-08-11 10:25:57 -07:00
Andrew Kushnir
817c386be3
docs: release notes for the v12.2.1 release (#43118) 2021-08-11 10:20:56 -07:00
Daniel Trevino
e25d35f4cb refactor(compiler-cli): add test for BananaInBoxCheck (#42984)
Create the test package for extended_template_diagnostics and add a unit
test for the `BananaInBoxCheck`.

Refs #42966

PR Close #42984
2021-08-10 15:55:49 -07:00
Daniel Trevino
d6411c2729 refactor(compiler-cli): add BananaInBoxCheck to the template checks (#42984)
Add the implementation of a Template Check that ensures the correct
use of two-way binding syntax. Generates a warning when
'([foo])="bar"' is found instead of '[(foo)]="bar"'.

Refs #42966

PR Close #42984
2021-08-10 15:55:49 -07:00
Daniel Trevino
9a0a2b6e75 refactor(compiler-cli): visit inputs and outputs for elements and templates (#42984)
This commit adds to the exisiting `RecursiveVisitor` and visits inputs
and outputs for elements and templates.

Refs #42966

PR Close #42984
2021-08-10 15:55:49 -07:00
Daniel Trevino
29a5a90111 refactor(compiler-cli): move getSourceCodeForDiagnostic to utils (#42984)
Export `getSourceCodeForDiagnostic` from `ngtsc/testing` to make it
available for other packages. This will help confirm that the source
code is correct in other tests.

Refs #42966

PR Close #42984
2021-08-10 15:55:49 -07:00
Daniel Trevino
29e2bc7d91 refactor(compiler-cli): move typecheck test utils into its own package (#42984)
This commit moves the test utils used in the typechecking tests into its
own package. This makes them available to be used in the tests of a
different package.

Refs #42966

PR Close #42984
2021-08-10 15:55:49 -07:00
Daniel Trevino
be8a8e17a8 refactor(compiler-cli): introduce getExtendedTemplateDiagnosticsForComponent function (#42984)
Add function to get extended template diagnostics generated by all the template checks.

Refs #42966

PR Close #42984
2021-08-10 15:55:49 -07:00
Daniel Trevino
c055cfe281 refactor(compiler-cli): make makeTemplateDiagnostic wrapper error (#42984)
specific

This commit makes the wrapper function `makeTemplateDiagnostic` take an
ErrorCode as a type for the `ts.Diagnostic`s to be generated.

Refs #42966

PR Close #42984
2021-08-10 15:55:49 -07:00
Daniel Trevino
3a092d6cea refactor(compiler-cli): introduce extended package to typecheck with it's API (#42984)
This commit introduces //packages/compiler-cli/src/ngtsc/typecheck/extended
as a container for a new phase of diagnostics generation. The API provides an
interface for new template checks to implement and generate template diagnostics.

Refs #42966

PR Close #42984
2021-08-10 15:55:49 -07:00
Tim Gates
e3415e597e docs: Fix a few typos (#43051)
There are small typos in:
- aio/content/guide/universal.md
- aio/content/guide/upgrade.md
- aio/content/guide/workspace-config.md
- dev-infra/ng-dev.js
- integration/check-dependencies.js

Fixes:
- Should read `mergeable` rather than `mergable`.
- Should read `upgradeable` rather than `upgradable`.
- Should read `thresholds` rather than `threshholds`.
- Should read `lease` rather than `leage`.
- Should read `ignore` rather than `ingore`.
- Should read `bootstrapping` rather than `bootstraping`.

PR Close #43051
2021-08-10 11:59:29 -07:00
Erik Slack
596d533f97 docs: add angular community meetup and ngxp to community resources (#43103)
Invite people to get more involved with Angular's community via these

PR Close #43103
2021-08-10 11:56:22 -07:00
Amadou Sall
002d959fe5 docs: remove the mention of Stylus (#43013)
Stylus is not supported anymore by Angular, so it should be removed from the Angular docs

PR Close #43013
2021-08-10 11:55:35 -07:00
Andrew Kushnir
181adff213
Revert "build(dev-infra): exlude commit message filter from formatting (#43091)" (#43104)
This reverts commit 7edb128221.

The reason for the revert is the breakage of the merge tooling (`dev-infra/commit-message-filter.js: No such file or directory`).
2021-08-10 11:45:40 -07:00
Vugar_Abdullayev
7edb128221 build(dev-infra): exlude commit message filter from formatting (#43091)
exlude commit-message-filter.js from clang format and tslint

PR Close #43091
2021-08-10 10:44:35 -07:00
Andrew Kushnir
cb988aebb0 refactor(core): replace references to goog.LOCALE with goog.getLocale() (#43089)
It is necessary in order to distinguish 2 different reasons for referencing the compiled-in locale.

1. Some code just needs to pass the locale value on to logic that actually uses it.
2. Other code uses the locale value to select locale-specific user-visible data and behavior.

Code modified by this change is of the first kind and should use `goog.getLocale()` in the future.

Note: there are still references to the `goog.LOCALE` in Angular codebase, but they are of second type.

PR Close #43089
2021-08-10 10:35:26 -07:00
George Kalpakas
892bd929f2 build(docs-infra): upgrade cli command docs sources to a52ca2236 (#43093)
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](cf835b898...a52ca2236):

**Modified**
- help/generate.json

PR Close #43093
2021-08-10 10:33:30 -07:00
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 42265cca1c.

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 29f9888a98.

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

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 c8a46bfdcd.

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 3d3b69ff81.

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 c516e252fc.

PR Close #43033
2021-08-03 15:38:54 -07:00