14712 Commits

Author SHA1 Message Date
Andrew Scott 42b43bd9ca docs(zone.js): update release and publish commands in DEVELOPER.md
(cherry picked from commit 98610aabaf)
2026-02-18 08:47:59 -08:00
Andrew Scott c320b507d8 docs(zone.js): update build command in DEVELOPER.md
(cherry picked from commit d99e336a03)
2026-02-18 08:47:59 -08:00
Andrew Scott f7acf7f51e docs(zone.js): update instructions to use pnpm
(cherry picked from commit c2f7eaa833)
2026-02-18 08:47:58 -08:00
SkyZeroZx 7e8b0474c3 refactor(forms): simplify destroy subject handling
Remove unnecessary conditional check when completing the destroy subject, since it is always defined

(cherry picked from commit fd956f675a)
2026-02-18 07:12:07 -08:00
SkyZeroZx 7f5a7289d0 refactor(compiler-cli): update updateImportClause away from deprecated signature
Updates the `updateImportClause` call to use the non-deprecated signature.
Also update test `new Buffer` to `Buffer.from`

(cherry picked from commit e45a7fe734)
2026-02-17 12:56:08 -08:00
Andrew Scott 9c1ec6c93e fix(zone.js): support passthrough of Promise.try API
When Zone patches Promise, it uses ZoneAwarePromise. The new Promise.try API was undefined on ZoneAwarePromise, making it unavailable when zone was present. This change gracefully passes through Promise.try to the native Promise implementation, if available, without patching it to execute in the right zone (our stance is not to add new patches but avoid destructively making new APIs unavailable).

Fixes #67057

(cherry picked from commit fc557f0276)
2026-02-17 11:32:53 -08:00
Rajveer 58eba77b7f refactor(core): remove outdated TODO comments referencing TypeScript 2.1
Angular requires TypeScript >=5.9, making TODO comments that reference TypeScript 2.1 features obsolete. These comments existed in keyvalue_differs.ts and ng_for_of.ts and referenced type improvements that were deferred until TS 2.1, which has long since been surpassed.

(cherry picked from commit a8aab64809)
2026-02-17 08:49:38 -08:00
Andrew Scott a3588a0e1f refactor(compiler-cli): Add skeleton tests around source->source compiler transform mode
adds skeleton and tests for source->source compiler transform.

(cherry picked from commit 815e1a03a9)
2026-02-13 16:48:17 -08:00
SkyZeroZx 23c0858e67 refactor(compiler-cli): use phaseModifier for type-only import detection
The `isTypeOnly` property was deprecated in TypeScript and replaced by `phaseModifier`.

Updates the check to use `phaseModifier`, which is the recommended API for detecting type-only imports.

Additionally, removes the unused `metadata` parameter from the `NgModuleExtractor`

(cherry picked from commit e10a63453d)
2026-02-13 17:42:52 +00:00
Matthieu Riegler 9c3022d053 refactor(platform-server): split zone/zoneless tests.
The Zone tests are a subset of tests that we still using the Zone CD provider.

(cherry picked from commit 08ea105aa3)
2026-02-13 17:41:14 +00:00
SkyZeroZx 55b501a8f8 refactor(common): improve image directive typings
Add image directive typings to improve type safety and removes an unused parameter from the observer registration.

(cherry picked from commit ddfc833df9)
2026-02-13 00:51:54 +00:00
Matthieu Riegler cb5eb2fde1 refactor(language-service): split tests into multiple targets
The helps with fighting flakiness
2026-02-12 16:40:21 -08:00
Angular Robot 7150df2f11 build: update cross-repo angular dependencies to v21.1.4
See associated pull request for more information.
2026-02-11 14:43:26 -08:00
Matthieu Riegler c514c78d38 build: add node type for api extraction
Without this the node types are `any`.

fixes #67027

(cherry picked from commit 7b5bcbf401)
2026-02-11 21:58:01 +00:00
Matt Lewis 2b99eaa019 fix(core): capture animation dependencies eagerly to avoid destroyed injector
Animation runner functions (runEnterAnimation, runLeaveAnimations,
runLeaveAnimationFunction) execute asynchronously from the animation
queue via afterNextRender. By that time the lView injector may have
been destroyed, causing lView[INJECTOR].get(NgZone) to throw NG0205.

Move the NgZone and MAX_ANIMATION_TIMEOUT lookups into the setup
instructions (ɵɵanimateEnter, ɵɵanimateLeave, ɵɵanimateLeaveListener)
which run synchronously during template processing when the injector
is guaranteed to be valid, and pass them through the closures.

(cherry picked from commit bd2868e915)
2026-02-10 13:31:27 -08:00
Matthieu Riegler d9ec23e46b test: add test about mapped attributes to input
The dynamic component has `[value]` in its selector and this has always been reflected as a DOM attribute on the dynamically created host element, which is now also synced into the component instance.

fixes #60157

(cherry picked from commit e229328b39)
2026-02-10 13:29:35 -08:00
SkyZeroZx 2c3f3cc336 refactor(forms): use optional chaining for safer method calls in form directives
Simplifies null checks by leveraging optional chaining when invoking
optional callbacks

(cherry picked from commit 8b3b069be7)
2026-02-10 07:43:02 -08:00
SkyZeroZx ae3c8fbc38 refactor(compiler-cli): removes reflector parameter from wrapTypeReference
The `wrapTypeReference` function no longer needs the `reflector` because it only uses the `clazz` parameter to create a `WrappedNodeExpr`.

(cherry picked from commit e7fa177923)
2026-02-10 07:42:29 -08:00
Matthieu Riegler 6c14e3af2e build: update Jasmine to 6.0.0
Jasmine enables `forbidDuplicateNames: true` by default. So we also need to desambiguate duplicate spec names.
2026-02-09 15:57:12 -08:00
Jaime Burgos 19542a30b1 test(common): remove zone-based testing utilities
Removes usages of zone-based helpers such as `fakeAsync` , `tick`
`waitForAsync` as part of the migration to zoneless tests.

Completes the transition to zoneless.

(cherry picked from commit c6d7500203)
2026-02-09 14:47:40 -08:00
Jessica Janiuk d6aeac504c fix(core): Fix flakey test due to document injection
This fixes the test issues with the transfer state by using the DOCUMENT from src/document.

(cherry picked from commit e53c8abaf9)
2026-02-09 14:16:29 -08:00
SkyZeroZx 3905015ccc fix(http): correctly parse ArrayBuffer and Blob in transfer cache
Encodes arraybuffer and blob response bodies as base64 when storing in the transfer cache, ensuring correct retrieval and usage on the client side.

Fixes #66827

(cherry picked from commit cb1163e5e5)
2026-02-09 12:32:17 -08:00
SkyZeroZx 6f5c233f1d refactor(common): extract argument assertion
Deduplicates string argument validation logic across pipes
by introducing a local assertion helper

(cherry picked from commit 66e8385b6a)
2026-02-09 12:26:10 -08:00
Kristiyan Kostadinov caab23dfe6 fix(compiler): add geolocation element to schema
A new `geolocation` tag was recently added to Chrome. These changes update the schema to account for it.

See https://developer.chrome.com/blog/geolocation-html-element

(cherry picked from commit 11834a4274)
2026-02-09 12:25:41 -08:00
Andrew Kushnir e3729c6327 Revert "refactor(service-worker): remove zone-based testing utilities"
This reverts commit 12b770dd3e.
2026-02-09 10:46:38 -08:00
Matthieu Riegler c298694a79 refactor(benchpress): remove zone-based testing utilities
Transition to zoneless.

(cherry picked from commit 4b3b149ba1)
2026-02-09 07:55:17 -08:00
Matthieu Riegler 12b770dd3e refactor(service-worker): remove zone-based testing utilities
Transition to zoneless.

(cherry picked from commit ec26d38778)
2026-02-09 07:55:17 -08:00
Matthieu Riegler 3f0fbaa0bc refactor(compiler): remove zone-based testing utilities
Having zone.js here already wasn't necessary.

(cherry picked from commit a1441a432d)
2026-02-09 07:55:16 -08:00
Shuaib Hasan Akib 4311ba7290 refactor(common): remove unused imports and standalone: false from examples
Cleans up example code by removing explicit `standalone: false`, since
standalone components are the default and recommended approach.

(cherry picked from commit 14f16226aa)
2026-02-09 07:53:37 -08:00
Kristiyan Kostadinov c633697262 Revert "fix(compiler-cli): update diagnostic to flag no-op arrow functions in listeners"
This reverts commit a78a7f651a.
2026-02-06 11:13:02 -08:00
SkyZeroZx 0d1acd0165 feat(forms): support signal-based schemas in validateStandardSchema
Allow `validateStandardSchema()` to consume a computed schema so
validation rules stay in sync when the schema changes over time.

This supports schemas stored in computed signals (e.g. zod schemas that
depend on input signals) and ensures the effective schema updates after
initialization instead of being captured once.

Fixes #66867

(cherry picked from commit 24c0c5a180)
2026-02-06 07:40:51 -08:00
Kristiyan Kostadinov a78a7f651a fix(compiler-cli): update diagnostic to flag no-op arrow functions in listeners
Based on the discussion in #66294: now that we support arrow functions in event listeners, developers may write out something like `(click)="() => expr"` which will be a no-op. These changes update the existing diagnostic for uninvoked expressions in listeners to account for it.

(cherry picked from commit 2ea6dfc6c9)
2026-02-06 07:39:22 -08:00
Charles Lyding f279f414ca refactor(language-service): use type-only TypeScript imports in some files
Standardize on `import type ts from 'typescript'` across several files
in the language-service package.

This ensures that these files do not have a runtime dependency on a
specific version of the TypeScript module, instead relying on the
instance provided by the host during initialization.

Note: This change is not comprehensive. Several files still require
runtime access to the TypeScript module and will require further
refactoring to fully decouple the dependency.

(cherry picked from commit 108252bf67)
2026-02-06 07:38:53 -08:00
SkyZeroZx 0729181d34 test(compiler): remove zone-based testing utilities
Removes usages of zone-based helpers such as
`waitForAsync` as part of the migration to zoneless tests.

Completes the transition to zoneless.

(cherry picked from commit 2a0241a665)
2026-02-05 16:56:59 -08:00
Angular Robot 52745a23e5 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-02-05 16:53:25 -08:00
SkyZeroZx 1bf6bfc07f test(forms): remove zone-based testing utilities
Removes usages of zone-based helpers such as `fakeAsync` , `tick`
`waitForAsync` as part of the migration to zoneless tests.

Completes the transition to zoneless.

(cherry picked from commit 7dfbacbcf8)
2026-02-04 15:38:13 -08:00
Kristiyan Kostadinov 04d518bc26 refactor(forms): work around internal issue
Works around an internal property renaming issue by changing how we declare the interface for `InteropNgControl`.

(cherry picked from commit 680d99b1c3)
2026-02-04 14:25:48 -08:00
David Neil 2cf4da0ea1 fix(core): hold constructors weakly in DepsTracker cache
Otherwise a component can be held in memory longer than
the component constructor is reachable from application code.

(cherry picked from commit cab5ddd526)
2026-02-03 12:44:27 -08:00
Matthieu Riegler f15d33d68b docs(docs-infra): extract call signature return type.
fixes #66799

(cherry picked from commit 43d61ecbb2)
2026-02-03 12:31:40 -08:00
David Neil 49a36f4cc7 perf(router): Use .bind to avoid holding other closures in memory
In many JS runtimes all closures created in the same scope share a context
this means that data held in one of the closures is not collected until all of the closures are collected.
This change prevents the returned promise from holding a reaction that holds the entire `Router` object in memory.

(cherry picked from commit 3867cd8554)
2026-02-03 12:25:02 -08:00
Alex Rickabaugh 2b254bc050 fix(core): linkedSignal.update should propagate errors
Unlike a normal `signal()`, a `linkedSignal()` can be in an error state when
its computation fails. Currently, there's a bug where `linkedSignal.update`
does not account for this error state, and will pass the internal `ERRORED`
`Symbol` as the current value to the updater function.

This commit fixes the issue by having `update()` check and throw the error
instead of calling the updater function.

(cherry picked from commit aff9e36a98)
2026-02-02 12:21:36 -08:00
Kristiyan Kostadinov e5110b4fa1 fix(core): export DirectiveWithBindings
Exports the `DirectiveWithBindings` interface since it's part of the public API of `createComponent`.

Fixes #66851.

(cherry picked from commit 8ab433abdd)
2026-02-02 11:08:45 -08:00
SkyZeroZx bbd5cf82b1 test(forms): migrate reactive forms and value accessors to zoneless
Migrates reactive forms, template-driven forms, and value accessors to zoneless tests.

(cherry picked from commit 4aae3379c2)
2026-02-02 10:17:03 -08:00
SkyZeroZx 6f75b6e3f6 fix(forms): Resolves debounce promise on abort in debounceForDuration
Ensures the promise returned by the debouncer resolves
when aborted, preventing potential hangs for awaiting consumers.
Fixes #66646

(cherry picked from commit b1bf535f8e)
2026-01-30 09:19:47 -08:00
Charles Lyding efb64bf9fd build(language-service): remove local development build script
The standalone build.sh script for the language service is no longer
required as the vscode-ng-language-service repository has been merged
into this monorepo. Local development and testing of the extension
can now be handled via the integrated build system.

(cherry picked from commit f9bcccc2b9)
2026-01-29 13:16:53 -08:00
Matthieu Riegler e0a260a425 docs(docs-infra): wrap getTextOfJSDocComment
This commits adds a wrapper around `ts.getTextOfJSDocComment` because of bugs that won't be fixed by the TS team (see microsoft/TypeScript#63027)

(cherry picked from commit 72dfb4d92a)
2026-01-29 13:16:05 -08:00
Jessica Janiuk 70a5b651be fix(core): prevent element duplication with dynamic components
When dynamic components are rapidly added and removed with animate.leave and animate.enter, a leave animation might fire before the enter animation could, causing an element to be retained. This fix prevents that from occuring by clearing the enter animations in this case.

fixes: #66794
(cherry picked from commit c66a19f0de)
2026-01-29 12:18:05 -08:00
Charles Lyding 4c7126d23b fix(localize): add support for unit-test builder in ng-add schematic
This commit updates the @angular/localize ng-add schematic to support
the @angular/build:unit-test builder. It ensures that @angular/localize
is added to the types array in the TypeScript configuration file
associated with the unit-test target. If no tsConfig is specified in
the target options, it defaults to tsconfig.spec.json in the project root.

(cherry picked from commit 1c3b1cf18d)
2026-01-29 12:17:19 -08:00
Andrew Scott d6268c0bbb fix(router): limit UrlParser recursion depth to prevent stack overflow
Deeply nested parentheses in URLs (e.g. `(a/(b/(c...)))`) trigger recursive calls in `UrlParser`, which can lead to a `RangeError: Maximum call stack size exceeded`. While such errors are generally caught by the framework, relying on the runtime's stack limit is unpredictable across different environments and engine states (e.g. varying stack sizes in different browsers or Node.js versions).

The deeply nested parentheses  can cause a stack overflow. While such URLs can be valid (e.g., `(a/(b/(c...)))`) and serialize to simple paths (e.g., /a/b/c), excessive nesting is unreasonable and likely malicious or accidental.

Linear paths (e.g. /a/b/c/d) are parsed iteratively and do NOT trigger recursion. Only parentheses trigger recursion.

This commit introduces a recursion depth limit of 50. If parsing exceeds this depth, the router will now throw a specific `UNPARSABLE_URL` error with the message "URL is too deep". This ensures a deterministic failure mode that is easier for applications to handle than a crash or generic RangeError.

The limit of 50 is chosen as it should accommodate any reasonable application URL structure (including complex named outlets) while providing a safe upper bound against abusive payloads.

This is essentially a refactor of the error state:

* Before: RangeError (System says "I'm out of stack memory")
* After: RuntimeError (Validator says "Input is invalid")

This provides:

* Semantic Correctness: The error now correctly blames the input ("URL too deep"), not the environment ("Stack full").
* Cross-Platform Consistency: The limit is the same in Chrome, Firefox, Node, and Deno, regardless of their internal recursion limits.
* Fast Failure: We stop at depth 50 instead of depth ~15,000, saving those cycles (though CPU cost is negligible either way).

"wide" URLs are now theoretically more expensive than "deep" URLs (because deep ones fail fast), but both are well within safe bounds for any reasonable input size.

(cherry picked from commit 458bc4a2c8)
2026-01-29 12:15:25 -08:00
SkyZeroZx 0a4c647ef0 refactor(core): Remove unsued properties in differ factories
Simplifies differ factories by removing unnecessary constructors and properties.

Also removes the formatError function as it is no longer used.

(cherry picked from commit 0c2efc0d46)
2026-01-29 12:06:37 -08:00