Commit graph

36290 commits

Author SHA1 Message Date
kirjs
3937afc316 feat(forms): introduce SignalFormControl for Reactive Forms compatibility
This commit introduces `SignalFormControl`, a bridge implementation that allows Signal-based forms to interoperate with existing Reactive Forms infrastructure. It extends `AbstractControl` with standard methods and reactive observables while handling state propagation to parent containers.
2026-02-02 14:51:40 -08:00
Shahar Har-Shuv
f29fcd882a docs: Rename Field directive -> FormField in form-logic.md 2026-02-02 14:40:59 -08:00
Angular Robot
50af8cbd15 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-02-02 14:40:31 -08:00
Alex Rickabaugh
aff9e36a98 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.
2026-02-02 12:21:28 -08:00
Kristiyan Kostadinov
8ab433abdd fix(core): export DirectiveWithBindings
Exports the `DirectiveWithBindings` interface since it's part of the public API of `createComponent`.

Fixes #66851.
2026-02-02 11:08:42 -08:00
SkyZeroZx
9505541d32 feat(router): adds browserUrl input support to router links
Enables specifying a custom browser URL for router links via a new input,
allowing navigation to use an explicit browser URL in navigation options.

Closes #66805
2026-02-02 11:08:18 -08:00
SkyZeroZx
70615117a2 feat(docs-infra): Implements select component using Angular Aria
Replaces the native select element with a custom combobox implementation for improved accessibility and styling.
2026-02-02 11:07:53 -08:00
Charles Lyding
1fa7879cfd refactor(language-service): delegate plugin initialization to bundle
Updates the plugin factory to directly invoke the 'initialize' function from the
Angular Language Service bundle. This replaces manual proxying and lazy-loading
logic with direct delegation, unifying the instantiation process within the bundle.
2026-02-02 11:07:06 -08:00
AleksanderBodurri
35046d3dba feat(devtools): promote router tree to stable
Previous the router tree was an opt-in feature that required manual enablement in settings.

Now the router tree is enabled by default whenever the application supports it and routes are detected.
2026-02-02 11:06:42 -08:00
SkyZeroZx
cdbb957334 docs(docs-infra): Fix border color issue on aria select when closing on outside click
Prevents incorrect border color from appearing on close triggered by an outside click
2026-02-02 11:04:44 -08:00
dominicbachmann
a64a90dbbe docs(animations): fix small typo in animations migrations docs 2026-02-02 10:18:05 -08:00
Jaime Burgos
bd27aa2cf3
docs: remove component suffix router guide 2026-02-02 10:17:36 -08:00
SkyZeroZx
4aae3379c2 test(forms): migrate reactive forms and value accessors to zoneless
Migrates reactive forms, template-driven forms, and value accessors to zoneless tests.
2026-02-02 10:16:58 -08:00
SkyZeroZx
825122b6d2 docs: update llms.txt 2026-02-02 10:14:03 -08:00
kirjs
19aa1eb95e docs: rename agents.md to AGENTS.md 2026-02-02 10:10:41 -08:00
kirjs
a8d0155303 docs: add PR section to agents.md 2026-02-02 10:10:41 -08:00
kirjs
9306abe883 docs: add agent configuration guide
Adds agents.md to the root directory to provide context and instructions for AI agents working in this repository.
2026-02-02 10:10:41 -08:00
SkyZeroZx
522c5ba868 docs(docs-infra): ensure code preview copy preserves spaces
Preserve whitespace when copying code examples from the docs. Fixes the copy handler so copied snippets keep original spacing.

Fixes #66790
2026-02-02 10:09:35 -08:00
Jaime Burgos
3d09d8e831
docs: update zoneless guide 2026-02-02 10:05:22 -08:00
Andrew Scott
8d5210c9fe feat(core): add ChangeDetectionStrategy.Eager alias for Default
Adds `ChangeDetectionStrategy.Eager` as an explicit alias for `ChangeDetectionStrategy.Default`. This improves readability when contrasting with `OnPush`, clarifying that the component will be checked eagerly when traversal reaches it.

Compiler findings:
- The compiler resolves `ChangeDetectionStrategy` enum members by value in `resolveEnumValue` (see `packages/compiler-cli/src/ngtsc/annotations/common/src/evaluation.ts`).
- Since `Eager` has usage value `1` (same as `Default`), it is correctly interpreted during static analysis.
- At runtime, `defineComponent` (in `packages/core/src/render3/definition.ts`) checks `changeDetection === ChangeDetectionStrategy.OnPush` (0). Any other value, including `1` (Eager/Default), results in eager checking behavior (`onPush: false`).
2026-01-30 14:20:52 -08:00
Charles Lyding
496967e7b1 feat(language-service): add JSON schema for angularCompilerOptions
This commit introduces a JSON schema for angularCompilerOptions in the
Angular Language Service extension. It provides validation and autocompletion
for Angular-specific options in tsconfig.json files.
2026-01-30 14:20:25 -08:00
Angular Robot
424ecf840d build: update dependency @actions/core to v3
See associated pull request for more information.
2026-01-30 09:34:15 -08:00
Leon Senft
9a3d5b36c2 docs(forms): fix incorrect import statement
Correct the import statement used to import `NG_STATUS_CLASSES` in the
migration guide.
2026-01-30 09:30:45 -08:00
Leon Senft
346ceb7dc0 docs: fix typos
Fix typos introduced in some recent changes.
2026-01-30 09:30:45 -08:00
SkyZeroZx
b1bf535f8e 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
2026-01-30 09:19:42 -08:00
Leon Senft
26d12158e1
refactor(forms): convert FieldState.controlValue to a WritableSignal
Remove `setControlValue()` from `FieldState` and convert `controlValue` to a
`WritableSignal` whose setter implements the debounced syncing behavior
of `setControlValue()`.
2026-01-30 09:14:14 -08:00
Angular Robot
af76b9dd4d build: update dependency @actions/github to v9
See associated pull request for more information.
2026-01-30 09:04:12 -08:00
Charles Lyding
b327d72ed2 refactor(language-service): initial use of type-only imports and standard server types
This commit converts the typescript import in api.ts to a type-only import
and updates the plugin factory to utilize standard TypeScript server types.
Internal interfaces and specific service types are replaced with general
types to decouple the factory wrapper from internal implementations.
2026-01-29 16:06:17 -08:00
Angular Robot
74e7681142 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-01-29 13:32:54 -08:00
Alex Rickabaugh
a67e00741c refactor(forms): move control logic into FormField directive
Refactors the `ɵɵcontrolCreate` and `ɵɵcontrol` instructions to delegate control logic to the forms package via new `ɵngControlCreate` and `ɵngControlUpdate` lifecycle hooks. Previously, the logic for binding form state to native elements and custom controls was hardcoded within `@angular/core`.

**Compiler Changes:**
- Introduces a new compilation phase `specializeControlProperties` (in `control_directives.ts`).
- This phase detects properties named `formField` and specializes them into `ControlCreate` and `Control` IR opcodes.
- These opcodes emit `ɵɵcontrolCreate` and `ɵɵcontrol` instructions, respectively.

**Runtime Changes:**
- `ɵɵcontrolCreate` acts as the creation phase. It locates the control directive and invokes its `ɵngControlCreate` method.
- `ɵɵcontrol` acts as the update phase, and invokes the control directive's `ɵngControlUpdate` method (if present).
- Introduces a `passThroughInput` configuration in `ControlFeature`. This specifies the input name (e.g., `formField`) that triggers the control. If the runtime detects that this input is bound to multiple targets (e.g., the `FormField` directive *and* the host component), the control is flagged as "pass-through". In this state, `ɵngControlCreate` returns a no-op update function, deferring responsibility to the other consumer (e.g., the component managing the field itself).

**Forms Changes:**
- `FormField` directive implements `ɵngControlCreate` and `ɵngControlUpdate`.
- Inside this hook, `FormField` determines the type of control it is attached to (Native, CVA, or Custom Signal Control) and delegates to the appropriate handler (`nativeControlCreate`, `cvaControlCreate`, or `customControlCreate`).
- Consolidates all form binding logic within `@angular/forms/signals`, enabling support for new `FormValueControl` and `FormCheckboxControl` interfaces.
- Reorganizes the codebase by moving `FormField` from `api/` to `directive/` and splitting the binding logic into semantic pieces:
    - `control_native.ts`, `control_cva.ts`, and `control_custom.ts` contain the specific handlers for each control type.
    - `native.ts` and `select.ts` provide helpers for native element discovery and select-specific synchronization.
    - `bindings.ts` manages the tracking and application of property/attribute bindings.
2026-01-29 13:17:40 -08:00
Alex Rickabaugh
88e6ebec01 refactor(forms): move standard schema types out of shared files
Consolidating the standard schema support into `standard_schema.ts` will
cut down on unnecessary g3 patch changes whenever we change
`validation_errors.ts`.
2026-01-29 13:17:40 -08:00
Charles Lyding
f9bcccc2b9 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.
2026-01-29 13:16:49 -08:00
Matthieu Riegler
72dfb4d92a 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)
2026-01-29 13:16:00 -08:00
Shuaib Hasan Akib
6990f88d97 feat(docs-infra): increase table-of-contents width for large screens
Add media query overrides to expand the table-of-contents width on extra-large desktops.

fixes: #66823
2026-01-29 12:24:00 -08:00
Angular Robot
df3258cfc4 build: update all non-major dependencies
See associated pull request for more information.
2026-01-29 12:22:40 -08:00
Angular Robot
528ce58222 build: update bazel dependencies
See associated pull request for more information.
2026-01-29 12:22:00 -08:00
Jessica Janiuk
c66a19f0de 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
2026-01-29 12:18:00 -08:00
Charles Lyding
1c3b1cf18d 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.
2026-01-29 12:17:15 -08:00
Andrew Scott
458bc4a2c8 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.
2026-01-29 12:15:21 -08:00
Andrew Scott
907a94dcec feat(router): Update IsActiveMatchOptions APIs to accept a Partial
This updates `RouterLinkActive`, `Router.isActive`, and the standalone
`isActive` function to accept `Partial<IsActiveMatchOptions>` which uses
the current default values as the base (paths and queryParams are
subset, fragment and matrix params are ignored).

fixes #53326
2026-01-29 12:10:40 -08:00
Andrew Scott
cf9620f7d0 feat(router): Make match options optional in isActive
The behavior now matches RouterLinkActive.
2026-01-29 12:10:40 -08:00
SkyZeroZx
0c2efc0d46 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.
2026-01-29 12:06:32 -08:00
JakobDev
0e04233a7c docs: Add missing link in HostListener documentation 2026-01-29 11:56:42 -08:00
SkyZeroZx
d072791f13 refactor(core): remove unused restriction parameter
Removes the `restriction` parameter from `registerAppScopedDispatcher` and `registerGlobalDispatcher`.
2026-01-28 20:54:46 +00:00
Andrew Scott
5a6fefb687 release: cut the v21.2.0-next.1 release 2026-01-28 20:49:59 +00:00
Andrew Scott
571747d5cc docs: release notes for the v21.1.2 release 2026-01-28 20:39:31 +00:00
Charles Lyding
7bb241f7b6 refactor(language-service): introduce withFallback helper in ts_plugin
This commit refactors the `ts_plugin.ts` implementation to use a new `withFallback` helper function. This helper encapsulates the common logic of delegating requests to either the Angular language service directly (for non-TS files or when `angularOnly` is true) or trying the TypeScript language service first before falling back to the Angular language service.
2026-01-28 19:24:16 +00:00
Angular Robot
d7672cfceb build: update pnpm to v10.28.2
See associated pull request for more information.
2026-01-28 19:22:35 +00:00
Leon Senft
e682e53113 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
2026-01-28 18:56:02 +00:00
Georgi Serev
042471044d
refactor(devtools): snap to signal graph nodes selected from the properties panel
Snap to the signal graph node of a corresponding property when the user uses "Show 'prop' signal graph" button.
2026-01-28 18:33:37 +00:00