22668 Commits

Author SHA1 Message Date
alkavats1 2913b4c58b docs(common): url link format updated (#44645)
fix the url link format from http to https in BAZEL.md && component-styles.md

PR Close #44645
2022-01-06 23:49:47 +00:00
Joey Perrott 6c15170eb9 build: update .bazelversion (#44641)
Update to the latest version of bazel.

PR Close #44641
2022-01-06 23:49:02 +00:00
JoostK a26afce68c fix(compiler-cli): fix crash during type-checking of library builds (#44587)
When building a library, the `rootDir` option is configured to ensure
that all source files are present within the entry-point that is being
build. This imposes an extra constraint on the reference emit logic,
which does not allow emitting a reference into a source file outside of
this `rootDir`.

During the generation of type-check blocks we used to make a best-effort
estimation of whether a type reference can be emitted into the
type-check file. This check was relaxed in #42492 to support emitting
more syntax forms and type references, but this change did not consider
the `rootDir` constraint that is present in library builds. As such, the
compiler might conclude that a type reference is eligible for emit into
the type-check file, whereas in practice this would cause a failure.

This commit changes the best-effort estimation into a "preflight"
reference emit that is fully accurate as to whether emitting a type
reference is possible.

Fixes #43624

PR Close #44587
2022-01-06 23:44:24 +00:00
JoostK d13e054950 refactor(compiler-cli): implement realpath in NgtscCompilerHost (#44587)
The `NgtscCompilerHost` is implemented using the `FileSystem`
abstraction of the compiler, which is implemented for tests using an
in-memory `MockFileSystem`. If the in-memory filesystem contains
symlinks, then using `NgtscCompilerHost` would not reflect their
resolved real path. Instead, the TypeScript compiler would use its
default implementation based on the real filesystem, which is unaware of
the in-memory `MockFileSystem` setup.

This change does not currently address any issues, but is being fixed
as it prevented a reproduction scenario from behaving correctly.

PR Close #44587
2022-01-06 23:44:24 +00:00
JoostK 9b19ba0b85 test(compiler-cli): properly support symlinks in MockFileSystem (#44587)
This commit fixes an issue with symlink handling in `MockFileSystem`,
where entries within a symlink would fail to resolve.

PR Close #44587
2022-01-06 23:44:24 +00:00
JoostK c9eef5e969 refactor(compiler-cli): use absoluteFromSourceFile to obtain a source file path (#44587)
Using `absoluteFromSourceFile` leverages the cache of the resolved
absolute path, instead of having to compute it each time.

PR Close #44587
2022-01-06 23:44:24 +00:00
JoostK 3b7fe8ba7d refactor(compiler-cli): improve DX for reference emit failures (#44587)
In certain scenarios, the compiler may have crashed with an
`Unable to write a reference` error which would be particularly hard
to diagnose. One of the primary reasons for this failure is when the
`rootDir` option is configured---typically the case for libraries---
and a source file is imported using a relative import from an external
entry-point. This would normally report TS6059 for the invalid relative
import, but the crash prevents this error from being surfaced.

This commit refactors the reference emit logic to result in an explicit
`Failure` state with a reason as to why the failure occurred. This state
is then used to report a `FatalDiagnosticException`, preventing a hard
crash.

Closes #44414

PR Close #44587
2022-01-06 23:44:24 +00:00
Yuchao Wu 5017bf92fe docs(animations): fix grammar (#44607)
Fix grammar issues based on suggestions in issue #44403

Fixes #44403

PR Close #44607
2022-01-06 18:40:03 +00:00
shejialuo c0d3fbeff0 docs(docs-infra): improve the content of attribute directives (#44628)
Improve docs "Understanding Angular-Directives-Attribute Directives"

In `highlight.directive.1.ts`, add the `private` keyword for `el` property
to make it correct and consistent with subsequent examples.

For section "Setting the value with user input", add a step to tell the
reader change the method `onMouseEnter`, thus more readable.

For section "Binding to a second property", delete the aliase for the
`Input` property, and changes the name back to `appHighlight` in the code
to make it consistent with the whole tutorial.

PR Close #44628
2022-01-06 18:36:46 +00:00
Kristiyan Kostadinov 7130bffbbd test: clean up more entryComponents usages (#44561)
Cleans up some more tests that were using `entryComponents`.

PR Close #44561
2022-01-06 18:36:22 +00:00
Yousaf Nawaz 8b2536e5e0 docs: fix typos in using libraries guide (#44634)
correct word typically, typescript and import

PR Close #44634
2022-01-06 00:23:06 +00:00
Dario Piotrowicz 9b9042c8d1 docs(animations): fix links to the AnimationBuilder.build method (#44594)
In angular.io links to the AnimationBuilder.build method are broken and do not
point to the api docs page, fix such broken links

Also apply minor wording and related improvements

PR Close #44594
2022-01-06 00:22:43 +00:00
alkavats1 98592b03bd docs(common): url link format updated (#44638)
fix the url link format from http to https in i18-common-locale-id.md file

PR Close #44638
2022-01-05 23:21:11 +00:00
Kristiyan Kostadinov 7dc6802db9 test(upgrade): fix flaky tests (#44597)
Fixes a couple of tests that have been flaking our test runs. The two tests actually failed consistently when run in isolation, but they passed if at least one test ran before them. My understanding was that they failed, because they were running outside of the `NgZone` which meant that the errors being thrown inside of a `Promise` weren't being flushed.

PR Close #44597
2022-01-05 23:20:43 +00:00
Paul Gschwendtner 6279e0a239 ci: temporarily disable components-repo-unit-tests job (#44505)
Temporarily disables the components repo unit tests job that
breaks due to us changing the devmode output to ES2015 in Angular Bazel.

This is a trivial thing to solve in the COMP repo but the job needs
to be disabled first, so that the changes can be released.

PR Close #44505
2022-01-05 23:20:21 +00:00
Paul Gschwendtner d908761f1f test: update example di tests to work with es2015 (#44505)
* `forwardRef` does not work with ES2015 and TypeScript's decorator
  downlevel emit. This is a known limitation we work around in Angular
  applications by either compiling tests with the Angular compiler, or
  by running a custom decorator downlevel transform (like in the CLI).

PR Close #44505
2022-01-05 23:20:21 +00:00
Paul Gschwendtner b734ceb3dc test: update acceptance core tests to work with es2015 (#44505)
Updates the acceptance core tests to work with ES2015 devmode output.
There were two issues surfacing:

* The NodeJS test execution failed because Domino does not handle
  destructuring syntax properly. This is because `Node.children` is not
  an iterable.

* `forwardRef` does not work with ES2015 and TypeScript's decorator
  downlevel emit. This is a known limitation we work around in Angular
  applications by either compiling tests with the Angular compiler, or
  by running a custom decorator downlevel transform (like in the CLI).

PR Close #44505
2022-01-05 23:20:21 +00:00
Paul Gschwendtner cefe9f0f2e test: update router tests to work with es2015 temporal dead zone (#44505)
Update router tests to work with the the es2015 temporal dead zone.

Somewhat similar to: https://github.com/angular/angular/issues/30106.

PR Close #44505
2022-01-05 23:20:21 +00:00
Paul Gschwendtner 5fa2c88134 test: update ngtsc specs to work with es2015 output (#44505)
Updates the ngtsc specs to work with ES2015 output.

PR Close #44505
2022-01-05 23:20:21 +00:00
Paul Gschwendtner 7b78256d6d build: switch devmode output to es2015 (#44505)
To make our test output i.e. devmode output more aligned
with what we produce in the NPM packages, or to be more
aligned with what Angular applications will usually consume,
the devmode output is switched from ES5 to ES2015.

Additionally various tsconfigs (outside of Bazel) have been
updated to match with the other parts of the build. The rules
are:

ES2015 for test configurations, ES2020 for actual code that will
end up being shipped (this includes the IDE-only tsconfigs).

PR Close #44505
2022-01-05 23:20:21 +00:00
Andrew Kushnir 0daa9bfd26 refactor(forms): make validators code compatible with property renaming (#44500)
This commit refactors the code of the base validators class to make it compatible with the property renaming optimization. Currently the code makes an assumption that the field with a specified name (defined as a string) can be found on an object, but with property renaming optimization this is not correct.

PR Close #44500
2022-01-05 18:43:37 +00:00
Chris Mancini 426b6f9472 docs(router): fix code block for IsActiveMatchOptions (#44635)
PR Close #44635
2022-01-05 17:47:08 +00:00
Dario Piotrowicz 6c5d73e3e4 docs(animations): fix filter-animations docregion (#44544)
the filter animation example in the complex-animation-sequences guide
talks about entering and leaving elements, but the presented html
snipped exluded the *ngFor which actually adds and removes the elements,
so add the *ngFor section to make the example complete and
understandable

PR Close #44544
2022-01-05 17:46:11 +00:00
JoostK 0ac4c0b406 refactor(compiler): remove output AST functions (#44411)
These functions are not used anymore so they are removed.

PR Close #44411
2022-01-04 15:54:12 -08:00
JoostK 07b8e56e11 refactor(compiler): remove class related output AST types (#44411)
The Ivy compiler no longer generates classes so this commit removes
the supporting output nodes.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 5f78f55f0d refactor(compiler): remove type-casting related output AST types (#44411)
The Ivy compiler no longer generates code for type-checking purposes
using the output AST types. Instead, it uses TypeScript AST nodes and
its printer for type-checking. This commit removes the type-related
output nodes.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 4688a180f4 refactor(compiler): remove some unused output AST types (#44411)
This kind of output is no longer emitted into generated code, so the
supporting output AST is removed.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK d7faf223e6 refactor(compiler): remove unused method from binding parser (#44411)
This method is no longer called so is being removed.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 6f70524495 refactor(compiler): make template preparser null-safe (#44411)
This commit removes some non-null assertion operations to improve
null-safety.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 94f34e028e refactor(compiler): remove unused unsupported function (#44411)
This function is no longer used so is being removed.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK db480829d4 refactor(compiler): make keySpan required in binding parser (#44411)
Now that ViewEngine has been removed the `keySpan` property can be
made required, as it is always provided in the Ivy compiler

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 9ef9b88cfd refactor(compiler): cleanup distinction in parse logic (#44411)
This removes the special casing of parse-validation logic that was only
used by Ivy.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK bbc368c9e8 refactor(compiler): remove BindingForm enum (#44411)
The Ivy compiler only uses `BindingForm.Expression`, so all other
variants are removed.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 5fdc660537 refactor(compiler): cleanup AST fixup of listener instructions (#44411)
This commit refactors the generation of listener instructions to no
longer fixup the output AST that was designed for ViewEngine.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 4f40266b21 refactor(compiler): remove unused assertion function (#44411)
This code is no longer used now that ViewEngine has been removed.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK c359381dc3 refactor(compiler): cleanup unsafe usage of null value for ng-content selector (#44411)
This commit improves the null-safety of the ng-content selector and
updates a comment that turned out to be slightly inaccurate.

Closes #38407

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 63c5a18b89 refactor(compiler): remove unused code from output logic (#44411)
This code is no longer used now that ViewEngine has been removed.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 9103b74ec0 refactor(compiler): remove unused AstPath (#44411)
This code is no longer used now that ViewEngine has been removed.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 75f7864dc7 refactor(compiler): remove unused logic from ConstantPool (#44411)
The `ConstantPool.getDefinition` method is not being used anymore, so
this commit removes anything that is related to this method.

PR Close #44411
2022-01-04 15:54:11 -08:00
JoostK 59cd255dde refactor(compiler): remove unused type declarations (#44411)
This code is no longer used now that ViewEngine has been removed.

PR Close #44411
2022-01-04 15:54:10 -08:00
JoostK 9c76560858 refactor(compiler): remove syntax error logic (#44411)
This code is no longer used now that ViewEngine has been removed.

PR Close #44411
2022-01-04 15:54:10 -08:00
dario-piotrowicz db768911c0 refactor(animations): add unit test for leaving animated child (#44489)
add a new unit test to make sure that leaving elements queried via
a parent queried via animateChild are correctly removed

note: this tests the fix introduced in PR #44357

PR Close #44489
2022-01-04 15:53:36 -08:00
Andrew Kushnir a6d12ef667 test: remove newlines to make a test more stable (#44616)
One of the tests was not taking into account newlines in the text content of an element, thus failing in some browsers. This commit makes the test more stable by removing newlines and comparing the output after that.

PR Close #44616
2022-01-04 15:53:00 -08:00
dario-piotrowicz 25aef6281a fix(docs-infra): adjust code link styling height (#44376)
the height of code links (anchors inside code tags or
code tags inside anchors) is inconsistent, fix such
issue by also making sure that code links to external
resources do not get wrongly styled

PR Close #44376
2022-01-04 12:19:09 -08:00
dario-piotrowicz 55209e5a37 docs(animations): add links to state() references (#44376)
the keyword 'state' is included in the `ignoredWords` set that prevents
certain words to be autolinked, this causes the animations' state
function not to be automatically linked, so manually link those
references to the state api docs

PR Close #44376
2022-01-04 12:19:09 -08:00
Abdurrahman Abu-Hijleh 0be1a82d91 docs: fix code sample indentation (#44517)
PR Close #44517
2022-01-04 12:15:55 -08:00
AlirezaEbrahimkhani d389bb8de6 docs: fix ngOnChange description issue (#44582)
ngOnChange respond when Angular sets or resets data-bound @input properties and description of the ngOnChanges should be `When an [input](#input) binding value changes` instead of `When an [input](#input)/[output](#output) binding value changes`

resolves angular#44559

PR Close #44582
2022-01-04 12:15:19 -08:00
huangqing 77562f9235 docs: Replace OnInit with AfterViewInit (#44485)
`this.adHost` is undefined if loadComponent is called in OnInit.
So replace OnInit with AfterViewInit!
PR Close #44485
2022-01-04 12:14:45 -08:00
Paul Gschwendtner 46c6f2052c test: update size goldens to reflect latest CLI devkit update (#44490)
Updates the size goldens to the reflect the latest CLI devkit updates.

PR Close #44490
2022-01-04 12:14:15 -08:00
Paul Gschwendtner 4765bf1c7a build: update release config to reflect latest ng-dev config changes (#44490)
The ng-dev release config changed its release configuration in order
to support experimental packages. This commit updates the FW release
config to work with the new config signature of ng-dev.

All of our peackages are non-experimental, so we do not specify
an explicit `experimental` property.

PR Close #44490
2022-01-04 12:14:15 -08:00