Commit graph

35298 commits

Author SHA1 Message Date
Joey Perrott
7d6235f3fb build: use mjs files for ng-dev configuration
In preperation for ng-dev requiring mjs files for configuration, switch over our usage
2025-11-12 09:35:19 -08:00
Alan Agius
0835bd815f build: improve dependency management for local packages
Refactor .pnpmfile.cjs to use a Set for localAngularPackages for better performance.
Adjust typescript dependency handling in compiler-cli to correctly use devDependencies.
Promote rxjs and zone.js from peer dependencies to regular dependencies for local packages.
These changes streamline dependency resolution and align with pnpm's behavior for workspace dependencies.
2025-11-12 09:34:27 -08:00
Alan Agius
c51b42f1ce build: remove extra deps
Most of these deps are either unused or are in `adev`
2025-11-12 09:34:27 -08:00
Andrew Kushnir
cc095d447c docs: release notes for the v21.0.0-rc.2 release 2025-11-12 08:41:32 -08:00
Andrew Kushnir
1f6de175c9 docs: release notes for the v20.3.11 release 2025-11-12 08:26:29 -08:00
Danny Koppenhagen
c3e82fb2d5 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
2025-11-11 14:08:58 -08:00
Matthew Beck
24cfd5a0ed 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
2025-11-11 14:03:32 -08:00
Alan Agius
4ed8781301
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.
2025-11-11 12:50:16 -08:00
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