36240 Commits

Author SHA1 Message Date
Andrew Scott 4af408afcb 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
2025-11-11 12:48:45 -08:00
Leon Senft d337cfb68f 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.
2025-11-11 12:00:09 -08:00
Leon Senft 8866934334 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.
2025-11-11 12:00:09 -08:00
Angular Robot 631cf977a8 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-11 11:51:05 -08:00
Alan Agius 74dca6eccd build: lock file maintenance
See associated pull request for more information.
2025-11-11 10:50:09 -08:00
Angular Robot 3b1fbf00da build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-11 10:19:24 -08:00
Doug Parker 490435bf76 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.
2025-11-11 10:14:30 -08:00
Kristiyan Kostadinov 8277906455 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.
2025-11-11 10:04:29 -08:00
Angular Robot 75dd600570 build: lock file maintenance
See associated pull request for more information.
2025-11-11 08:48:00 -08:00
SkyZeroZx d999667b57 docs: add reference to Built-in Pipes in multiple pipe files 2025-11-11 08:47:07 -08:00
Matthieu Riegler 21ca49cf62 refactor(core): rename ExperimentalIsolatedShadowDom to IsolatedShadowDom
This API is still experimental
2025-11-11 08:46:06 -08:00
Matthieu Riegler 16e61f5dd0 docs(docs-infra): Add support for experimental enum entries 2025-11-11 08:46:06 -08:00
RobinReinecke 07703875b5 docs: correct mermaid code block formatting 2025-11-11 08:33:27 -08:00
SkyZeroZx dde18c2303 docs: improve discoverability in service worker documentation 2025-11-11 08:32:14 -08:00
cexbrayat 800b01f5a1 docs: remove error mentions in signal forms docs
`error` no longer exists and is called `validate`
2025-11-11 08:30:08 -08:00
Doug Parker ec9dc94cee feat(platform-browser): add context to createApplication
This is necessary to use SSR safely with `createApplication` and avoid constraining users to `bootstrapApplication`. It is one more step towards feature parity between `createApplication` and `bootstrapApplication`.
2025-11-10 14:18:29 -08:00
Doug Parker ab67988d2e feat(platform-browser): resolve JIT resources in createApplication
Previously, `createApplication` didn't work with JIT components. This commit brings it closer to feature parity with `bootstrapApplication`.
2025-11-10 14:18:29 -08:00
Devin Chasanoff 5af33724a4 docs: add links to SDUI example and livestream 2025-11-10 14:16:18 -08:00
arturovt feb86e3fde 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.
2025-11-10 12:05:20 -08:00
Shuaib Hasan Akib b0b834d7f1 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.
2025-11-10 12:04:31 -08:00
arturovt d3f67f6ca8 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.
2025-11-10 12:04:04 -08:00
Alan Agius d42f9ce3a9 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.
2025-11-10 12:03:31 -08:00
Angular Robot 4ff6348c0b docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-11-10 10:34:39 -08:00
AleksanderBodurri cfb26f5999 feat(devtools): use router state for active route detection
Replace URL-based active route detection with direct traversal of the ActivatedRoute tree.

This solution is more reliable than the previous approach because it directly compares router tree configuration objects against the active router instance state with router.routerState.
2025-11-10 09:50:08 -08:00
SkyZeroZx 55be477979 refactor(http): migrate XSRF classes to use inject() function
Remove constructor injection in favor of inject() calls
2025-11-10 09:49:09 -08:00
arturovt 7724a9460d refactor(router): replace Optional with inject() flags
Replace `@Optional() link: RouterLink` constructor parameter with
`link = inject(RouterLink, {optional: true})` to enable tree-shaking
of the `Optional` decorator and its factory scaffolding.

Bundle size reduction: `Optional` is a runtime value created by
`makeParamDecorator()`. Even in production builds, ESBuild and other
bundlers must keep their factory code because it is referenced via
`Optional`. With `inject()`, this class is no longer referenced,
allowing it and the `makeParamDecorator` scaffolding to be tree-shaken
when unused elsewhere.

Note: This updates the constructor signature but should not be
considered a breaking change. Angular's official guidance is that
directives, components, and pipes should be instantiated by the
framework, not by user code. Directly calling `new RouterLinkActive(...)`
is an unsupported pattern that goes against Angular's design principles.
2025-11-10 09:48:32 -08:00
Angular Robot e5cc6d55e8 build: update all non-major dependencies
See associated pull request for more information.
2025-11-10 09:47:41 -08:00
Angular Robot 050c475b51 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-10 08:23:57 -08:00
Andrew Scott 2db8f2ee75 refactor(router): Add handling of abort event on signal of NavigateEvent
This adds handling of the abort event on the signal of the
`NavigateEvent`, allowing us to cancel the Router's ongoing navigation
transition when its related navigation was aborted.
2025-11-10 08:02:43 -08:00
Shuaib Hasan Akib 27d54654e3 docs: add shell language to CLI installation examples
Added `language="shell"` to installation command examples to display
the shell prompt `$` icon consistently across npm, pnpm, yarn, and bun
code blocks.
2025-11-10 08:01:29 -08:00
Shuaib Hasan Akib e0a4bdd72b docs(docs-infra): simplify file headers in <docs-code> blocks
Removed redundant "src/app/" prefix from file headers (e.g.,
"src/app/open-close.component.ts" → "open-close.component.ts")
to make code examples cleaner and more focused.
2025-11-10 08:00:33 -08:00
Shuaib Hasan Akib 8c6619a531 docs(docs-infra): removed unused import and use self-closing syntax for component 2025-11-10 08:00:06 -08:00
SkyZeroZx e3fc57e8fc docs: improve discoverability of forms 2025-11-10 07:57:43 -08:00
Angular Robot 47f6f71fc4 build: update dependency marked to v17
See associated pull request for more information.
2025-11-10 07:54:08 -08:00
jnizet afe5fc0399 fix(docs-infra): avoid double slash in sitemap urls
Previously, the URLs in the  generated sitemap contained double slashes between the host and the path. It's not the case anymore.

fix #65022
2025-11-10 07:53:40 -08:00
SkyZeroZx 6a2f4a88de docs: correct import path and self-closing tag in ng-content example 2025-11-10 07:52:46 -08:00
Matthew Beck 4b871b139b test(compiler): add test for :host:has(> .foo)
I took a quick look at my recent changes to see if I had inadvertently
fixed this bug, but I couldn't seem to reproduce it even before my
changes. Seems like it's working, though.

Closes #58436
2025-11-10 07:51:16 -08:00
arturovt 7f95f02d05 refactor(core): tree-shake REF_EXTRACTOR_REGEXP (and dependencies)
`new RegExp()` with computed strings can't be analyzed statically. The bundler can't prove the template string evaluation has no side effects; as thus this expression is considered a side-effect.
2025-11-10 07:48:39 -08:00
Leon Senft 44cd18c183 refactor(forms): remove a TODO and simplify update on <select> mutations
Remove an unnecessary TODO comment. The native `<select>` tracks its
`value` by keeping track of the selected `<option>`. Thus if the value
was set *before* the corresponding option is created, the `<select>`
will ignore it, but the framework doesn't know that and will cache the
bound value anyways. Therefore, checking if the value changed since it
was last bound when the mutation that creates the selected `<option>`
occurs would in fact prevent a needed update, leaving the `<select>` and
field values out of sync.

Furthermore, we know the control type is a native `<select>` element, so
we can update its value directly instead of going through
`updateNativeControl()` which would perform a redundant input type
check.
2025-11-10 07:47:58 -08:00
hawkgs 2d7a72314d fix(devtools): message bus URI conflict between dev and prod apps
\#64806 drops the `href` part of `SamePageMessageBus` URIs. This creates a conflict, which breaks the directive explorer, between the prod Devtools (i.e. the extension) and the dev Devtools app due to the backend URIs using the same string for both prod and dev.
2025-11-10 07:47:37 -08:00
hawkgs 402f396b76 refactor(devtools): update inspect icon
Use a custom version of Material `pin_end` icon that doesn't have a dot.
2025-11-10 07:47:14 -08:00
Danny Koppenhagen d2b854b37e docs(core): add a11y considerations related to @defer()
closes #53466
2025-11-07 15:27:10 -08:00
Andrew Scott 1651908004 refactor(router): Add handler to NavigationInterceptOptions
This adds a handler to the `NavigationInterceptOptions` when we are
intercepting a `NavigateEvent`. This means that the scroll and focus
restoration will be delayed until the handler promise resolves. It also
means that we can provide better indication of an ongoing navigation
event.
2025-11-07 13:32:49 -08:00
Andrew Scott 8bccd8671c refactor(core): Extract NavigateEvent cancel steps based on recent spec update
This updates the cancel/abort steps of fake navigation to match the
current spec.

Relevant commit seems to be
* https://github.com/whatwg/html/commit/b0b40cca16f5d04b7fdca5a1bdca32cc6f824689
2025-11-07 12:54:14 -08:00
Andrew Scott 7a5ac69144 refactor(core): Update commit steps of PlatformNavigation fake to match spec updates
Brings commit steps in line with recent spec updates

* https://github.com/whatwg/html/commit/a3809244c003103243e769855aa4c5792b8937e3
* https://github.com/whatwg/html/commit/bd347bdfebc558f4009109c101bf7fb495400031
2025-11-07 12:54:14 -08:00
Angular Robot a002fb5242 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-11-07 12:52:35 -08:00
Leon Senft 850f0d6b3d perf(forms): only update interop controls when bound field changes
https://github.com/angular/angular/pull/64590 implemented change
detection for field bindings, but only for those bound to native or
custom form controls. This change extends that optimization to apply to
field bindings on interoperable controls built using Reactive Forms as well.
2025-11-07 11:58:17 -08:00
Kristiyan Kostadinov 877678345a refactor(compiler-cli): update set of required inputs
Updates the required inputs that can be ignored for form controls.
2025-11-07 11:57:50 -08:00
Kristiyan Kostadinov 10915f2f5f test(forms): fix type checking errors in signal form tests
Fixes some type checking errors in the signal forms tests that accumulated while there wasn't any type checking.
2025-11-07 11:57:50 -08:00
Kristiyan Kostadinov 0b6b78ca74 fix(compiler-cli): make field detection logic more robust
Currently the logic for detecting `Field` directives only works if it's imported from `@angular/forms/signals` which doesn't cover our own tests.

These changes make the check more robust.
2025-11-07 11:57:50 -08:00