38449 Commits

Author SHA1 Message Date
SkyZeroZx c60c41e29a test(core): reduce fakeAsync usage in animation tests
Use async/await in animation acceptance tests and share the animation frame helper. Remove the obsolete fakeAsync frame utility and its Bazel dependency.
2026-09-13 14:20:24 -07:00
Kam fc2f6fd67d docs: stop the disabled aria toolbar radio group from changing selection
The disabled toolbar example marks its alignment radio group `disabled`.
Toolbars are soft-disabled by default, so the widgets only receive
`aria-disabled` and stay clickable, which the guide describes as focusable
but unavailable.

Since #70516 moved selection into the app, each radio also carries a
`(click)="alignment.set(...)"` handler that never checks the disabled state.
Clicking a disabled radio therefore changes the selection. Before that change
the radios had no app listener and the library ignored clicks on disabled
items.

Drop the three click handlers from the permanently disabled group in the
basic, material and retro variants, the same way the disabled redo button in
the same template already has none.
2026-09-11 16:00:02 -07:00
aparziale f2cf65a898 fix(vscode-extension): handle template literals when detecting supported decorator fields
The client decides whether a position in a TypeScript file belongs to a supported `@Component` field (`template`, `styles`, ...) with a lightweight `ts.Scanner` loop before forwarding requests to the language server and the HTML/CSS providers. `ts.Scanner#scan` doesn't handle template substitutions on its own: the `}` closing a `${...}` substitution is reported as a plain `CloseBraceToken` and the rest of the template literal is scanned as the start of a new one, swallowing everything up to the next backtick. As a result, once a template literal with substitutions appears in a file, every position after it is considered to be inside a template string, and TypeScript completions get polluted with HTML completions.

The scanner is now driven the same way the TypeScript parser does it, re-scanning the brace that closes a substitution as a `TemplateMiddle`/`TemplateTail` token.

In addition, the property assignment context previously only ended at a terminator found at the top level of the file, so it leaked from `template:` to every string literal that followed it inside the same decorator and class body. The context now ends at the first terminator found at the nesting depth where it was entered. Two kinds of strings were only recognized thanks to that leak, and only when declared after `template`: inline `styles` and the arguments of `@HostBinding`/`@HostListener` decorators, both of which the language service supports. They are now recognized explicitly, regardless of where they appear.

Fixes #65494
2026-09-11 15:19:01 -07:00
Shuaib Hasan Akib 467b37b4b4 docs(forms): document what required() considers empty
The `required()` validator treats `null`, `undefined`, `''`, `false` and `NaN` as empty, but the API
docs never defined "empty" at all and the validation guide listed only `null` and `''`.
2026-09-11 15:16:17 -07:00
Andrew Scott 2dcdf9aae6 fix(router): mark router_resource module-level symbols as side-effect free
Top-level Symbol() calls in router_resource.ts lacked /* @__PURE__ */
annotations, preventing bundlers like esbuild and Rollup from tree-shaking
the module and its dependencies when provideRouter() is used without
withRouterResources().

Fixes #70696
2026-09-11 14:40:05 -07:00
Kam c097c0144c docs: import bootstrapApplication from platform-browser in the CSP example
The `CSP_NONCE` example in the security guide imports `bootstrapApplication`
from `@angular/core`, which does not export it, so copying the snippet fails
with "has no exported member named 'bootstrapApplication'". It is exported from
`@angular/platform-browser`, which is where every other example in the docs
imports it from.

Keep `CSP_NONCE` on `@angular/core` and import `bootstrapApplication` from
`@angular/platform-browser`.
2026-09-11 13:12:29 -07:00
Joey Perrott 1b7dcc854a ci: stop passing preview gating inputs to adev preview build
The Googler check moved out of `pack-and-upload-artifact` and into the
pull request labeling action, which runs in a privileged
`pull_request_target` context where secrets are available. The build job
runs on `pull_request` and never receives secrets, so it no longer needs
`angular-robot-key` or `triggering-label`, and the `bypassed_for_forks`
placeholder can go away. Bumps the dev-infra pins to pick up that change.
2026-09-11 13:11:59 -07:00
Andrew Scott 2c6c67bee6 fix(router): maintain frozen state on rollback until resource loading completes
Previously, rollback recovery waited on hasValueOrResolved(), which checked whether the resource already had a value. This caused resources with values (e.g. defaultValue, existing values from prior navigations, or streamed emissions) to unfreeze prematurely while still in a loading state during rollback.

This change updates the rollback recovery check in the transactional snapshot effect to be solely determined by !source.isLoading().
2026-09-11 13:06:43 -07:00
Andrew Scott a8233232f5 fix(core): update FakeNavigation to match WHATWG HTML spec
Update FakeNavigation and Navigation API type definitions to match the
latest WHATWG HTML specification
(https://html.spec.whatwg.org/multipage/nav-history-apis.html):
- Add NavigationPrecommitController.addHandler() and support dynamic
  post-commit handler registration
  (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationprecommitcontroller-addhandler).
- Include precommitHandler directly in NavigationInterceptOptions
  (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigateevent-intercept).
- Add hasUAVisualTransition and sourceElement properties to NavigateEvent
  (https://html.spec.whatwg.org/multipage/nav-history-apis.html#the-navigateevent-interface).
- Fix FakeNavigationHistoryEntry dispose event name from 'disposed' to 'dispose'
  and implement ondispose
  (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationhistoryentry-ondispose).
- Implement Navigation.prototype.updateCurrentEntry
  (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-updatecurrententry).
- Implement Navigation.prototype.reload
  (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-reload)
  and share "performing a non-traverse navigation"
  (https://html.spec.whatwg.org/multipage/nav-history-apis.html#performing-a-non-traverse-navigation)
  logic with navigate().
- Implement standard event handler IDL properties (onnavigate,
  onnavigatesuccess, onnavigateerror, oncurrententrychange).
- Update internal specification comments and links from legacy PR draft URLs
  to official WHATWG multipage URLs.
2026-09-11 12:41:15 -07:00
Kam d0ed76c1d6 docs: fix the broken housing location template in the first-app tutorial
Step 11 of the first-app tutorial ships a `housing-location.ts` whose heading
reads `{{ housingLocatio()).name }}`, a misspelled property followed by an
extra parenthesis, so the step's source fails to compile with a template
parser error. Step 10 reuses this directory as its answer.

It came in with #61686, which migrated the tutorial to signal inputs. Use
`housingLocation().name`, matching the rest of the template and every other
step.
2026-09-11 10:59:36 -07:00
Kam 01d091bf9c fix(docs-infra): raise SSR fetch limit so the menubar guide prerenders
The aria menubar guide content is 2.9 MB, over the 2 MiB
maxResponseBodySize set in #69379. The fetch fails during prerender,
the navigation error handler redirects to /404, and the prerendered
page is saved as that redirect. Opening /guide/aria/menubar directly
or refreshing it lands on the 404 page.

Raise the limit to 4 MiB. The combobox guide was also within 27 KB of
the old limit.
2026-09-11 10:42:35 -07:00
Kam b9cbc5fbbe fix(docs-infra): match card grid row gap to column gap
The `:not(.docs-card-container) .docs-card` selector was meant to give
standalone cards a vertical margin, but no element has the
docs-card-container class, so it matched every card. Cards in a grid
without a header picked up the 1rem margin on top of the 1.25rem grid
gap, leaving rows 52px apart while columns are 20px apart (for example on
/reference/migrations, /guide/i18n and /roadmap).

Apply the margin only to cards that are not direct children of a card
grid.
2026-09-11 10:41:51 -07:00
Alan Agius 9918c81ca9 build: update @angular/ssr and add beasties dependency for adev and dev-app
In @angular/ssr 22.2.0-next.7, beasties was made an external dependency rather
than vendored internally. Because hoist: false is configured and preserveSymlinks
is enabled, rules_js does not hoist beasties into adev/node_modules and
dev-app/node_modules.

This commit adds beasties as an explicit dependency for both adev and dev-app
so that it can be resolved during bundling.
2026-09-11 10:40:29 -07:00
Angular Robot 11a66f254b docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-09-11 10:39:02 -07:00
Andrew Scott 37ca679192 Revert "fix(compiler): wrap @for collection expression before appending non-null assertion"
This reverts commit ed8f16c078.

This caused a breakage in TGP because the changes (correctly) produced new
diagnostics on ` @for (a of (x | async) || []; track a) {` x is `any`. This
results in `<any> | async` which produces `unknown | null` and then the `@if`
finally narrows this down to `{}` which isn't iteratable.
2026-09-11 10:05:15 -07:00
Matthieu Riegler ae33a5f55e test(core): fix view injector integration spec
Restore ChangeDetectionStrategy.OnPush that was removed in a previous commit, causing tests to fail due to ExpressionChangedAfterItHasBeenCheckedError.
2026-09-10 16:17:53 -07:00
Matthieu Riegler e2050759a4 docs: add error boundaries entries 2026-09-10 15:36:21 -07:00
Alan Agius 29f9dd5e77 refactor(devtools): update angular optimization plugin for JavaScriptTransformer API
Update createEsbuildAngularOptimizePlugin to use the new options object signature for JavaScriptTransformer.transformFile, and update the @angular/build dependency to 22.2.0-next.7.
2026-09-10 15:06:43 -07:00
Kam b9fb456971 docs(forms): close the unterminated code fences in the compatForm docs
Two of the three `compatForm` overloads open a fenced code block in their
`@example` and never close it. The fence then runs to the end of the tag, so the
API renderer emits a plain `<pre><code>` block for those two instead of a
highlighted one.

The result is that on the compatForm API page the first overload's example is
syntax highlighted while the other two, which contain identical code, render as
flat unstyled text.

Rebuilding //adev/src/assets:content with and without this change alters 1 of
1565 pages. That page goes from 6 highlighted and 2 plain code blocks to 8
highlighted and none plain.
2026-09-10 14:53:41 -07:00
Matthieu Riegler 9090a758be refactor(compiler-cli): relax nullish coalescing non nullable diagnostics on indexed access
When noUncheckedIndexedAccess is not enabled, indexed accesses do not include undefined in the type. This relaxes the check for nullish coalescing similarly to optional chaining. Fixes #70655

fixes #70655
2026-09-10 14:31:22 -07:00
SkyZeroZx 9e5ae4b710 test(core): remove redundant change detection configuration
OnPush is now the default change detection strategy, so the explicit test and example configuration is no longer needed.
2026-09-10 14:30:31 -07:00
SkyZeroZx 4380e683d8 docs(router): update scroll restoration example
Uses modern dependency injection and signal-based change detection in the custom scroll restoration example.
2026-09-10 14:30:31 -07:00
SkyZeroZx a958d7fe30 test(router): remove redundant change detection configuration
OnPush is now the default change detection strategy, so the explicit test configuration is no longer needed.
2026-09-10 14:30:31 -07:00
Angular Robot ceba448475 build: update pnpm/action-setup action to v6.1.0
See associated pull request for more information.
2026-09-10 14:29:47 -07:00
Kam 9073469416 fix(docs-infra): escape the code example header
`buildHeaderElement` interpolated the header into a string that is then parsed
as HTML, so markup in a header became an element instead of text. The ten
captions on https://angular.dev/guide/i18n/translation-files read
`messages.fr.xlf ()`, having turned `(<trans-unit>)` into an empty element.

These are the only two headers in the guides containing markup.
2026-09-10 14:29:10 -07:00
Kam 61b353ebee fix(docs-infra): restore the xlf regions on the i18n guides
#65848 renamed `messages.fr.xlf.html` to `messages.fr.xlf` and, in the same
lines, reverted `region=` back to `visibleRegion=`, undoing #65530 from two
weeks earlier. `visibleRegion` is not read by the tokenizer, and `xlf` is not
in `REGION_MATCHERS`, so both halves of the snippet handling broke at once.

Since then https://angular.dev/guide/i18n/translation-files has shown the same
78 line file ten times where the prose describes single `<trans-unit>`
elements, and https://angular.dev/guide/i18n/manage-marked-text three times,
each carrying the `#docregion` scaffolding into the rendered code.

Mapping `xlf` to the html matcher also cleans up
https://angular.dev/guide/i18n/example, which renders the whole file on purpose
but leaked 27 marker lines into it.

`docs-code.spec.mts` already loads this fixture but only asserted the block
existed, so it stayed green throughout. It now also asserts no marker survives.
2026-09-10 14:29:10 -07:00
Andrew Scott 14dbbf9b68 fix(compiler): wrap @for collection expression before appending non-null assertion
When generating type check blocks for `@for` loops, a non-null assertion is appended to the collection expression. If the collection expression is a compound expression (e.g. binary or logical operations like a && b), the lack of outer parentheses caused the ! to bind only to the rightmost operand (a && b!), leading to typecheck errors such as TS2532.

This wraps the expression via .wrapForTypeChecker() before appending !.
2026-09-10 13:22:52 -07:00
Angular Robot 4b3f8c224b docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-09-10 11:15:04 -07:00
Doug Parker 8ca879e2d8 refactor(forms): expose consequentialHint annotation
Unlike `readOnlyHint` and `untrustedContentHint`, Angular cannot infer any reasonable default value for `consequentialHint` and simply exposes it to users to specify as appropriate.

See: https://groups.google.com/a/chromium.org/g/chrome-ai-dev-preview/c/uHu5kfclbKw/m/dgorjfHPDgAJ
2026-09-10 09:50:14 -07:00
Doug Parker 96dbae53bb refactor(core): expose consequentialHint annotation
This allows `consequentialHint` to be passed to `ModelContext.registerTool`. From Angular's perspective, this is simply a pass-through option.

See: https://groups.google.com/a/chromium.org/g/chrome-ai-dev-preview/c/uHu5kfclbKw/m/dgorjfHPDgAJ
2026-09-10 09:50:14 -07:00
Alan Agius f557ead292 build: add @modelcontextprotocol/server devDependency and vendor license
Add @modelcontextprotocol/server to devDependencies in @angular/core to extract its LICENSE file via a genrule in the third_party directory, and remove the previously checked-in package.json.
2026-09-10 09:49:08 -07:00
Alan Agius 593a5df61c build: make webmcp-types sources genrule cross-platform
Replace `sed -i` in-place substitution with direct stdout redirection from the source file to destination outputs. `sed -i` behaves differently between GNU and BSD sed, which caused build failures on macOS.
2026-09-10 09:49:08 -07:00
Kam 8576f161ae fix(docs-infra): highlight home page code for the resolved theme
`CodeBlock` picked `github-light` only when the theme was exactly `light`, but
`Theme` also has `auto`, the value for anyone who has not opened the theme
menu, and `theme()` is `null` during prerendering. Both fell to `github-dark`,
so the samples in the Signals, Control Flow and Deferrable Views tabs on
https://angular.dev rendered on a dark slab inside a light page.

Resolve the theme in `ThemeManager`, which already owns the `auto` translation.
`resolvedTheme` returns `light` when `theme()` is `null`, which happens only
during prerendering, so `window` is never read. The device scheme moves into a
signal so `auto` also reacts to OS scheme changes.
2026-09-09 22:27:24 +02:00
SkyZeroZx 947f3ffaef test(core): reduce fakeAsync usage in tests
Use async/await where needed. Remove unused dependencies.
2026-09-09 22:26:29 +02:00
Edu cea6896a0f fix(core): return null when getDirectiveMetadata is called with null or undefined
Safely return null instead of throwing an unhandled TypeError when getDirectiveMetadata is called with a falsy directive or component instance.
2026-09-09 22:26:00 +02:00
Edu ef09d108f2 fix(devtools): safely handle foreign root elements in feature detection
Prevent Angular DevTools from crashing when elements matching [ng-version] in the DOM do not belong to the host application (such as third-party custom elements or browser extensions). ng.getComponent returns null for these elements, which previously caused ng.getDirectiveMetadata to throw.
2026-09-09 22:26:00 +02:00
Kristiyan Kostadinov a410e1370c release: cut the v22.2.0-next.7 release v22.2.0-next.7 2026-09-09 22:22:24 +02:00
Kristiyan Kostadinov 0625c1d81d release: cut the v22.2.0-next.6 release v22.2.0-next.6 2026-09-09 22:16:04 +02:00
Kristiyan Kostadinov 2f3afc9909 docs: release notes for the v22.1.6 release 2026-09-09 22:12:02 +02:00
Kristiyan Kostadinov 018bec1ecc docs: release notes for the v20.3.31 release 2026-09-09 22:02:37 +02:00
Kristiyan Kostadinov c62641fdb0 docs: release notes for the v21.2.23 release 2026-09-09 21:55:18 +02:00
Kristiyan Kostadinov b6517a6672 build: resolve pnpm 12 breakages
Accounts for breaking changes in pnpm 12.
2026-09-09 21:48:04 +02:00
Andrew Scott 679c50dcbe refactor(router): Remove ActivatedRouteSnapshot from resourceContext
providing the snapshot is a bit incompatible with how things are meant to work here.
The snapshot is only accurate during the setup and would be out of date
on followup navigations
2026-09-09 18:09:11 +02:00
Kristiyan Kostadinov 25228d0cc3 test: fix failing boundary test
Fixes a test that's breaking CI.
2026-09-09 17:23:07 +02:00
Angular Robot 2c71e8823a docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-09-09 16:35:02 +02:00
Angular Robot 25317c3837 build: update dependency cypress to v16
See associated pull request for more information.
2026-09-09 16:33:56 +02:00
Angular Robot bc0fd20d55 build: update dependency vitest to v5
See associated pull request for more information.
2026-09-09 16:31:33 +02:00
Angular Robot 8414f90a6f build: update cross-repo angular dependencies
See associated pull request for more information.
2026-09-09 16:30:15 +02:00
Alan Agius bc3a6cda5d fix(platform-server): avoid sourcemap corruption during domino path substitution
The substitution regex `\./(.+)/third_party/domino/bundled-domino` was used to rewrite the relative execroot path emitted by Rollup for the domino external import into `../third_party/domino/bundled-domino.mjs`.

However, `ng_package` runs `text_replace` across all generated package files, including `.map` files which are serialized on a single line. The `\./` pattern unintentionally matched the `./` inside `"../../"` in the `sources` array, and the greedy `.+` wildcard matched across the rest of `sources` and the `"sourcesContent": [` declaration up to the domino import within the first source file's content. This corrupted `init.mjs.map` and `_server-chunk.mjs.map` by destroying `sourcesContent` and populating `sources` with raw file contents.

This commit updates the substitution regex to use a negative lookbehind `(?<!\.)` to prevent matching `../` sequences, and restricts the path characters to valid filesystem path characters `[a-zA-Z0-9_./-]+` rather than `.+`.

Fixes #70625
2026-09-09 16:27:18 +02:00
Angular Robot 199da47d58 build: update dependency node to v24.21.0
See associated pull request for more information.
2026-09-09 16:26:45 +02:00