14677 Commits

Author SHA1 Message Date
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
JakobDev b9b934363a docs: Add missing link in HostListener documentation
(cherry picked from commit 0e04233a7c)
2026-01-29 11:56:48 -08:00
SkyZeroZx cfe7340270 refactor(core): remove unused restriction parameter
Removes the `restriction` parameter from `registerAppScopedDispatcher` and `registerGlobalDispatcher`.

(cherry picked from commit d072791f13)
2026-01-28 20:54:49 +00:00
Angular Robot 290b2814e1 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-01-28 19:28:34 +00:00
Leon Senft 9f99b14882 fix(forms): only touch visible, interactive fields on submit
Don't touch hidden, disabled, or readonly fields on submit, since they
don't contribute to form validity. This also prevents errors from
appearing immediately if they're later made interactive.

Fix #66344

(cherry picked from commit e682e53113)
2026-01-28 18:56:06 +00:00
Matthieu Riegler 7242da24fb docs: reword docs on standalone.
fixes #66773

(cherry picked from commit 611f6a49d1)
2026-01-28 18:16:58 +00:00
Leon Senft 31e6f0d7dc test(forms): submit behavior while validation is pending
Ensure `submit()` behaves as expected while a form is pending.

- Submission is not blocked by pending validation.
- Submission errors prevent pending validation errors from appearing
  after they resolve on the same field.
- Submission errors don't prevent pending validation errors from
  appearing after they resolve on subfields.

(cherry picked from commit 01bfb83fc9)
2026-01-28 00:15:33 +00:00
Jaime Burgos 6601f06e44 test(common): enables zoneless change detection in tests
Adds `provideZonelessChangeDetection` to TestBed configurations in  `ngComponentOutlet` , `ngOptimizedImage` , `ngTemplateOutlet` and `ngPlural`.

(cherry picked from commit 4448356313)
2026-01-28 00:08:50 +00:00
Andrew Scott c57b0355b5 fix(language-service): Detect local project version on creation
This updates the language service to use the detected version of angular
core in the given project on load rather than the minimum detected
version in the workspace

(cherry picked from commit 8a7cbd4668)
2026-01-26 23:51:34 +00:00
Matthieu Riegler 06952b4f0f docs(docs-infra): remove unused examples
(cherry picked from commit 899df39c7c)
2026-01-26 23:19:39 +00:00
Matthieu Riegler 89525ec6b7 docs: add mentions of the global target syntax.
(cherry picked from commit 87a72f3dd0)
2026-01-26 22:31:14 +00:00
SkyZeroZx 359470979b refactor(core): remove index from text node creation
Removes unnecessary `index` parameter from `_locateOrCreateTextNode`
and `locateOrCreateTextNodeImpl` functions.

(cherry picked from commit 1df564b9f9)
2026-01-26 22:22:59 +00:00
SkyZeroZx 051ba061a0 refactor(core): improve tree-shaking
Refactors getNodeInjectable to avoid pulling in stringifyForError production builds, reducing unnecessary symbols in production bundles

(cherry picked from commit 8feb541060)
2026-01-26 22:19:00 +00:00
Andrew Scott 21ecdc036a fix(router): Do not intercept reload events with Navigation integration
This commit prevents the Router from intercepting reload navigations
in the navigate event listener. This would convert hard page reloads
to SPA navigations.

fixes #66746
2026-01-26 20:58:49 +00:00
SkyZeroZx e6ea328cf4 docs: update bootstrapApplication docs
(cherry picked from commit 85122cb12d)
2026-01-23 11:45:20 -08:00
Kristiyan Kostadinov c9043fb876 refactor(compiler-cli): remove deprecated signature usage
The signature for `createImportClause` was deprecated in TS 5.9. These changes switch to the non-deprecated one.

(cherry picked from commit dbc1452de3)
2026-01-22 21:02:42 +00:00
Angular Robot 643f0f4b22 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-01-21 12:43:47 -08:00
Matthieu Riegler 18842266de docs(docs-infra): Handle additional description format
Ex: https://angular.dev/api/router/withExperimentalPlatformNavigation
(cherry picked from commit f0b1061791)
2026-01-21 19:37:11 +00:00
Matthieu Riegler 223ff74891 build: don't substitute binary files
Previously, ng_package applied version stamping to all source files, which corrupted binary files like SQLite databases.

This change ignores text substitution for files passed to the `data` attribute, ensuring binary assets are preserved intact in the final package.

fixes #66637

(cherry picked from commit b885851cbe)
2026-01-21 18:35:08 +00:00
JoostK 0e1f1ed573 fix(compiler-cli): drop .tsx extension for generated relative imports
When synthesizing an import corresponding with a .tsx file, the extension
would not be removed unlike regular .ts files. Adjust the import generators
to also drop any .tsx extension from module specifiers.

Closes #66262

(cherry picked from commit d94b19a92f)
2026-01-21 18:33:17 +00:00
Shuaib Hasan Akib 62d847325d refactor(common): cleanup unused code in doc regions
Cleans unused imports and code
that is not referenced within the associated docregion blocks.

(cherry picked from commit 6284126da5)
2026-01-21 00:31:13 +00:00
Kristiyan Kostadinov ea70b003b0 refactor(compiler): remove unused symbols
Removes symbols that aren't used anymore from the identifiers map.

(cherry picked from commit e4c09776b0)
2026-01-21 00:14:19 +00:00
Leon Senft 26c2fe6db2 refactor(forms): remove unused API
Remove `SubmittedStatus` which is no longer used.

(cherry picked from commit d0ba332292)
2026-01-20 18:20:01 +00:00
Shuaib Hasan Akib 58720dbc56 refactor(forms): update Reactive Forms guide URL
Updates the Reactive Forms documentation link to the new `guide/forms/reactive-forms` path after the recent docs restructure.

(cherry picked from commit 4adbc4fa19)
2026-01-20 18:11:51 +00:00
Kristiyan Kostadinov 32ad1e09b4 build: move zone.js build off deprecated flag
The Zone.js build was depending on the `--outFile` flag from TypeScript which is deprecated. These changes switch to using `--outDir` and copying the files out of the directory instead.

(cherry picked from commit 52bc0208f9)
2026-01-16 17:28:50 +00:00
Miles Malerba cb75f9ce85 fix(forms): fix control value syncing on touch
Previously we were unconditionally setting the control value back into
the value, regardless of if it had actually been changed. This PR
changes the logic to flush the pending sync on touch if there is one, or
just skip it if there isn't.

(cherry picked from commit e7b2dde6d1)
2026-01-16 17:25:31 +00:00
Kristiyan Kostadinov ded654dc6b build: initial test of TypeScript 6
Resolves some initial test failures after updating to TypeScript 6.

(cherry picked from commit d9c980a958)
2026-01-15 21:41:05 +00:00
Kristiyan Kostadinov 05adfcf8f2 fix(core): handle Set in class bindings
Currently migrating from `[ngClass]` to `[class]` isn't entirely supported, because `[ngClass]` supports `Set` values while `[class]` ignores them.

These changes add a bit of logic to bring them closer together and make the migration easier.

(cherry picked from commit 4831a9f676)
2026-01-15 21:40:02 +00:00
Miles Malerba d89a80a970 feat(forms): Ability to manually register a form field binding in signal forms
This PR adds the ability to manually register a binding with the
`FormField` directive. This is useful for a lower-level implementation
that takes the field tree as an `input()` rather than relying on the
automatic binding from `FormUiControl`.

(cherry picked from commit 5974cd0afc)
2026-01-15 19:03:32 +00:00
Angular Robot ae4e2e02d0 build: update cross-repo angular dependencies to v21.1.0
See associated pull request for more information.
2026-01-14 15:05:15 -08:00
Matthieu Riegler 1ea5c97703 feat(forms): allow focusing bound control from field state
Allows focusing the assocated bound control from the `FieldState`.
2026-01-14 08:26:54 -08:00
Jessica Janiuk 134742fb7b Revert "refactor(core): remove ng when invoking enableProdMode"
This reverts commit cb5879f566.

(cherry picked from commit e673eb6df2)
2026-01-14 16:09:02 +00:00
Matthieu Riegler 9a764e0f5f refactor(core): remove ng when invoking enableProdMode
This was caught while investigating a leak.

(cherry picked from commit cb5879f566)
2026-01-13 19:39:53 +00:00
Jeremy Elbourn 114d03f6a6 docs: update OnChanges API reference w/ signal input
We had some reports of LLMs claiming that `ngOnChanges` does not include
changes for signal-based inputs. This is wrong (and the LLMs just made
it up), but we can update the docs at least to demonstrate `ngOnChanges`
with signal-based inputs.

Previously, the API reference used a real test as a code example, but
updating the test to a signal-based input is more involved than this
change needs to call for.

(cherry picked from commit 871fa1b2dd)
2026-01-13 17:04:28 +00:00
SkyZeroZx b1c68e66a7 docs: update examples to use isActive instead of deprecated Router.isActive (#66430)
PR Close #66430
2026-01-12 22:42:33 +00:00
Matthieu Riegler 532633301b fix(forms): Ensure the control instruction comes after the other bindings
Prior to this change, binding to radio value was sensitive to the order in which `value` & `formField` where binding in the template.
The compiler change makes that order non-important.

fixes #66402

(cherry picked from commit 65fa5b5439)
2026-01-12 21:49:23 +00:00