35671 Commits

Author SHA1 Message Date
Leon Senft 37463525be refactor(forms): use AbortSignal to cancel debounced updates
Add an `AbortSignal` parameter to `Debouncer`. Implementations may
choose to accept this parameter to be informed when a debounced
operation is aborted. This may be useful for canceling pending timers or
avoiding unnecessary work.

(cherry picked from commit 98ce9a7b17)
2025-11-13 17:59:22 +00:00
Angular Robot 2406172d50 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-11-13 09:45:50 -08:00
Matthieu Riegler 4f6f9b8e8d docs(docs-infra): Add support for metadata on fenced code blocks
This will help us replace `docs-code` with inline code usages and prevent future indentation issues

(cherry picked from commit f737a9dd5c)
2025-11-13 17:36:17 +00:00
Ben Hong 119be3488e docs: add signal forms overview guide 2025-11-13 09:35:53 -08:00
Shuaib Hasan Akib c12f0159f9 docs: replace <docs-code> block with standard fenced code block for typescript example
Replaced the <docs-code> wrapper with a Markdown fenced code block to improve
copy/paste usability, syntax highlighting consistency, and alignment with current
documentation formatting standards.

Inspired by #65043

(cherry picked from commit 3cfd4361a5)
2025-11-13 17:34:15 +00:00
Kristiyan Kostadinov 67fbd5ff1e fix(core): SSR error in signal forms
Resolves an SSR error, because we weren't checking if `MutationObserver` is available.

(cherry picked from commit 3f80ae74ba)
2025-11-13 17:12:45 +00:00
Matthieu Riegler 0c27954a4d refactor(core): remove resource flag.
This was used to migrate G3 and is no longer necessary.

(cherry picked from commit d1ab73dd87)
2025-11-13 17:12:22 +00:00
Shuaib Hasan Akib c7df828c48 docs: replace <docs-code> block with standard fenced code block for typescript example
Replaced the <docs-code> wrapper with a Markdown fenced code block to improve
copy/paste usability, syntax highlighting consistency, and alignment with current
documentation formatting standards.

Inspired by angular#65043

(cherry picked from commit caaa5ec8e6)
2025-11-13 17:11:26 +00:00
Charles Lyding 50938b786e docs: create Vitest migration guide
This commit introduces a new guide for migrating existing Angular projects from Karma/Jasmine to Vitest.

The guide covers:
- Manual steps for installing dependencies and updating `angular.json`.
- Handling custom `karma.conf.js` configurations.
- Removing Karma-related files and packages.
- Configuring browser mode for Vitest.
- Details on the `refactor-jasmine-vitest` schematic for automated test refactoring.

The guide also clarifies that while Vitest is the default for new projects, migration for existing projects is experimental. It emphasizes reviewing changes and provides guidance on adapting custom Karma configurations to Vitest.

Renames `experimental-unit-test.md` to `migrating-to-vitest.md` and updates `sub-navigation-data.ts` accordingly.

(cherry picked from commit 258c295b92)
2025-11-13 17:10:59 +00:00
Angular Robot 2606b6e938 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-13 09:09:10 -08:00
hawkgs c133f48902 docs(docs-infra): improve playground layout
Improve the layout and optimize the empty space; Introduce some minor improvements to the code editor

(cherry picked from commit 7ab1b3a32a)
2025-11-13 17:07:58 +00:00
SkyZeroZx 31ca56aa20 docs: Fixed mermaid diagram node label contrast in dark mode
(cherry picked from commit b6a91d4c39)
2025-11-12 23:01:40 +00:00
Kristiyan Kostadinov be371292f2 refactor(compiler-cli): rework type checking for signal forms
Reworks the way we approach type checking of signal forms to be closer to the behavior at runtime. There are a couple of scenarios that we handle:

1. For native controls, we now produce simplified type checking code that looks as follows:

```
var t1 = null! as number | string; // Type depends on the input `type`.
t1 = someField().value();
```

2. For custom controls we generate bindings to the individual inputs, rather than checking conformance against `FormValueControl`/`FormCheckboxControl`. This is closer to the behavior at runtime and it allows us to handle generic directives properly.

(cherry picked from commit f7e58577a4)
2025-11-12 21:13:51 +00:00
Kristiyan Kostadinov afda85f24c refactor(core): remove unused type
Removes the `ExtractFromControlValue` type since it won't be necessary anymore.

(cherry picked from commit 14152f69b9)
2025-11-12 21:13:51 +00:00
SkyZeroZx 4d8b97627c docs: update tutorials with self-closing tags, standalone router directives, and fix syntax highlighting
(cherry picked from commit 4544135b1e)
2025-11-12 21:13:27 +00:00
Angular Robot eb9034d4a8 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-12 11:56:11 -08:00
SkyZeroZx dc11db1f37 docs: correct example for RouteReuseStrategy getRouteKey
Update the example to properly demonstrate the getRouteKey method usage fixes #65021

(cherry picked from commit a48029b810)
2025-11-12 19:49:08 +00:00
Angular Robot 16f2c5529a docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-11-12 11:48:42 -08:00
SkyZeroZx 129e16dc86 docs: correct code block language in error handling and signals interop
(cherry picked from commit 05ef2a5ca9)
2025-11-12 19:35:14 +00:00
Angular Robot 1021b7a394 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-12 11:32:20 -08:00
Angular Robot 18cc2606e3 build: update bazel dependencies
See associated pull request for more information.
2025-11-12 09:41:42 -08:00
Angular Robot 8636f8aa83 build: update pnpm to v10.21.0
See associated pull request for more information.
2025-11-12 09:38:59 -08:00
Ben Hong 4f936cafda docs: iterate on essentials signal forms guide 2025-11-12 09:37:15 -08:00
Ben Hong d02374a45c docs: iterate on signal forms essential guide 2025-11-12 09:37:15 -08:00
Alan Agius a55a96a5fb build: allow any version of @angular/* packages for peer dependencies
This change configures pnpm to allow any version of  `@angular/*` packages to satisfy peer dependencies. This is necessary because `@angular/*` packages are managed within this monorepo, and this rule prevents issues with peer dependency resolution when different versions might be present during development or testing.

(cherry picked from commit 46099910c0)
2025-11-12 09:36:01 -08:00
Andrew Kushnir 909588e57f release: cut the v21.0.0-rc.2 release 21.0.0-rc.2 2025-11-12 08:39:31 -08:00
Danny Koppenhagen c05cf4145b refactor(core): render additional WAI-ARIA 1.3 property bindings as attributes
Support additional ARIA properties from Accessible Rich Internet Applications (WAI-ARIA) version 1.3.

| attribute | property |
|-----------|----------|
| `aria-activedescendant`           | `ariaActiveDescendantElement` |
| `aria-colindextext`           | `ariaColIndexText` |
| `aria-controls`           | `ariaControlsElements ` |
| `aria-describeyby`           | `ariaDescribedByElements ` |
| `aria-description`           | `ariaDescription` |
| `aria-details`           | `ariaDetailsElements ` |
| `aria-errormessage`           | `ariaErrorMessageElements ` |
| `aria-flowto`           | `ariaFlowToElements ` |
| `aria-labelledby`           | `ariaLabelledByElements ` |
| `aria-owns`           | `ariaOwnsElements ` |
| `aria-rowindextext`           | `ariaRowIndexText ` |

closes #64847

(cherry picked from commit c3e82fb2d5)
2025-11-11 14:09:02 -08:00
Matthew Beck 814b2713f5 fix(compiler): support complex selectors in :nth-child()
:nth-child() (and its siblings) support complex expressions, e.g.
`:nth-child(2n of :is(.foo, .bar))`. Previously we'd choke because of
the `:is()`. Now, we reuse the `_parenSuffix` subexpression to match
nested parentheses the same way we do for :host() and :host-context().
Note that we only support 3 levels of nesting, so a selector like
`:nth-child(n of :is(:has(:not(.foo))))` will still break.

I'll say yet again that we really should add a proper parser so we stop
getting bug reports like this :)

Fixes #64913

(cherry picked from commit 24cfd5a0ed)
2025-11-11 14:03:37 -08:00
Alan Agius 7811d95b89 refactor(core): improve resource loading with async/await
Refactor  to use async/await for clearer asynchronous operations and enhanced error handling.
Simplify resource caching and streamline the resolution of component templates and styles.
Update  in the router to align with the new async resource resolution.

(cherry picked from commit 4ed8781301)
2025-11-11 12:50:19 -08:00
Andrew Scott e5b0a9739c Revert "feat(service-worker): notify clients about version failures (#62718)"
This reverts commit 6d011687ec.

issue #63500 reproduces at head on the main branch in the dev app.
Reverting this change along resolves it.

fixes https://github.com/angular/angular/issues/63500

(cherry picked from commit 4af408afcb)
2025-11-11 12:48:49 -08:00
Leon Senft a278ee358c feat(forms): add debounce() rule for signal forms
The `debounce()` rule allows developers to control when changes to a
form control are synchronized to the form model.

This feature necessitated some changes to `FieldState`:

  * `controlValue` is a new signal property that represents the current
    value of a form field as it appears in its corresponding control.

  * `value` conceptually remains unchanged; however, its value may lag
    behind that of `controlValue` if a `debounce()` rule is applied.

The `debounce()` rule essentially manages when changes to `controlValue` are
synchronized to `value`. The intent is that an expensive or slow
validation rule can react to the debounced `value`, rather than a more
frequently changing `controlValue`.

Directly updating `value` immediately updates `controlValue`, and cancels any
pending debounced updates.

When multiple `debounce()` rules are applied to the same field, the last
currently active rule is used to debounce an update. These rules are
applied to child fields as well, unless they override them with their
own rule.

(cherry picked from commit d337cfb68f)
2025-11-11 12:00:13 -08:00
Leon Senft 33ed7d116b refactor(forms): do not infer accumulated metadata type from initial value
This removes the need to specify type arguments for
`reducedMetadataKey()` when the value returned from the `getIntial`
callback is a subtype of the accumulated type.

(cherry picked from commit 8866934334)
2025-11-11 12:00:12 -08:00
Angular Robot fc3a28e647 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-11 11:51:32 -08:00
Angular Robot baf33d01c1 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-11 10:21:35 -08:00
Doug Parker c9f977833e fix(core): skip Angular formatting when formatting signals recursively
The flag `skipFormatting` got renamed to `ngSkipFormatting` during review of https://github.com/angular/angular/pull/64000, but a couple usages got missed, causing some unfortunate UI recursion.

(cherry picked from commit 490435bf76)
2025-11-11 10:14:33 -08:00
Kristiyan Kostadinov 20319fea85 refactor(compiler): remove unused code
The `fullInheritane` flag from the metadata and the `CopyDefinitionFeature` that it controls appear to no longer be used since `fullInheritance` is always false. The feature appears to have been there to support ngcc which was removed some time ago.

(cherry picked from commit 8277906455)
2025-11-11 10:04:32 -08:00
Angular Robot 91dbb4b4c1 build: lock file maintenance
See associated pull request for more information.
2025-11-11 08:48:21 -08:00
SkyZeroZx 8765b66f5a docs: add reference to Built-in Pipes in multiple pipe files
(cherry picked from commit d999667b57)
2025-11-11 08:47:12 -08:00
Matthieu Riegler 6213cbf1a8 refactor(core): rename ExperimentalIsolatedShadowDom to IsolatedShadowDom
This API is still experimental

(cherry picked from commit 21ca49cf62)
2025-11-11 08:46:10 -08:00
Matthieu Riegler 5e86299ec4 docs(docs-infra): Add support for experimental enum entries
(cherry picked from commit 16e61f5dd0)
2025-11-11 08:46:09 -08:00
RobinReinecke 557213e211 docs: correct mermaid code block formatting
(cherry picked from commit 07703875b5)
2025-11-11 08:33:32 -08:00
SkyZeroZx c72efd67de docs: improve discoverability in service worker documentation
(cherry picked from commit dde18c2303)
2025-11-11 08:32:19 -08:00
cexbrayat eea81c2733 docs: remove error mentions in signal forms docs
`error` no longer exists and is called `validate`

(cherry picked from commit 800b01f5a1)
2025-11-11 08:30:13 -08:00
Devin Chasanoff 2019940ddc docs: add links to SDUI example and livestream
(cherry picked from commit 5af33724a4)
2025-11-10 14:16:23 -08:00
arturovt ab98e71c41 fix(common): remove placeholder image listeners once view is removed
Prior to this commit, attempting to resolve a `ChangeDetectorRef` after views or app have been destroyed would result in an error. In this commit, we clean up listeners once the view is destroyed, before the placeholder loads or fails to load.

(cherry picked from commit feb86e3fde)
2025-11-10 12:05:24 -08:00
Shuaib Hasan Akib e5a19cb736 refactor(router): add ngDevMode guards to InjectionToken names and cleanup imports
Wraps InjectionToken names with `typeof ngDevMode !== 'undefined' && ngDevMode`
checks to enable tree-shaking of descriptive token names in production builds.
This ensures debug-only strings are removed from production bundles, reducing size.

Also removes unused imports found during refactor.

(cherry picked from commit b0b834d7f1)
2025-11-10 12:04:35 -08:00
arturovt 8ab084754b refactor(core): mark VERSION as @__PURE__ for better tree-shaking
Annotate the `new Version(...)` call with `/* @__PURE__ */` to signal to optimizers that the constructor is side-effect free.

Without this hint, bundlers such as Terser or ESBuild may conservatively retain the `VERSION` instantiation even when unused. With the annotation, the constant can be tree-shaken away in production builds if not referenced, reducing bundle size.

(cherry picked from commit d3f67f6ca8)
2025-11-10 12:04:09 -08:00
Alan Agius 5f1436779c docs: use markdown code fences in service worker docs
Replaces the <docs-code> component with standard markdown code fences in the service worker documentation. This improves the readability and maintainability of the documentation.

(cherry picked from commit d42f9ce3a9)
2025-11-10 12:03:36 -08:00
Angular Robot 63418fb938 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-11-10 10:35:02 -08:00
SkyZeroZx 650af71026 refactor(http): migrate XSRF classes to use inject() function
Remove constructor injection in favor of inject() calls

(cherry picked from commit 55be477979)
2025-11-10 09:49:14 -08:00