This commit updates a file that was changed recently, but that change triggered the `lint` CI job to fail, since the lint rules were slightly changed.
PR Close#44136
remove the comment suggesting to use a const enum for ViewEncapsulation in
the renderer3/definitions.ts file and add a similar comment in the
view.ts file in which the enum is defined
Note: the new comment does not contain the suggestion of changing `None`
to `0` as it is unclear what benefits that would bring (for more info
see: https://github.com/angular/angular/pull/44099#discussion_r744157686)
PR Close#44099
When a partially compiled component or directive is "linked" in JIT mode, the body
of its declaration is evaluated by the JavaScript runtime. If a class is referenced
in a query (e.g. `ViewQuery` or `ContentQuery`) but its definition is later in the
file, then the reference must be wrapped in a `forwardRef()` call.
Previously, query predicates were not wrapped correctly in partial declarations
causing the code to crash at runtime. In AOT mode, this code is never evaluated
but instead transformed as part of the build, so this bug did not become apparent
until Angular Material started running JIT mode tests on its distributable output.
This change fixes this problem by noting when queries are wrapped in `forwardRef()`
calls and ensuring that this gets passed through to partial compilation declarations
and then suitably stripped during linking.
See https://github.com/angular/components/pull/23882 and https://github.com/angular/components/issues/23907
PR Close#44113
Previously, running tests in CI with the chromium-local browser would cause the following error "Running as root without --no-sandbox is not supported".
Now the karma test suites run in a custom no sandbox browser.
Allows shell-chrome to be built with bazel. Currently this is built in production mode with terser minified code and the appropriate manifest and content script files to make the chrome extension work properly.
Allows shared-utils and protocol to be built with `bazel build projects/shared-utils` and `bazel build projects/protocol`. This lays down the necessary ground work to include these libraries as dependencies in other bazel build rules.
Marks the beginning of a migration over to building Angular devtools with Bazel. This commit brings in tooling from the canonical angular bazel example repository and includes the necessary dependencies in the package.json
Contents of generated tsconfig for tsec_test now depend on whether
Bazel uses symlinked runfiles for nodejs_test. The current
implementation assumes that symlinked runfiles are not available
on Windows.
PR Close#43924
Animation's `onRemovalComplete` callback is using incorrect `parentNode`.
Should be parentNode provided by `delegate.parentNode(element)` instead of direct `element.parentNode`.
This is not a problem with default renderer but can cause problems with custom renderer if it uses another
logic to add/remove nodes.
Fixes#44023
PR Close#44033
This commit moves code in the language service package out of the ivy
subfolder. Ivy is the _only_ engine supported in v13+ so there's no need
to have a name for it.
PR Close#44064
This commit removes ViewEngine-specific code from the langauge service
package. This code is no longer used since VE is not supported in v13+.
PR Close#44064
Currently the TS version checking function interprets a version like `1.2.3-rc.5` as `1.2.NaN` which would allow it to bypass the version checking altogether.
These changes add a little bit more logic to ensure that such versions are handled correctly. There's also an error if we don't manage to parse the version string.
Also it seemed like we never actually ran the version check unit tests, because they didn't have a test target.
PR Close#44109
This commit adds additional information to encourage developers to contact
the author of View Engine libraries and ask them to update to partial Ivy.
Fixes#42308
PR Close#43996
Renovate currently always applies the minor label. This often causes
the patch/FF/RC branches to quickly diverge. We should always apply
the patch label with the goal of keeping infra-related changes in sync
as much as possible.. Then it is still possible to selectively apply the
minor/major label if needed (this forces the reviewer to actually think
about where this should go in, if it fails!).
PR Close#44065
Currently, we skip the time spent in evaluation of embedded view
templates because the passed context is either an NgIf or an NgForOf.
This change generalizes the implementation to work with views embedded
into a component.
add 'number' to the ignoreGenericWords set so that it doesn't get
wrongly linked to the decimalPipe during the aio docs generation
as it is a generic typescript term
PR Close#44000
Linting has recently been removed from the examples provided in angular.io
(see PRs #43592 and #43746) such removal effects the downloadable and
stackblitz examples but linting is still generally used in the examples
in the aio project itself (they are being migrated from tslint to eslint in
PR #43218) thus eslint directive comments are still necessary in the code itself.
So the comments need to be present but need not to be exposed to the users
(not in the zips, stackblitzes nor docs themselves), these changes are
removing such comments during the examples' parsing phase (effectively
removing them from all three sources mentioned above).
Original discussion: https://github.com/angular/angular/pull/43218#discussion_r697305494resolves#43788
PR Close#43831
This commit removes the dynamic creation of named arrays for internal
runtime storage arrays as they may cause CSP violations in development
mode, when an application's CSP configuration does not include
`unsafe-eval`.
Named arrays for view data can still be enabled in development mode
using the `ngDevMode=namedConstructors` query parameter when loading the
application.
The usage of native class syntax for named arrays does not have the
desired effect when the code is downleveled to ES5. Since ES5 targets
are becoming increasingly more rare this is considered less of a problem
than the CSP violation.
Fixes#43494
PR Close#43587
I've noticed that the seconds are expressed both by using numbers and words.
For example, the doc says `0.5 second` and not `half second`.
I believe is more readable to express them by using numbers and is consistent too.
PR Close#40098
Consider the `NgModel` directive which has the `ngModelOptions` input:
```ts
class NgModel {
@Input() ngModelOptions: { updateOn: 'blur'|'change'|'submit' };
}
```
In a template this may be set using an object literal as follows:
```html
<input ngModel [ngModelOptions]="{updateOn: 'blur'}">
```
This assignment should be accepted, as the object's type aligns with the
`ngModelOptions` input in `NgModel`. However, if the `strictNullInputTypes`
option is disabled this assignment would inadvertently produce an error:
```
Type '{ updateOn: string; }' is not assignable to type '{ updateOn: "blur"|"change"|"submit"; }'.
Types of property 'updateOn' are incompatible.
Type 'string' is not assignable to type '"blur"|"change"|"submit"'
```
This is due to the `'blur'` value being inferred to be of type `string`
instead of retaining its literal type. The non-null assertion operator
that is automatically inserted for input binding assignments when
`strictNullInputTypes` is disabled inhibits TypeScript from inferring
the string value as its literal type.
This commit fixes the issue by omitting the insertion of the non-null
operator for object literals and array literals.
PR Close#38305
By checking if the providedIn is a function instead of everything but a function, typescript properly
narrows the typings for creating the expressions.
PR Close#44089
Previous commits changed the docs to use web-container versions for StackBlitz examples.
This commit updates the content of the tutorial to match.
Fixes#44079
PR Close#44085
Previously there was a custom version of the testing app for Stackblitz that would run the tests in the browser.
With the web-container approach, this is no longer necessary since the tests can be run directly from the command line.
Fixes#44047
PR Close#44085
When a safe method call such as `person?.getName()` is used, the
compiler would generate invalid code if the argument list also contained
a safe method call. For example, the following code:
```
person?.getName(config?.get('title').enabled)
```
would generate
```
let tmp;
ctx.person == null ? null : ctx.person.getName((tmp = tmp) == null ?
null : tmp.enabled)
```
Notice how the call to `config.get('title')` has completely disappeared,
with `(tmp = tmp)` having taken its place.
The issue occurred due to how the argument list would be converted
from expression AST to output AST twice. First, the outer safe method
call would first convert its arguments list. This resulted in a
temporary being allocated for `config.get('title')`, which was stored in
the internal `_resultMap`. Only after the argument list has been
converted would the outer safe method call realize that it should be
guarded by a safe access of `person`, entering the `convertSafeAccess`
procedure to convert itself. This would convert the argument list once
again, but this time the `_resultMap` would already contain the
temporary `tmp` for `config?.get('title')`. Consequently, the safe
method in the argument list would be emitted as `tmp`.
This commit fixes the issue by ensuring that nodes are only converted
once.
Closes#44069
PR Close#44088
Notify developers that @angular/animations package has been "significantly de-prioritized"
`animateChild` documentation now references #30477
References #30477# Please enter the commit message for your changes. Lines starting
PR Close#44014
Previously, the SystemJS-based docs examples (typically `ngUpgrade`
examples) were not compatible with Angular v13 (due to the removal of
UMD bundles from the published packages).
This commit makes the examples compatible with Angular v13 and
re-enables the tests for all SystemJS-based examples on CI.
PR Close#43868