Commit graph

13907 commits

Author SHA1 Message Date
Angular Robot
ca61366218 build: update cross-repo angular dependencies (#63396)
See associated pull request for more information.

PR Close #63396
2025-08-27 16:14:31 -07:00
arturovt
fce5602b53 refactor(core): mark VERSION as @__PURE__ for better tree-shaking (#63400)
Annotate the `new Version(...)` call with `/* @__PURE__ */` to signal to
optimizers that the constructor is side-effect free.

Without this hint, bundlers such as Terser or ESBuild may conservatively
retain the `VERSION` instantiation even when unused. With the annotation,
the constant can be tree-shaken away in production builds if not referenced,
reducing bundle size.

PR Close #63400
2025-08-27 11:39:07 -07:00
arturovt
f87fad3fff fix(core): avoid injecting internal error handler from a destroyed injector (#62275)
This commit prevents lazy injection of the internal `ErrorHandler` from a destroyed injector, which would otherwise result in a secondary "destroyed injector" error.

The `handleUncaughtError` function is used in a wrapped event listener that invokes the `ErrorHandler` if the listener throws. A simple case in a micro-frontend application:

```ts
onNavigationToAnotherApp() {
  this.appRef.destroy();
  do_some_stuff_ie_loggin_that_may_throw();
}
```

If the function throws an error, Angular attempts to inject the `ErrorHandler` from a destroyed injector.

PR Close #62275
2025-08-27 11:35:55 -07:00
Alexander Melde
06c53679ba docs: update to new standalone default behavior (#63329)
When declaring directives, the standalone flag is set to true by default in current Angular versions.

The docs for the directive decorator should correctly explain the default behavior, while still mentioning when to set it to false.

PR Close #63329
2025-08-27 11:26:13 -07:00
Matthieu Riegler
e8d9bc5119 refactor(http): rework the HttpEvent union to improve narrowing. (#63267)
Prior to this change, `HttpProgressEvent` could not be narrowed to `HttpDownloadProgressEvent` or `HttpUploadProgressEvent`

PR Close #63267
2025-08-27 11:25:02 -07:00
Joey Perrott
26072bba9c build: move macros/build set up for zone.js into zone.js directories (#63421)
Move the zone_bundle and configurations into zone.js's tool directory

PR Close #63421
2025-08-27 11:23:58 -07:00
Joey Perrott
705b94bd21 refactor: remove TODOs which have been corrected (#63421)
Remove TODOs which were addressed but the comment was not removed

PR Close #63421
2025-08-27 11:23:57 -07:00
Jessica Janiuk
ed6a347109 refactor(core): prevent timeout from applying to non-event animation bindings (#63393)
The 4 second removal timeout was applying in all cases, but it should only actually apply to the situation where the event binding syntax is used for animate.leave. This ensures that's the only case in which it'll apply.

PR Close #63393
2025-08-27 11:17:40 -07:00
Andrew Scott
6d6b0278a8 refactor(core): Reorder resolve/reject in relation to navigate[error/success] (#63377)
Order was changed in https://github.com/whatwg/html/pull/11512 (see that
PR for details as to why).

https://whatpr.org/html/10919/nav-history-apis.html#abort-a-navigateevent

PR Close #63377
2025-08-27 11:16:53 -07:00
Taygan Caldwell
23d1ace339 refactor(core): Create a base effect interface and prototype to be used by both angular and wiz. (#62931)
Add a common effect interface and prototype to be used to create the wiz and angular effects.

PR Close #62931
2025-08-26 14:48:33 -07:00
Jessica Janiuk
d7b6045d61 fix(compiler): fixes animations on elements with structural directives (#63390)
The animate instructions were getting applied to the container comment nodes as well as the element nodes. This prevents that on the compiler level.

fixes: #63371

PR Close #63390
2025-08-26 09:47:08 -07:00
Joey Perrott
9a27c5befb build: rename defaults2.bzl to defaults.bzl (#63384)
Use defaults.bzl for the common macros

PR Close #63384
2025-08-25 15:45:46 -07:00
Angular Robot
328e588bcd build: lock file maintenance (#63360)
See associated pull request for more information.

PR Close #63360
2025-08-25 15:37:25 -07:00
Jessica Janiuk
c8f07daf8f fix(core): Fixes animate.leave binding to a string with spaces (#63366)
This fixes the rare case that someone uses binding syntax with `animate.leave` providing a value with a string that has spaces in it. For example:

```
<example `[animate.leave]="'class-a class-b"` />
```

fixes: #63365

PR Close #63366
2025-08-25 08:33:31 -07:00
Jessica Janiuk
650ad1f7fb docs: add important service worker note (#63364)
This adds an important note about the service worker to indicate we are not accepting new features.

PR Close #63364
2025-08-25 08:18:32 -07:00
Joey Perrott
10b0927e15 refactor: various build and import specificer fixes for strict deps (#63324)
Change direct deps in bazel targets and import specifiers within files to maintain strict deps requirements ahead of enabling strict deps tests in the repo

PR Close #63324
2025-08-22 14:45:34 -07:00
Jessica Janiuk
6c421ed65d fix(core): Ensures @for loop animations never get cancelled (#63328)
There's special logic in place to prevent duplicate nodes from showing up in the case when an `@if` toggles a view quickly. This had the unfortunate side effect of causing `@for` leave animations to get cancelled when an add and remove happened simultaneously, even if it was a different index. This fix prevents that from happening in the `@for` loop case.

fixes: #63307

PR Close #63328
2025-08-22 11:23:16 -07:00
Jessica Janiuk
9093e0e132 fix(core): fix memory leak with leaving nodes tracking (#63328)
This ensures the nodes are properly cleaned up from the leaving nodes map.

PR Close #63328
2025-08-22 11:23:16 -07:00
Matthieu Riegler
a28672fb70 fix(compiler): Keep paraenthesis in Nullish + Boolean expression. (#63292)
Ts 5.9 introduced a regression coming from 5.8 when parenthesis aren't generated for expressions like (`(a ?? b) && c`).
This fix works around this explicitly specifying that we want to keep those parenthesis that we're aware of in this specific case;

This change can be reverted if the root issue (https://github.com/microsoft/TypeScript/issues/61369) is fixed. (but let's keep the tests in any case for the coverage)

fixes #63287

PR Close #63292
2025-08-21 12:15:52 +02:00
Angular Robot
a827f02746 build: update cross-repo angular dependencies (#63285)
See associated pull request for more information.

PR Close #63285
2025-08-20 15:16:58 +00:00
Kristiyan Kostadinov
878b99a1c6 fix(compiler-cli): account for expression with type arguments during HMR extraction (#63261)
Fixes that the HMR extraction logic didn't accoubnt for expressions with type arguments (e.g. `viewChild('foo', {read: TemplateRef<unknown>})`).

Fixes #63240.

PR Close #63261
2025-08-20 11:31:45 +00:00
ivanwonder
591c7e2ec8 fix(language-service): Support to resolve the re-export component. (#62585)
In the context of TypeScript (TS), a re-exported symbol is considered a distinct symbol.
This means that a developer can choose to import either the re-exported symbol or
the original symbol. However, in the context of Angular, the re-exported symbol
is treated as the same component because it uses the same selector.

This pull request will utilize the most recent re-export component file to
resolve the module specifier.

PR Close #62585
2025-08-20 09:39:56 +00:00
Matthieu Riegler
81dc006772 docs: update NG_VALIDATORS examples to use forwardRef (#63247)
PR Close #63247
2025-08-20 09:27:21 +00:00
Jessica Janiuk
f9d73cc687 fix(core): handle cases where classes added have no animations (#63242)
In the case that someone wants to disable animations via selector specificity, for example by adding an `.animate-disabled` class to a parent node, we need to make sure the animate instructions don't misbehave. Now we detect if animations exist in the provided classes and react accordingly.

fixes: #63161

PR Close #63242
2025-08-20 08:59:03 +00:00
Joey Perrott
38b9b79c29 build: move from using WORKSPACE to MODULE.bazel (#63249)
Update to use MODULE.bazel

PR Close #63249
2025-08-20 08:27:00 +00:00
cexbrayat
1edb83c019 docs: animationsEnabled defaults to false (#63262)
PR Close #63262
2025-08-20 08:25:26 +00:00
Julien Zapata Duque
52106fb71b docs: use correct closing quote in input and model import usage notes (#63237)
PR Close #63237
2025-08-19 12:33:24 +00:00
Shuaib Hasan Akib
8164b2298e refactor(core): update NG0303 error message (#63222)
Ensure consistency in error message wording by aligning the NG0303
error with other Angular error strings. This improves clarity and
maintains a uniform developer experience

PR Close #63222
2025-08-19 08:25:50 +00:00
Matthieu Riegler
0da66e6d43 docs(docs-infra): lift circular imports (#63186)
This commit also adds adev on the cyclic import check.

PR Close #63186
2025-08-19 07:58:47 +00:00
Jessica Janiuk
7b51728813 fix(compiler): fixes animation event host bindings not firing (#63217)
Host bindings for `(animate.enter)` and `(animate.leave)` were not firing properly. This fixes the compiler ingest to make sure they do fire.

fixes: #63199

PR Close #63217
2025-08-18 15:56:49 +00:00
Joey Perrott
87523e90bc build: update the failure message with the correct command (#63219)
Update the failure message for compliance tests to use the correct command for updating the goldens

PR Close #63219
2025-08-18 15:08:57 +00:00
Jessica Janiuk
bdc31675b7 fix(core): ensure animate events do not have duplicate elements (#63216)
This applies the same fix that fixed the class version to the event binding version. It prevents duplicate elements from being on screen when animations have been toggled too fast.

fixes: #63127

PR Close #63216
2025-08-18 12:42:17 +00:00
Angular Robot
c714426963 build: lock file maintenance (#63210)
See associated pull request for more information.

PR Close #63210
2025-08-18 12:51:22 +02:00
cexbrayat
af63b800ec refactor(core): improve animation instruction robustness and maintainability (#63163)
This commit extracts helper functions to reduce code duplication across animation instructions and adds early return when animations are disabled.

PR Close #63163
2025-08-18 12:49:18 +02:00
Angular Robot
124d44f130 build: update cross-repo angular dependencies (#63179)
See associated pull request for more information.

PR Close #63179
2025-08-15 11:41:02 +02:00
Kristiyan Kostadinov
19ed12c81e fix(compiler): error when ng-content fallback has translated children (#63156)
Fixes that the pipeline wasn't processing the fallback content of `ng-content` for i18n which resulted in a compiler error further down the line.

Fixes #63065.

PR Close #63156
2025-08-15 09:47:18 +02:00
Kristiyan Kostadinov
557e6fe6eb fix(compiler): incorrect source span for expression AST inside template attribute (#63175)
Similar fix as #63082, but for template attributes. The root cause is the same where we should be using `fullStart` instead of `start` in order to account for whitespaces being skipped.

Fixes #63157.

PR Close #63175
2025-08-15 09:44:36 +02:00
Angular Robot
c68a099ded build: update all non-major dependencies (#63129)
See associated pull request for more information.

PR Close #63129
2025-08-14 22:08:30 +02:00
Matthieu Riegler
8747f9ad55 docs: fix edit links for block/element api entries (#62766)
PR Close #62766
2025-08-14 13:03:01 +02:00
Joey Perrott
a6a2e38e5c build: update to bazel 7.6.0 (#63096)
Update to later version of bazel

PR Close #63096
2025-08-14 13:01:32 +02:00
Angular Robot
ced0357bf8 build: update cross-repo angular dependencies (#63137)
See associated pull request for more information.

PR Close #63137
2025-08-13 12:52:28 -07:00
Andrew Scott
d9f0e6b27c Revert "feat(platform-browser): Add IsolatedShadowDom encapsulation method (#62723)" (#63142)
This reverts commit d24d5742db. A
legitimate issue was raised in the original commit
(see d24d5742db (commitcomment-163853393))

PR Close #63142
2025-08-13 11:12:59 -07:00
Paul Gschwendtner
ada3c37338 refactor(compiler-cli): ensure JIT transforms with queries work with closure property renaming (#63123)
This map for the JIT transforms accidentally is property-renamed,
breaking the lookups below. This commit fixes this.

PR Close #63123
2025-08-12 13:24:10 -07:00
ivanwonder
c81e345e72 feat(language-service): support auto-import for attribute completions (#62797)
Add logic to provide code actions for auto-importing directives that
are out of scope.

PR Close #62797
2025-08-12 10:57:09 -07:00
Angular Robot
31df4d2fd1 build: update cross-repo angular dependencies (#63088)
See associated pull request for more information.

PR Close #63088
2025-08-12 09:53:15 -07:00
Alan Agius
6fb2b71489 build: use link: instead of file: (#63111)
When using `file:` renovate updates fails due to ` ERR_PNPM_LINKED_PKG_DIR_NOT_FOUND ` this is due to a different behaviour between `link:` amd `file:`. `link:` however will not fail when the directory does not exist.

PR Close #63111
2025-08-12 09:37:54 -07:00
Alan Agius
1a16fb7aa2 build: resolve pnpm workspace dependency on compiler-cli (#63105)
The `pnpm install` command was failing for the `packages/core/test/bundling` project with the error:
`ERR_PNPM_NO_MATCHING_VERSION No matching version found for @angular/compiler-cli@0.0.0-PLACEHOLDER`

This happenes only in renovate updates.

PR Close #63105
2025-08-12 10:02:00 +02:00
Alan Agius
0e1bd1b404 build: fix ERR_PNPM_LINKED_PKG_DIR_NOT_FOUND for typings tests (#63105)
During `pnpm install` in a monorepo setup, the `packages/zone.js/test/typings` project would fail with the error: `ERR_PNPM_LINKED_PKG_DIR_NOT_FOUND: Could not install from "/.../node_modules/typescript" as it does not exist.`

PR Close #63105
2025-08-12 10:02:00 +02:00
Alan Agius
4ab709460a build: remove redundant yarn.lock files (#63105)
These are now managed by pnpm.

PR Close #63105
2025-08-12 10:02:00 +02:00
Matthieu Riegler
b38c43bacc refactor(zone.js): remove unused jasmine globalerror monkey patching. (#63077)
This is for testing purposes for now. See discussion on the related issue.

fixes #63072

PR Close #63077
2025-08-11 16:41:12 -07:00