14722 Commits

Author SHA1 Message Date
SkyZeroZx 89e86616d9 refactor(common): log a warning when a KeyValuePipe receives a signal
Add signal warning for `KeyValuePipe` and consolidates the `invalidPipeArgumentError` function into a `utils`

(cherry picked from commit 97ed3d9e85)
2026-02-25 16:11:33 +00:00
Doug Parker b858309532 fix(core): block creation of sensitive URI attributes from ICU messages
Translators are not allowed to write HTML which creates URI attributes. I opted to ban any values going into an attribute at all, to prevent even links to malicious content, rather than just sanitizing URIs.

I also converted this blocklist into an allowlist. Now, we only allowing setting known attributes (while sanitizing URI attributes). This significantly reduces risk of missing a vulnerable attribute and does not require an exhaustive list of all potential attributes.

BREAKING CHANGE: Angular now only applies known attributes from HTML in translated ICU content. Unknown attributes are dropped and not rendered.

(cherry picked from commit 306f367899)
2026-02-24 18:50:40 +00:00
Shuaib Hasan Akib a8dcb28d5c refactor(core): remove outdated TODO comments
Cleans up TODO comments that are no longer planned

Fixes #67191

(cherry picked from commit 5ac1c025f9)
2026-02-23 18:19:57 +00:00
SkyZeroZx 31d3d56496 fix(common): fix LCP image detection with duplicate URLs
Addresses an issue where the LCP image observer incorrectly identified LCP elements when the same image URL was used multiple times on a page

Fixes #53278

(cherry picked from commit 38749698d0)
2026-02-20 21:23:27 +00:00
Ben Hong 866da08c18 docs: add new debugging and troubleshooting di guide
(cherry picked from commit 13e019a1bb)
2026-02-20 18:01:15 +00:00
splincode c143de2771 refactor(compiler-cli): improve diagnostic with help link
Add help link to extended template diagnostic messages to provide
users with additional guidance and documentation resources. This
enhancement improves developer experience by making it easier to
understand and resolve complex template issues through direct
access to relevant Angular documentation with detailed examples
and explanations for each diagnostic type.

(cherry picked from commit 66b472e2bc)
2026-02-20 17:40:21 +00:00
Matthieu Riegler 3b64e7dd27 refactor(common): log a warning when a JsonPipe receives a signal
The JsonPipe does not unwrap signals and `JSON.stringify` will return `undefined` for signals.
To avoid confusion, we log a warning when a signal is passed to the pipe.

(cherry picked from commit 0d652ba4da)
2026-02-20 17:17:05 +00:00
SkyZeroZx 24b578ce90 fix(compiler-cli): detect uninvoked functions in defer trigger expressions
Wrap `@defer` trigger expressions (`when`, `prefetch when`, `hydrate when`)
in a conditional context within the TCB to enable TypeScript's TS2774
diagnostic for detecting functions used without invocation.

Previously, signals and functions passed to `when` triggers without
parentheses would silently evaluate to truthy, causing unexpected behavior.
Now the compiler reports an error when a function is used as a condition
without being called.

(cherry picked from commit f90e5565e0)
2026-02-20 16:57:07 +00:00
Matthieu Riegler c1c310c4a9 docs(docs-infra): remove toString from the API docs
(cherry picked from commit fc8140cff4)
2026-02-20 16:52:00 +00:00
Andrew Scott 5eb47cc126 release: cut the zone.js-0.16.1 release
(cherry picked from commit ac8b5ff938)
2026-02-18 16:26:39 -08:00
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