35853 Commits

Author SHA1 Message Date
Leon Senft 929306e658 test(forms): refactor and improve test coverage for invalid input
* Refactor test for `invalid` input to be consistent with other control
  properties
* Test that `invalid` inputs are reset when the field binding changes

(cherry picked from commit b563b5cfc2)
2026-01-02 08:09:39 +01:00
Leon Senft f0fb1d8581 fix(forms): allow custom controls to require hidden input
* Allow custom controls to make `hidden` a required input
* Refactor test for `hidden` input to be consistent with other control
  properties
* Test that `hidden` inputs are reset when the field binding changes

(cherry picked from commit 82edf18427)
2026-01-02 08:09:38 +01:00
Leon Senft 9748b0d5da fix(forms): support custom controls with non signal-based models
* Recognize directives with non signal-based models as valid custom controls
* Relax type checker to allow non signal-based models

The `FormValueControl` and `FormCheckboxControl` interfaces still
require a `model()`-input, however, a custom control need not implement
either interface to be bound by the `Field` directive.

All of the following examples can be used to define a custom control:

```ts
// Preferred: model()
class MyFormControl implements FormValueControl<string> {
  readonly value: model.required<string>();
}

// Supported: input() + output()
class MyFormControl {
  readonly value: input.required<string>();
  readonly valueChange: output<string>();
}

// Supported: @Input() + @Output()
class MyFormControl {
  @Input({required: true}) value!: string;
  @Output() valueChange: new EventEmitter<string>();
}
```

The latter two may still choose to implement `FormUiControl` for other
properties, but again it is not required.

Fix #65478

(cherry picked from commit cb09fb8308)
2026-01-02 08:09:07 +01:00
Leon Senft ab86c90c20 refactor(forms): always bind [field] to ControlValueAccessor if present
Change the order of precedence that `[field]` binds to from

  1. Custom control (`FormValueControl`, `FormCheckboxControl`)
  2. Interop control (`ControlValueAccessor`)
  3. Native control (`<input>`, `<select>`, `<textarea>`)

to

  1. Interop control (`ControlValueAccessor`)
  2. Custom control (`FormValueControl`, `FormCheckboxControl`)
  3. Native control (`<input>`, `<select>`, `<textarea>`)

This ensures that Reactive Forms controls authored to use
`ControlValueAccessor` work correctly with Signal Forms, even if they
happen to conform to the `FormValueControl` interface.

(cherry picked from commit 817e2b87a8)
2026-01-02 08:09:06 +01:00
SkyZeroZx ce7b1ab3b6 refactor(core): Add ngDevMode guards and new sanitization error codes
Adds new runtime sanitization error codes. Adds `ngDevMode` guards around
error message strings to ensure detailed diagnostics are included only
in development mode. This allows production builds to tree-shake verbose error descriptions, reducing bundle size.

(cherry picked from commit 4e7e38c591)
2026-01-02 08:08:25 +01:00
Angular Robot 069974a519 build: update dependency @angular/aria to v21.0.4
See associated pull request for more information.
2025-12-17 16:57:02 -08:00
Miles Malerba 59b3790031 refactor(forms): rename server errors to submission errors
This better reflects the intent to indicate an error during submission,
regardless of whether the error came from the server or not.

(cherry picked from commit 244b54c9bf)
2025-12-17 15:42:11 -08:00
Angular Robot 96dccc4e6f docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-12-17 15:40:54 -08:00
Andrew Seguin 0edbee4550 fix(core): explicitly cast signal node value to String
If the computed's `toString` is called and `node.value` is a Symbol, the browser will throw an exception `ERROR TypeError: Cannot convert a Symbol value to a string`

Symbols cannot be implicitly changed to strings. This change changes the conversion to be explicit by wrapping `node.value` with `String()`

This can be reproduced if you create a computed with `createComputed(computation, equal)` and call `toString()` while `node.value` is something like `Symbol(UNSET)`

(cherry picked from commit e2a9938c51)
2025-12-17 14:38:41 -08:00
Angular Robot a8127273a6 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-17 14:35:48 -08:00
Shuaib Hasan Akib 441d158302 docs(docs-infra): clean up TODO comment, unused imports, and helper function
(cherry picked from commit e9d1c6478a)
2025-12-17 14:34:02 -08:00
Shuaib Hasan Akib c8d14d75ba docs: fix incorrect line highlighting in tutorials
Ensures highlighted lines in tutorial examples match the
corresponding code shown to readers.

(cherry picked from commit ad88c72f24)
2025-12-17 14:26:34 -08:00
Miles Malerba ae0d707d44 docs: call out breaking changes as experimental
Explicitly calls out that recent breaking changes were only for
experimental features

(cherry picked from commit 5b06996fb2)
2025-12-17 14:25:36 -08:00
Andrew Scott eaa68c4cd7 release: bump VSCode extension version to 21.0.1 (#66153) vsix-21.0.1 2025-12-17 13:51:34 -08:00
Andrew Kushnir 85317f405a release: cut the v21.0.6 release v21.0.6 2025-12-17 13:12:23 -08:00
Alan Agius 8d7bcbc881 build: migrate Bazel ignore rules from .bazelignore to REPO.bazel
See: https://bazel.build/rules/lib/globals/repo and https://github.com/aspect-build/rules_js/blob/092dd7892b816f899c7ab5b794fdb6236abb6939/docs/pnpm.md?plain=1#L77
2025-12-17 10:14:32 -08:00
Andrew Scott 5047be4bc1 fix(language-service): Prevent language service from crashing on suggestion diagnostic errors
This prevents the language service from crashing when a
`FatalDiagnosticError` is thrown when retrieving suggestion diagnostics.

fixes #66069

(cherry picked from commit ce1a4769f9)
2025-12-17 10:13:15 -08:00
Angular Robot a27bdd3327 build: update bazel dependencies
See associated pull request for more information.
2025-12-17 10:00:39 -08:00
Angular Robot 2bb5bb47e0 build: update all github actions
See associated pull request for more information.
2025-12-17 09:59:09 -08:00
Shuaib Hasan Akib 3b3b982fa3 docs: add documentation for schema validation with Signal Forms
Fixes: #66098
(cherry picked from commit 3e57f9eaf5)
2025-12-17 09:52:50 -08:00
SkyZeroZx 14b529e5ce docs: align lightweight injection tokens with the style guide
(cherry picked from commit 50d5c2997f)
2025-12-17 09:45:18 -08:00
Matthieu Riegler dd38869b46 docs(docs-infra): leverage the search on 404
This introduces a search result matching the requested url when the page couldn't not be found.

(cherry picked from commit d23ce76821)
2025-12-17 09:40:47 -08:00
kirjs 4d966c99e3 refactor(forms): convert Signal Forms errors to use RuntimeError
- Added 13 new error codes to forms/src/errors.ts (1900-1999)
- use RuntimeError

(cherry picked from commit 6f6b2408fa)
2025-12-17 09:40:01 -08:00
SkyZeroZx e0694df3ec fix(language-service): avoid interpolation highlighting inside @let
This change omits treating `{{ }}` interpolation syntax as valid inside `@let` binding strings, preventing the interpolation curly braces from superseding the match of the surrounding binding expression and ensuring the highlighter reflects the correct semantics of `@let` bindings.

fixes #61643

(cherry picked from commit 9f5744a92d)
2025-12-17 09:39:23 -08:00
Alan Agius 48492524ea fix(core): use mutable ResponseInit type for RESPONSE_INIT token
The `RESPONSE_INIT` token previously used `ResponseInit`. However, `@types/node` (and `undici`) definitions for `ResponseInit` mark properties as `readonly`, which differs from the standard DOM `ResponseInit`.

This commit introduces a `ResponseInit` type that explicitly removes `readonly` modifiers to ensure compatibility and allow for mutable options. This type is now used by the `RESPONSE_INIT` token and is exported from `@angular/core`.

(cherry picked from commit f516370c8e)
2025-12-17 09:35:27 -08:00
Andrew Kushnir a4d2de8179 Revert "fix(core): explicitly cast signal node value to String"
This reverts commit c501b25d04.

(cherry picked from commit 9fa77af110)
2025-12-16 17:37:38 -08:00
Andrew Seguin 0eb623c05a fix(core): explicitly cast signal node value to String
If the computed's `toString` is called and `node.value` is a Symbol, the browser will throw an exception `ERROR TypeError: Cannot convert a Symbol value to a string`

Symbols cannot be implicitly changed to strings. This change changes the conversion to be explicit by wrapping `node.value` with `String()`

This can be reproduced if you create a computed with `createComputed(computation, equal)` and call `toString()` while `node.value` is something like `Symbol(UNSET)`

(cherry picked from commit c501b25d04)
2025-12-16 16:38:07 -08:00
SkyZeroZx dc0aae9a59 docs: add section about reactive contexts
(cherry picked from commit 62ccd64e9f)
2025-12-16 16:35:28 -08:00
Marc Stammerjohann 0e59ac795c docs(router): add missing inject import
(cherry picked from commit dc7ae9aef3)
2025-12-16 16:34:23 -08:00
Matthieu Riegler feed89e83c ci: reformat files
This is after we've slightly changed a rule in #66056

(cherry picked from commit 6270bba056)
2025-12-16 14:44:25 -08:00
Miles Malerba 729b96476b refactor(forms): rename field to fieldTree in FieldContext and ValidationError
BREAKING CHANGE:

(cherry picked from commit ae0c59028a)
2025-12-16 10:26:26 -08:00
SkyZeroZx 8d92f05105 refactor(platform-browser): remove unused platformIsServer flag from renderer
The` platformIsServer` flag is no longer referenced by the renderer and is effectively unused.
Removing it simplifies the implementation and avoids carrying redundant state.

(cherry picked from commit 2ccdf50fba)
2025-12-16 10:25:14 -08:00
SkyZeroZx 0a5fd6b6d4 refactor(core): conditionally include debug names based on ngDevMode
Conditionally include debug-related metadata based on `ngDevMode` to avoid
unnecessary information in production builds.

(cherry picked from commit bf2e50843d)
2025-12-16 09:37:42 -08:00
Angular Robot 7846bccdfc build: lock file maintenance
See associated pull request for more information.
2025-12-16 09:36:56 -08:00
Angular Robot b92ffccf43 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-16 09:34:00 -08:00
Ben Hong 61a46487f1 docs: update links to guides in signal forms overview
(cherry picked from commit 3750622c46)
2025-12-16 09:29:15 -08:00
SkyZeroZx 561d300302 docs: update lightweight injection tokens guide to use contentChild, contentChildren, and inject APIs.
(cherry picked from commit 53c447e3c8)
2025-12-16 09:28:27 -08:00
Matthieu Riegler df5ba9e2bd ci: reformat files
This is after we've slightly changed a rule in #66056
2025-12-16 09:25:37 -08:00
Shuaib Hasan Akib c250bd01fe refactor(docs-infra): remove deprecated h.JSX.HTMLAttributes usage
Import HTMLAttributes directly from preact to address deprecation warning in header-api.tsx

(cherry picked from commit 3ff20a58d3)
2025-12-15 17:44:27 -08:00
Angular Robot ca167b9f57 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-15 14:22:55 -08:00
Alan Agius 31b909040a refactor(compiler): remove unnecessary sanitization for safe attributes
Remove sanitization for attributes that cannot execute code (e.g. `javascript: URIs`).

(cherry picked from commit d4111eebc6)
2025-12-15 14:13:42 -08:00
Kirill Cherkashin 5afb1eb600 docs(forms): improve JSDoc for Signal Forms Schema types
Improved documentation for Schema, SchemaFn, and SchemaOrSchemaFn types
with clearer descriptions and usage examples.

(cherry picked from commit 193aa332fc)
2025-12-15 14:02:39 -08:00
Angular Robot 0905eb63b5 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-12-15 13:28:07 -08:00
Matthieu Riegler 3151c05e04 refactor(forms): add signal forms to the type tests
This will ensure that signal forms emit valid typings.
Also this commits moves `@standard-schema/spec` from peer-dep to regular dep

(cherry picked from commit 44d4439bc4)
2025-12-15 11:44:58 -08:00
kirjs 45e967b295 refactor(forms): convert Signal Forms errors to use RuntimeError
- Added 13 new error codes to forms/src/errors.ts (1900-1999)
- use RuntimeError

(cherry picked from commit 3a01d72850)
2025-12-15 11:44:06 -08:00
Angular Robot e08350dfdd build: update dependency bazel to v8.5.0
See associated pull request for more information.

Closes #66067 as a pr takeover

(cherry picked from commit aabf719a6d)
2025-12-15 11:41:47 -08:00
Alan Agius 5148523bec build: remove API doc generation for localize/init and add mnemonic to API rendering rule.
The removed target was not used and was generating an empty output which causes `java.io.IOException: mandatory output packages/localize/init/localize_docs_html was not created`

(cherry picked from commit 2a5c6919d0)
2025-12-15 11:41:47 -08:00
Andrew Scott def3c6636e docs: update link to releases for vscode extension
(cherry picked from commit a1eb2cef16)
2025-12-15 11:41:18 -08:00
Shuaib Hasan Akib 0dd5417352 docs: format CLI builder JSON examples using fenced blocks
Replaces custom docs-code components with fenced ```json``` blocks for
CLI builder examples, improving readability, consistency, and copy
support across the documentation.

Fixes #66060

(cherry picked from commit a2aa8fef05)
2025-12-15 11:35:01 -08:00
aparziale 01a6426ce3 docs(docs-infra): Fix broken link
Fix broken link side effects

Fix #66051

(cherry picked from commit a29a3988d6)
2025-12-15 11:34:00 -08:00