Commit graph

13921 commits

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

PR Close #63395
2025-08-27 16:13:08 -07:00
arturovt
eee3e5a4df 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:06 -07:00
arturovt
538de86a72 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:54 -07:00
Alexander Melde
3a3bd364d1 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
6489af7678 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
f0ee681ad7 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:57 -07:00
Joey Perrott
b4ae94d5ef 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
fa0f11f6e8 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
8e4b7e47f4 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
Andrew Scott
f86846555b fix(upgrade): Remove deprecated UpgradeAdapter (#61659)
Deprecated since v5. Use `upgrade/static` instead, which also supports aot.

BREAKING CHANGE: `UpgradeAdapter` is no longer available. Use
`upgrade/static` instead

PR Close #61659
2025-08-27 11:11:29 -07:00
Taygan Caldwell
a43057c059 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:32 -07:00
Jessica Janiuk
a0388409e3 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:07 -07:00
Joey Perrott
2fcafb65c5 build: rename defaults2.bzl to defaults.bzl (#63383)
Use defaults.bzl for the common macros

PR Close #63383
2025-08-25 15:45:01 -07:00
Angular Robot
fca6122d09 build: lock file maintenance (#63359)
See associated pull request for more information.

PR Close #63359
2025-08-25 15:35:54 -07:00
arturovt
1ebba5442f refactor(common): drop X-Request-URL (#61943)
This commit drops the `X-Request-URL` header. It was a non-standard HTTP response header, deprecated long ago and never part of any official specification. Modern browsers now expose the final URL via the `XMLHttpRequest.responseURL` property, as defined in the WHATWG spec.

PR Close #61943
2025-08-25 08:45:19 -07:00
Jessica Janiuk
9139fe0d95 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:30 -07:00
Jessica Janiuk
1e3196b0c9 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:31 -07:00
Joey Perrott
3df1dccebe refactor: various build and import specificer fixes for strict deps (#63323)
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 #63323
2025-08-22 14:45:00 -07:00
Jessica Janiuk
37ead5ffb5 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:15 -07:00
Jessica Janiuk
18c9352d21 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:15 -07:00
Matthieu Riegler
d16a992b12 refactor(core): remove the deprecated ImportedNgModuleProviders type. (#63277)
Use the `EnvironmentProviders` type instead

PR Close #63277
2025-08-22 11:22:22 -07:00
aparziale
7a336c159d refactor(migrations): centralize parseTemplate method (#62983)
refactor - Moved parseTemplate logic to a shared utility function to improve code reuse and maintainability

PR Close #62983
2025-08-21 11:41:32 -07:00
aparziale
6ddb250391 feat(migrations): add migration to convert ngClass to use class (#62983)
feat #61661 - add migration to convert ngClass to use class

PR Close #62983
2025-08-21 11:41:32 -07:00
Matthieu Riegler
0dd95c503f feat(forms): Add FormArrayDirective (#55880)
The `FormArrayDirective` will allow to have a `FormArray` as a top-level form object.

* `NgControlStatusGroup` directive will be applied to the `FormArrayDirective`
* `NgForm` will still create a `FormGroup`

Fixes angular#30264

BREAKING CHANGE: This new directive will conflict with existing FormArray directives or formArray inputs on the same element.

PR Close #55880
2025-08-21 09:38:37 -07:00
Matthieu Riegler
318718ce64 refactor(forms): extract shared logic from FormGroupDirective (#55880)
Ahead of the implementation of `FormArrayDirective`, extract the shared logic into an abstract class.

PR Close #55880
2025-08-21 09:38:37 -07:00
Matthieu Riegler
827c3c15f4 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
Matthieu Riegler
edbbbb1e44 refactor(core): remove NgProbeToken class (#63279)
This class served no purpose and was deprecated in by #51396

G3 also has no usage anymore.

PR Close #63279
2025-08-20 16:21:38 +00:00
Angular Robot
790143eb9b build: update cross-repo angular dependencies (#63284)
See associated pull request for more information.

PR Close #63284
2025-08-20 15:58:42 +00:00
Matthieu Riegler
d8bdf56145 refactor(core): remove deprecated PACKAGE_ROOT_URL token (#63274)
The symbol was deprecated by #51222 and already has no usages in g3.

PR Close #63274
2025-08-20 15:45:12 +00:00
Matthieu Riegler
239fe6f83e refactor(core): remove public symbol for defineInjectable (#63270)
This public symbol was deprecated in v8.
The private symbol `ɵɵdefineInjectable` remains available.

PR Close #63270
2025-08-20 15:44:14 +00:00
Matthieu Riegler
25f593ce2a refactor(common): removengModuleFactory input of NgComponentOutlet (#62838)
This was deprecated by #44815

BREAKING CHANGE: NgModuleFactory has been removed, use NgModule instead.

PR Close #62838
2025-08-20 13:27:18 +00:00
Kristiyan Kostadinov
7bf4906f27 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:43 +00:00
ivanwonder
eeeaadc7e9 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
6a6cb01bb3 docs: update NG_VALIDATORS examples to use forwardRef (#63247)
PR Close #63247
2025-08-20 09:27:20 +00:00
Jessica Janiuk
70afb41f8e 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
718bfd2fb7 build: move from using WORKSPACE to MODULE.bazel (#63246)
Update to use MODULE.bazel

PR Close #63246
2025-08-20 08:26:17 +00:00
cexbrayat
bf9db2897e docs: animationsEnabled defaults to false (#63262)
PR Close #63262
2025-08-20 08:25:26 +00:00
Julien Zapata Duque
72ae1064fe docs: use correct closing quote in input and model import usage notes (#63237)
PR Close #63237
2025-08-19 12:33:22 +00:00
Shuaib Hasan Akib
6712456847 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:49 +00:00
Matthieu Riegler
9b539a18ba 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:45 +00:00
Jessica Janiuk
cab3adfdd1 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
1aa0a8800c 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:56 +00:00
Jessica Janiuk
a7cfb42c03 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:16 +00:00
Angular Robot
032017174e build: lock file maintenance (#63209)
See associated pull request for more information.

PR Close #63209
2025-08-18 12:50:49 +02:00
cexbrayat
e9b2fe7ce5 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:17 +02:00
Alan Agius
d0d6079f54 refactor: remove version 20 migrations (#63207)
This commit remove the non optional migrations for version 20 as these have already been executed.

PR Close #63207
2025-08-18 09:06:51 +02:00
Angular Robot
47b09f8f18 build: update cross-repo angular dependencies (#63178)
See associated pull request for more information.

PR Close #63178
2025-08-15 11:40:20 +02:00
Kristiyan Kostadinov
5b3933f1ae 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:17 +02:00
Kristiyan Kostadinov
9ac638548f 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:35 +02:00
Angular Robot
d733c69ce9 build: update all non-major dependencies (#62935)
See associated pull request for more information.

PR Close #62935
2025-08-14 22:09:29 +02:00