19496 Commits

Author SHA1 Message Date
Joey Perrott 884f743baa release: cut the v11.0.4 release (#40051)
PR Close #40051
11.0.4
2020-12-09 11:43:33 -08:00
Joey Perrott 73ab6730d8 Revert "feat(compiler): support tagged template literals in code generator (#39122)" (#40050)
This reverts commit 5631daa05c.

PR Close #40050
2020-12-09 11:38:55 -08:00
Joey Perrott 55326837b7 Revert "feat(compiler): allow trailing comma in array literal (#22277)" (#40050)
This reverts commit f7e767f3aa.

PR Close #40050
2020-12-09 11:38:55 -08:00
Julien b2090fdf93 docs(common): use table layout for Pre-defined format options (#40036)
easier to read
PR Close #40036
2020-12-09 09:11:04 -08:00
George Kalpakas 721cbdcd54 build(docs-infra): upgrade cli command docs sources to d72eb44f8 (#40035)
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/4915c24ab...d72eb44f8):

**Modified**
- help/add.json
- help/build.json
- help/config.json
- help/doc.json
- help/e2e.json
- help/extract-i18n.json
- help/generate.json
- help/new.json
- help/serve.json
- help/test.json
- help/update.json

PR Close #40035
2020-12-09 09:08:16 -08:00
Jessica Janiuk 7984b02570 ci: update pullapprove config to add comp labels (#39962)
This adds comp labels to each group defined in the yml file.

PR Close #39962
2020-12-09 09:05:47 -08:00
Alexey Elin 8ae5d2d7a0 docs: remove cursor: hand (#39918)
PR Close #39918
2020-12-09 09:04:55 -08:00
Aristeidis Bampakos 2046bd5735 docs: fix typos in the Style Precedence guide (#39560)
PR Close #39560
2020-12-09 09:02:15 -08:00
Christoph Guttandin 3dd9faf3fd docs: add angular-prerender to resources.json (#39387)
PR Close #39387
2020-12-09 09:01:24 -08:00
nseabourn 133075a174 docs: add reason to use Angular in README (#36927)
PR Close #36927
2020-12-09 08:58:11 -08:00
Benjamin Kindle 5a765f0be9 fix(animations): implement getPosition in browser animation builder (#39983)
Forward `getPosition` to `animation_group_player`.

PR Close #39983
2020-12-08 16:24:43 -08:00
Joey Perrott 03c3e07b8b fix(dev-infra): correct the environment variable to skip husky during merge (#40025)
With the migration to husky@5, the environment variable used to skip husky changed from
`HUSKY_SKIP_HOOKS` to `HUSKY`.  To continue skipping husky during the merge process as
expected, the environment variable used is updated.

PR Close #40025
2020-12-08 16:16:45 -08:00
devpato 38975ec7ab docs: add Pato Vargas to GDE resources (#40029)
PR Close #40029
2020-12-08 16:15:27 -08:00
Andrew Scott 65e93ea7b3 ci: add atscott to language-service approvers (#40027)
Add myself (atscott) to the list of approvers for language-service PRs.

PR Close #40027
2020-12-08 12:09:25 -08:00
Joey Perrott ef261974cb build: exclude build-worker file from formatting (#40012)
Exclude the generated build-worker.js file from formatting as it is
generated and not subject to formatting restrictions.

PR Close #40012
2020-12-08 12:08:28 -08:00
Joey Perrott 5fada68ed2 fix(dev-infra): allow build-worker to be used in forked process (#40012)
Generates a local copy of the build-worker file to allow it to be loaded
at runtime in a forked process.

PR Close #40012
2020-12-08 12:07:30 -08:00
Christoph Guttandin 588dbd3472 fix(service-worker): handle error with ErrorHandler (#39990)
Errors thrown by calling serviceWorker.register() are now passed to the global ErrorHandler.

Fixes #39913

PR Close #39990
2020-12-08 12:03:30 -08:00
George Kalpakas 97310d34f5 fix(upgrade): avoid memory leak when removing downgraded components (#39965)
Previously, due to the way the AngularJS and Angular clean-up processes
interfere with each other when removing an AngularJS element that
contains a downgraded Angular component, the data associated with the
host element of the downgraded component was not removed. This data was
kept in an internal AngularJS cache, which prevented the element and
component instance from being garbage-collected, leading to memory
leaks.

This commit fixes this by ensuring the element data is explicitly
removed when cleaning up a downgraded component.

NOTE:
This is essentially the equivalent of #26209 but for downgraded (instead
of upgraded) components.

Fixes #39911
Closes #39921

PR Close #39965
2020-12-08 12:02:53 -08:00
George Kalpakas 166c783958 refactor(upgrade): remove unused parameters/properties/variables (#39965)
This commit removes some unused parameters, properties and variables in
various `@angular/upgrade` functions.

PR Close #39965
2020-12-08 12:02:51 -08:00
Daniel Eisterhold 0969527c57 docs(platform-browser): fix spelling of deserialized (#36102)
PR Close #36102
2020-12-08 12:01:06 -08:00
Misko Hevery 19309b5797 Revert "build: update bazel rules_nodejs to version 2.3.1 (#39636)"
This reverts commit b82c88a0bf.
2020-12-08 11:11:15 -08:00
Misko Hevery 18124790b2 Revert "build: update to use npm_package.pack rule (#39636)"
This reverts commit 545ce2bf7e.
2020-12-08 11:11:10 -08:00
Kalle Järvenpää 8ab1231908 docs(animations): a small typo (#37164)
Removed two extra closing parentheses in docs.
PR Close #37164
2020-12-08 09:22:27 -08:00
JiaLiPassion 545ce2bf7e build: update to use npm_package.pack rule (#39636)
Remove the work around solution for the `npm pack`, we can now
use `npm_package.pack` rule of bazel, since the windows os issue
has been fixed here https://github.com/bazelbuild/rules_nodejs/commit/bc36519

PR Close #39636
2020-12-08 09:18:54 -08:00
JiaLiPassion b82c88a0bf build: update bazel rules_nodejs to version 2.3.1 (#39636)
Update the version `rules_nodejs` to 2.3.1, so the `npm_package.pack` rule
can now work on windows os.

PR Close #39636
2020-12-08 09:16:55 -08:00
Pete Bacon Darwin 55f1168ed1 docs: replace image with one containing correct text (#40022)
The previous image referred to "Mr IQ". The example application
(and the content of the referring guide) actually uses "Dr IQ".

Closes #34823

PR Close #40022
2020-12-08 09:12:03 -08:00
m-ahmadi a30abd118a docs: rephrased two sentences (#37230)
This commit rephrases a confusing sentence, and also adds more info to
another sentence to be more understandable.

PR Close #37230
2020-12-08 09:02:53 -08:00
Pete Bacon Darwin 37afe21c0a docs: fix reference to routes array in TOH tutorial (#40023)
The previous tutorial content referred to a `Routes` member of
`AppRoutingModule`, which is not correct. Instead there is a
`routes` variable that is passed to the `forRoot()` method when
configuring the `AppRoutingModule`.

Replaces #36583

PR Close #40023
2020-12-08 08:56:42 -08:00
George Kalpakas 976811d991 build(docs-infra): upgrade cli command docs sources to 4915c24ab (#40021)
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/9e3aebbcc...4915c24ab):

**Modified**
- help/generate.json

PR Close #40021
2020-12-08 08:55:11 -08:00
Joey Perrott bcd693de84 refactor(dev-infra): separate retrieving targeted branches from printing them (#39897)
Separate retrieving targeted branches from printing the branches to allow for
other tools to better integrate with the results.

PR Close #39897
2020-12-08 08:54:10 -08:00
Panagiotis Kyriazopoulos 3f58373707 docs(core): fix typos in the "View Encapsulation" guide (#39246)
1. In line 25 changed the word "components" to "component's".
2. In line 66 changed the phrase "you never refer to them" to "you should never refer to them".
3. Appended the paragraph containing the above phrase in a `div` with the class `alert is-helpful`.

PR Close #39246
2020-12-08 08:53:38 -08:00
ankitkaushik24 6eb3102b10 docs: removes the outdated content (#39242)
Remove the statements where mentions the component in the `entryComponents`
array inside `NgModule` metadata.

This is not required since Angular version 9.

PR Close #39242
2020-12-08 08:53:02 -08:00
profanis d1eaaf8959 docs: how to create a custom Attribute decorator in a child component and use it from a parent component (#38721)
Aside from using the @input() decorator, we can use the @Attrbitute decorator too.
Of course, those two are different and support different causes.
I expected to see a working example on the Attribute Bindings section, but I didn't find one.
This PR depicts the usage of the Attribute decorator between two components

PR Close #38721
2020-12-08 08:52:27 -08:00
Ajit Singh 739b2840ce docs: add note that sting based lazy loading is opt-in (#35956)
after angular version 8 string based lazy loading is not activated by default it is an opt in behaviour in which you have to add the lazy loaded routes in the tsconfig file for compilation. Aded a note too that it will be removed in version 11.

Fixes #35652

PR Close #35956
2020-12-08 08:47:41 -08:00
Bjarki 5631daa05c feat(compiler): support tagged template literals in code generator (#39122)
Add a TaggedTemplateExpr to represent tagged template literals in
Angular's syntax tree (more specifically Expression in output_ast.ts).
Also update classes that implement ExpressionVisitor to add support for
tagged template literals in different contexts, such as JIT compilation
and conversion to JS.

Partial support for tagged template literals had already been
implemented to support the $localize tag used by Angular's i18n
framework. Where applicable, this code was refactored to support
arbitrary tags, although completely replacing the i18n-specific support
for the $localize tag with the new generic support for tagged template
literals may not be completely trivial, and is left as future work.

PR Close #39122
2020-12-07 16:20:07 -08:00
Andrew Scott 6bb6dfd616 test(compiler-cli): Add test for checkTypeOfDomReferences = false (#39539)
Add test for when `checkTypeOfDomReferences = false` to ensure that we
do not regress in behavior at any point. The desired behavior for this
case is that the `TemplateTypeChecker` will honor the user's
configuration and not produce symbols for the dom reference.

PR Close #39539
2020-12-07 13:22:30 -08:00
George Kalpakas 28bf4d1422 build(docs-infra): upgrade cli command docs sources to 9e3aebbcc (#39944)
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/4f756ce2f...9e3aebbcc):

**Modified**
- help/analytics.json
- help/build.json
- help/config.json
- help/e2e.json
- help/extract-i18n.json
- help/generate.json
- help/lint.json
- help/new.json
- help/serve.json
- help/test.json
- help/update.json

PR Close #39944
2020-12-07 13:21:07 -08:00
Alexey Elin 6d629713f4 docs: use double colon for pseudo-elements (#40004)
The double colon helps to distinguish between pseudo-classes and pseudo-elements.
https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements

PR Close #40004
2020-12-07 09:49:49 -08:00
Joey Perrott a6178e39bd build: remove check-env script (#39980)
Remove the check-env script as it is not longer relied on and only surfaces
false positives/known mismatches at this point.

Since our tooling now acts using vendored code where needed, this is no
longer as necessary as it previously was.

PR Close #39980
2020-12-07 09:48:13 -08:00
Joey Perrott 0cdc8a161b feat(dev-infra): close pull requests on merge which do not target master branch (#39979)
Previously, when a PR which does not target the master branch in the Github UI was
merged it would not close automatically.  This change detects when this case occurs
and closes the PR via the Github API.

For example:

  A PR which targets the 11.0.x branch in the Github UI has the `target: patch` label

This PR is only pushed into the 11.0.x branch, which does not trigger Github's
reference based actions to close the PR.

PR Close #39979
2020-12-07 09:47:32 -08:00
George Kalpakas 072bc2a491 test(upgrade): run tests against AngularJS v1.8.x as well (#39972)
We intend to run the `@angular/upgrade` tests against all supported
versions of AngularJS (v1.5+). Previously, we only ran them against
v1.5, v1.6 and v1.7.

Since AngularJS v1.8 was released recently, this commit adds it to the
list of AngularJS versions we test against.

PR Close #39972
2020-12-07 09:40:51 -08:00
Misko Hevery 459fb7e36b build: Fix broken size test due to incorrect cherry pick
When resolving 2fbb684b4e a collision was incorrectly resolved.
2020-12-07 09:24:29 -08:00
Misko Hevery ae0e52f7e2 build: Fix broken size test due to incorrect cherry pick
When resolving 2fbb684b4e a collision was incorrectly resolved.
2020-12-04 17:02:25 -08:00
arturovt 735556d28f perf(forms): use ngDevMode to tree-shake _ngModelWarning (#39964)
This commit adds `ngDevMode` guard to call `_ngModelWarning` only
in dev mode (similar to how things work in other parts of Ivy runtime code).
The `ngDevMode` flag helps to tree-shake this function from production builds
(since it will act as no-op, in dev mode everything will work as it works right now)
to decrease production bundle size.

PR Close #39964
2020-12-04 16:12:09 -08:00
arturovt 72aad32046 perf(animations): use ngDevMode to tree-shake warning (#39964)
This commit adds ngDevMode guard to show warning only
in dev mode (similar to how things work in other parts of Ivy runtime code).
The ngDevMode flag helps to tree-shake this warning from production builds
(in dev mode everything will work as it works right now) to decrease production bundle size.

PR Close #39964
2020-12-04 16:12:01 -08:00
arturovt bf3de9bcc9 perf(common): use ngDevMode to tree-shake warnings (#39964)
This commit adds ngDevMode guard to show warnings only
in dev mode (similar to how things work in other parts of Ivy runtime code).
The ngDevMode flag helps to tree-shake these warnings from production builds
(in dev mode everything will work as it works right now) to decrease production bundle size.

PR Close #39964
2020-12-04 16:11:47 -08:00
arturovt 2fbb684b4e perf(core): use ngDevMode to tree-shake checkNoChanges (#39964)
This commit adds `ngDevMode` guard to run `checkNoChanges` only
in dev mode (similar to how things work in other parts of Ivy runtime code).
The `ngDevMode` flag helps to tree-shake this code from production builds
(in dev mode everything will work as it works right now) to decrease production bundle size.

PR Close #39964
2020-12-04 16:11:34 -08:00
Alex Rickabaugh adeeb84a35 fix(compiler-cli): correct incremental behavior even with broken imports (#39967)
When the compiler is invoked via ngc or the Angular CLI, its APIs are used
under the assumption that Angular analysis/diagnostics are only requested if
the program has no TypeScript-level errors. A result of this assumption is
that the incremental engine has not needed to resolve changes via its
dependency graph when the program contained broken imports, since broken
imports are a TypeScript error.

The Angular Language Service for Ivy is using the compiler as a backend, and
exercising its incremental compilation APIs without enforcing this
assumption. As a result, the Language Service has run into issues where
broken imports cause incremental compilation to fail and produce incorrect
results.

This commit introduces a mechanism within the compiler to keep track of
files for which dependency analysis has failed, and to always treat such
files as potentially affected by future incremental steps.

PR Close #39967
2020-12-04 16:06:23 -08:00
Alex Rickabaugh 178cc510e0 fix(compiler-cli): track poisoned scopes with a flag (#39967)
To avoid overwhelming a user with secondary diagnostics that derive from a
"root cause" error, the compiler has the notion of a "poisoned" NgModule.
An NgModule becomes poisoned when its declaration contains semantic errors:
declarations which are not components or pipes, imports which are not other
NgModules, etc. An NgModule also becomes poisoned if it imports or exports
another poisoned NgModule.

Previously, the compiler tracked this poisoned status as an alternate state
for each scope. Either a correct scope could be produced, or the entire
scope would be set to a sentinel error value. This meant that the compiler
would not track any information about a scope that was determined to be in
error.

This method presents several issues:

1. The compiler is unable to support the language service and return results
when a component or its module scope is poisoned.

This is fine for compilation, since diagnostics will be produced showing the
error(s), but the language service needs to still work for incorrect code.

2. `getComponentScopes()` does not return components with a poisoned scope,
which interferes with resource tracking of incremental builds.

If the component isn't included in that list, then the NgModule for it will
not have its dependencies properly tracked, and this can cause future
incremental build steps to produce incorrect results.

This commit changes the tracking of poisoned module scopes to use a flag on
the scope itself, rather than a sentinel value that replaces the scope. This
means that the scope itself will still be tracked, even if it contains
semantic errors.

PR Close #39967
2020-12-04 16:06:22 -08:00
Alex Rickabaugh 0aa35ecee1 fix(compiler-cli): remove the concept of an errored trait (#39967)
Previously, if a trait's analysis step resulted in diagnostics, the trait
would be considered "errored" and no further operations, including register,
would be performed. Effectively, this meant that the compiler would pretend
the class in question was actually undecorated.

However, this behavior is problematic for several reasons:

1. It leads to inaccurate diagnostics being reported downstream.

For example, if a component is put into the error state, for example due to
a template error, the NgModule which declares the component would produce a
diagnostic claiming that the declaration is neither a directive nor a pipe.
This happened because the compiler wouldn't register() the component trait,
so the component would not be recorded as actually being a directive.

2. It can cause incorrect behavior on incremental builds.

This bug is more complex, but the general issue is that if the compiler
fails to associate a component and its module, then incremental builds will
not correctly re-analyze the module when the component's template changes.
Failing to register the component as such is one link in the larger chain of
issues that result in these kinds of issues.

3. It lumps together diagnostics produced during analysis and resolve steps.

This is not causing issues currently as the dependency graph ensures the
right classes are re-analyzed when needed, instead of showing stale
diagnostics. However, the dependency graph was not intended to serve this
role, and could potentially be optimized in ways that would break this
functionality.

This commit removes the concept of an "errored" trait entirely from the
trait system. Instead, analyzed and resolved traits have corresponding (and
separate) diagnostics, in addition to potentially `null` analysis results.
Analysis (but not resolution) diagnostics are carried forward during
incremental build operations. Compilation (emit) is only performed when
a trait reaches the resolved state with no diagnostics.

This change is functionally different than before as the `register` step is
now performed even in the presence of analysis errors, as long as analysis
results are also produced. This fixes problem 1 above, and is part of the
larger solution to problem 2.

PR Close #39967
2020-12-04 16:06:21 -08:00