Commit graph

36863 commits

Author SHA1 Message Date
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
Angular Robot
1b324a2ca6 build: lock file maintenance
See associated pull request for more information.
2026-01-28 18:26:45 +00:00
Angular Robot
a4f6d407c2 build: update cypress-io/github-action action to v7
See associated pull request for more information.
2026-01-28 18:17:25 +00:00
Matthieu Riegler
611f6a49d1 docs: reword docs on standalone.
fixes #66773
2026-01-28 18:16:54 +00:00
Angular Robot
177234a6f7 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-01-28 18:16:27 +00:00
Angular Robot
bea4cb72d1 build: update dependency @actions/github to v8
See associated pull request for more information.
2026-01-28 17:56:06 +00:00
Alan Agius
4123ebf61e release: bump Angular DevTools version to 1.9.0 2026-01-28 10:52:59 +01:00
Leon Senft
01bfb83fc9 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.
2026-01-28 00:15:29 +00:00
Jaime Burgos
4448356313
test(common): enables zoneless change detection in tests
Adds `provideZonelessChangeDetection` to TestBed configurations in  `ngComponentOutlet` , `ngOptimizedImage` , `ngTemplateOutlet` and `ngPlural`.
2026-01-28 00:08:46 +00:00
Angular Robot
960de629ed build: update cross-repo angular dependencies
See associated pull request for more information.
2026-01-27 20:11:06 +00:00
Shuaib Hasan Akib
160a8b4be7 docs: fix wrong line highlights
Corrects incorrect line highlighting in code examples so the highlighted
lines match the intended sections being explained.
2026-01-26 23:56:42 +00:00
Andrew Scott
8a7cbd4668 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
2026-01-26 23:51:31 +00:00
Angular Robot
3e7808b39f build: update cross-repo angular dependencies
See associated pull request for more information.

Closes #66702 as a pr takeover
2026-01-26 23:51:05 +00:00
Andrew Scott
b51bab583d feat(router): Add partial ActivatedRouteSnapshot information to canMatch params
This commit adds partial `ActivatedRouteSnapshot` information as the
third parameter of the `canMatch` guard.

resolves #49309
2026-01-26 23:36:06 +00:00
Andrew Scott
57e80a5737 refactor(router): Add type for partial ActivatedRouteSnapshot for easier re-use
This adds a type for the partial `ActivatedRouteSnapshot` that includes
only information up to a point in the matching algorithm.
2026-01-26 23:36:06 +00:00
Andrew Scott
042e6d2616 refactor(router): extract snapshot creation to shared helper
extracts ActivatedRouteSnapshot creation to a shared helper method
2026-01-26 23:36:06 +00:00
Matthieu Riegler
899df39c7c docs(docs-infra): remove unused examples 2026-01-26 23:19:35 +00:00
Shuaib Hasan Akib
ceefceb004 docs: normalize spacing in animation example boxes
Simplifies box padding and removes default paragraph margins to ensure consistent spacing and alignment
in the animation examples.
2026-01-26 22:59:28 +00:00
SkyZeroZx
c921786260 docs: Updates form documentation (#66732)
Updates the form documentation to link to the API reference for the `form()` function.

Also removes unused `HttpClient` import from the async validation example.

PR Close #66732
2026-01-26 22:46:11 +00:00
SkyZeroZx
6e9da70b35 docs(docs-infra): Exempts more symbols from automatic linking (#66732)
Extends the list of symbols that should not be
automatically linked for forms.

PR Close #66732
2026-01-26 22:46:11 +00:00
Shuaib Hasan Akib
8efee1c71d docs: apply prefer/avoid blocks in UI with comments
Apply inline comments with proper Prefer and Avoid UI blocks so
guidance is more visible and consistent across the documentation.
2026-01-26 22:33:11 +00:00
Matthieu Riegler
87a72f3dd0 docs: add mentions of the global target syntax. 2026-01-26 22:31:11 +00:00
Georgi Serev
9625780259
docs(docs-infra): update the look of api items state labels
Update how dev preview, experimental and deprecated labels are visualized in the API list to avoid ambiguity with the current design on larger screens.
2026-01-26 22:30:19 +00:00
Andrew Scott
dbd50be7f7 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 22:29:51 +00:00
Miles Malerba
fb05fc86d0
fix(forms): sort error summary by DOM order
This will allow users to rely on the `errorSummary` order to implement
features like "focus next error"
2026-01-26 22:29:07 +00:00
SkyZeroZx
1df564b9f9 refactor(core): remove index from text node creation
Removes unnecessary `index` parameter from `_locateOrCreateTextNode`
and `locateOrCreateTextNodeImpl` functions.
2026-01-26 22:22:56 +00:00
Shuaib Hasan Akib
ca9b5bd658 docs: fix wrong line highlight in lightweight injection token for API definition example 2026-01-26 22:22:00 +00:00
huangkevin-apr
b3f2bad593 docs(docs-infra): improve accessibility of search dialog trigger
- Add explicit aria-label for screen reader users
- Preserve title tooltip for mouse users
2026-01-26 22:21:36 +00:00