38105 Commits

Author SHA1 Message Date
Alon Mishne 148fee3991 release: cut the v22.1.2 release v22.1.2 2026-08-13 11:57:25 -07:00
Bhuvansh855 0a708e95bf docs: note SafeResourceUrl audio src change
(cherry picked from commit 647bf8e143)
2026-08-13 15:55:07 +00:00
Andrew Scott 910f391674 build(vscode-extension): dynamically resolve upstream remote and use token for https pushes
Previously, the release script hardcoded the upstream repository URL as an unauthenticated HTTPS URL (https://github.com/angular/angular.git). Although the script verified that a GITHUB_TOKEN environment variable was present, it only used that token for REST API calls (such as creating the GitHub release) and did not provide it to Git commands. As a result, users who authenticate to GitHub via SSH (and do not have an HTTPS Git credential helper configured) were prompted interactively for GitHub login credentials when pushing the release tag.

This change dynamically resolves the upstream remote name from the user's configured remotes by checking for any remote pointing to angular/angular. When pushing over SSH, Git uses the user's existing SSH credentials. When pushing over HTTPS (or falling back), the script injects GITHUB_TOKEN into the push URL to prevent interactive authentication prompts.

(cherry picked from commit 6f848db435)
2026-08-13 15:38:56 +00:00
Angular Robot 5a516cdc37 build: update all github actions
See associated pull request for more information.
2026-08-13 08:37:06 -07:00
Angular Robot 1aeec887b4 build: update dependency tar.bzl to v0.10.8
See associated pull request for more information.
2026-08-13 08:34:49 -07:00
Angular Robot 8fa99a2b6d build: lock file maintenance
See associated pull request for more information.
2026-08-13 08:29:30 -07:00
Andrew Scott e9660b1801 fix(compiler-cli): correctly resolve symbol for SafePropertyRead in chained optional navigation
When resolving template symbols for SafePropertyRead in TCBs emitted with optional chaining (strictSafeNavigationTypes: true), SymbolBuilder falls back to finding a TS node matching the AST expression's nameSpan. It then traverses up through parent nodes to find the enclosing expression.

Previously, the traversal loop checked isAccessExpression(node.parent) without verifying whether node was the accessed member name or the expression receiver. When multiple optional navigation expressions are chained (e.g. route?.data?.['icon']), the parent of ((route)?.data) is an access expression where ((route)?.data) is the receiver. Because isAccessExpression was true, the loop continued ascending into the outer access expression, causing symbol resolution for data to erroneously return the symbol and TCB location of icon.

This commit refines the parent traversal condition so that it only climbs into a parent PropertyAccessExpression if node is the accessed name (node.parent.name === node), preventing escape into outer receiver expressions.

(cherry picked from commit e8aa222e7d)
2026-08-12 23:11:27 +00:00
SkyZeroZx d22eb386a5 refactor(core): distinguish animations that share a name
animate.leave waits for the longest-running animation before removing an element. When multiple animations use the same keyframe name, their animationend events have the same animationName, so a shorter animation can be mistaken for the longest one and remove the element too early.

Track the longest animation duration returned by getAnimations() and compare it with the duration from event.animation when available. Keep the existing name/property checks as a fallback for older browsers and computed-style detection.

Allow a 1ms tolerance for rounding differences between CSSOM and Web Animations and add a regression test using values equivalent to fractional calc() durations.

(cherry picked from commit a26fbfa641)
2026-08-12 23:09:31 +00:00
Andrew Scott dc8c0717a0 refactor(router): Create transactional router resource
This commit adds an implementation of a router resource (not currently exposed for public use) which
defines the behavior of a resource dependent on the Router navigation lifecycle.

(cherry picked from commit c111f3fb0c)
2026-08-12 23:07:08 +00:00
Angular Robot 42bc497edf build: update cross-repo angular dependencies to v22.1.2
See associated pull request for more information.
2026-08-12 16:06:08 -07:00
Alon Mishne 3032e7f365 release: bump VSCode extension version to 22.1.0 (#70171)
Co-authored-by: Alon Mishne <amishne@users.noreply.github.com>
2026-08-12 15:36:45 -07:00
Jessica Janiuk 299607d0fb docs: clarify animate.leave child animation behavior
This updates the docs to be explicit about `animate.leave` and nested element removal order. It clearly specifies that `animate.leave` will only fire nested animations within the same component template.

closes: #70131
(cherry picked from commit 3d32db6a49)
2026-08-12 18:07:18 +00:00
SkyZeroZx 98bc211821 test(platform-server): clean up viewport hydration observer
Trigger routed viewport hydration so its cached observer is removed before later randomized specs run.

(cherry picked from commit 870a525bd3)
2026-08-12 18:04:44 +00:00
Matthieu Riegler bb7f051631 refactor(compiler): remove explicit strict: true
This flag is set by default in TS 6.0

(cherry picked from commit f1c0c405c9)
2026-08-12 18:03:57 +00:00
Angular Robot f348c02674 build: update pnpm to v11.21.0
See associated pull request for more information.
2026-08-12 11:01:14 -07:00
SkyZeroZx 2f82601662 fix(router): limit protocol-relative URL handling to serialization
Preserve createUrlTree command semantics, including custom serializer inputs, while keeping the single-leading-slash guarantee at the default serialization boundary.

Expand coverage for command forms, public UrlTree values, secondary outlets, and preserved query parameters and fragments.

Fixes #69700

(cherry picked from commit 435f8b2b8b)
2026-08-11 19:07:35 +00:00
Kam 65e2aed04f fix(docs-infra): contain scroll within adev dropdown menus
Scrolling to the top or bottom of a dropdown let the scroll event chain into
the page behind it, causing the whole app to scroll. #70137 fixed this for the
version picker, but the same containment was missing on every other menu.

The API reference filter, the tutorial step list and the update guide's version
dropdowns already had a scroll container, so they only needed
overscroll-behavior.

The social and theme mini-menus had neither a height cap nor overflow, so
overscroll-behavior alone would have been inert on them. They now share the
version picker's max-height/overflow-y/overscroll-behavior, hoisted onto
.adev-mini-menu, which also keeps their items reachable when the viewport is
too short to fit the whole menu.

(cherry picked from commit dd29713828)
2026-08-11 17:00:57 +00:00
Alex Rickabaugh 0df9d5eb65 fix(core): ensure i18n_util hasOwnProperty checks are safe for property renaming
`getTIcu` and `setTIcu` performed `hasOwnProperty` checks with string
literals (`'currentCaseLViewIndex'` and `'tView'`). Under Closure Compiler
property renaming optimizations, these properties are minified but the
string literals are not, causing property lookups and type discriminations
to fail.

This commit defines closure-safe property constants using
`getClosureSafeProperty` so the property names are renamed consistently.

(cherry picked from commit 8925a4ee49)
2026-08-10 22:35:42 +00:00
splincode ed6b7d71d4 docs: update Angular Aria roadmap status
Update the roadmap to reflect that Angular Aria became stable in Angular v22 while development of new patterns continues.

(cherry picked from commit 8e41e97dfe)
2026-08-10 22:34:55 +00:00
Angular Robot 596356e5d6 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-08-10 09:42:09 -07:00
yamanerkam e805bafbe7 fix(docs-infra): contain scroll within version picker dropdown
Scrolling to the top or bottom of the version picker's dropdown list
let the scroll event chain into the page behind it, causing the whole
app to scroll. The search dialog and search history dropdowns already
guard against this with overscroll-behavior: contain; apply the same
fix to the version picker.

(cherry picked from commit 768c8c29dc)
2026-08-10 16:11:22 +00:00
Kristiyan Kostadinov 4d985a179e fix(core): incorrect loop in defer blocks
Fixes that we were running a `for in` loop on an array and silently doing the wrong thing.

Fixes #70113.

(cherry picked from commit 565dbb2fe5)
2026-08-07 23:35:06 +00:00
Ady Elouej 6f9a64e6f5 fix(compiler): remove namespaced MathML script elements
Treat MathML-namespaced script elements as scripts during template preprocessing. This prevents scripts nested in MathML HTML integration points from surviving template compilation.

(cherry picked from commit 107f6fa49d)
2026-08-07 23:33:00 +00:00
Matthieu Riegler d3d46c9475 fix(devtools): fix regression for node serialization.
This fixes a regression introduced by #69309 where the format of `serializedId` from a coma separated string, to a JSON representation of an array.

fixes #70104

(cherry picked from commit 03f1758e2a)
2026-08-07 23:30:26 +00:00
Angular Robot 1ad10ad494 build: update bazel dependencies
See associated pull request for more information.
2026-08-07 16:28:49 -07:00
SkyZeroZx 72e766456e refactor(forms): modernize Signal Forms tests
replace change detection calls with whenStable for async tests

(cherry picked from commit 4631a6e479)
2026-08-07 23:23:02 +00:00
Ady Elouej 7b40456792 fix(core): reject prefixed SVG script hosts
Use the host element's namespace-aware local name when checking for script
elements. A prefixed SVG script can expose a qualified tag name such as
"x:script" while its local name remains "script".

(cherry picked from commit 9f8e32616b)
2026-08-07 23:19:17 +00:00
SkyZeroZx f51080b07b refactor(platform-browser): modernize DOM renderer tests
Migrate fixtures to standalone components and await zoneless updates

(cherry picked from commit ec372d6029)
2026-08-07 23:17:23 +00:00
splincode 3b5c798072 fix(forms): keep radio inputs in sync when values change
Recompute the checked state when a reused radio input receives a new value while the form model remains unchanged.

Handle this case for both reactive forms and signal forms, and add regression tests covering reused radio elements.

(cherry picked from commit 9e37a58e14)
2026-08-07 23:15:09 +00:00
Matthew Beck ec6deea513 fix(compiler-cli): record class extends clause references in DeferredSymbolTracker
`DeferredSymbolTracker.lookupIdentifiersInSourceFile` prunes `ts.isTypeNode`
subtrees so that references appearing exclusively inside type annotations
do not keep static import declarations in the emitted JavaScript.

However, `ts.isTypeNode` returns `true` for `ts.ExpressionWithTypeArguments`,
which TypeScript uses to represent both `extends` and `implements` heritage
clauses. An `extends` clause on a class declaration or class expression is a
value position that survives in the emitted JavaScript output.

Because `isTypeNode` returned `true`, references to base classes imported
alongside deferred dependencies were ignored. As a result, the compiler
erroneously marked the static import statement as deferrable and deleted it
from the emitted JavaScript, leaving the `extends <Base>` clause referencing
an undeclared identifier and causing a runtime `ReferenceError`.

This commit ensures that `ExpressionWithTypeArguments` under a class `extends`
clause is not treated as an erasable type node, preserving the static import
whenever a base class is referenced.

(cherry picked from commit 8d6c925392)
2026-08-07 23:10:45 +00:00
Angular Robot eaa0d0b3d6 build: update all github actions
See associated pull request for more information.
2026-08-07 16:04:54 -07:00
Angular Robot 31bbf31e11 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-08-07 16:01:31 -07:00
Angular Robot 5accb58241 build: update pnpm to v11.20.0
See associated pull request for more information.
2026-08-07 15:59:48 -07:00
Matthieu Riegler 76dff307b4 fix(compiler): Generate correct expression for optional chaning.
Optional chaining was generating expressions with included an extra pair of parenthesis which changed the semantics of the expression and threw an unexpected error from the optional chain non nullable extended diagnostic.

fixes #70085

(cherry picked from commit d7b03f5523)
2026-08-07 22:55:13 +00:00
SkyZeroZx 4f7e9987fa fix(http): always decode JSON responses as UTF-8
Keep the charset handling added in #70062 limited to text responses. JSON
bytes must stay UTF-8 regardless of the Content-Type charset.

Fetch defines Body.json() using "parse JSON from bytes". Infra specifies that
step as: "Let string be the result of running UTF-8 decode on bytes."

https://fetch.spec.whatwg.org/#dom-body-json
https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
(cherry picked from commit 09bc90003e)
2026-08-07 22:54:24 +00:00
Joey Perrott 7c15737f50 release: cut the v22.1.1 release v22.1.1 2026-08-07 09:31:56 -07:00
lazerg 6f86d666ca docs: fix supported Node.js version in installation prerequisites
(cherry picked from commit 96b80424c7)
2026-08-04 17:31:07 +00:00
Matthieu Riegler ac3728e79f fix(http): avoid aborting completed requests in FetchBackend
Prevent AbortController.abort() from executing during Observable teardown when a FetchBackend HTTP request has already completed successfully or errored.
Previously, FetchBackend unconditionally called abort() upon stream termination. When requests completed normally, calling abort() after delivery caused Chromium-based browsers to mark the resolved request as net::ERR_ABORTED in DevTools due to a race condition, leading to missing response body payloads ("Failed to load response data"). By tracking whether the request has already settled—similar to XhrBackend checking for xhr.readyState !== xhr.DONE—we ensure abort() is only called for unsettled, in-flight requests upon unsubscription.

Fixes #70071

(cherry picked from commit ef4dfead83)
2026-08-04 16:37:39 +00:00
Angular Robot 82269f92ec build: update cross-repo angular dependencies
See associated pull request for more information.
2026-08-04 09:34:33 -07:00
SkyZeroZx f99e916ba7 refactor(common): modernize directive tests to rely on whenStable
Replace synchronous detectChanges calls with zoneless-compatible scheduling and stability waits in NgClass, NgStyle, and NgOptimizedImage tests.

(cherry picked from commit 2f0be5bef8)
2026-08-04 15:45:05 +00:00
Alan Agius 32af9b525e fix(http): strip RFC 6265 DQUOTE characters and handle URIError in parseCookieValue
Previously, `parseCookieValue` did not strip enclosing double quotes (`DQUOTE`) from quoted cookie values as specified in RFC 6265 Section 4.1.1. In addition, malformed percent-encoding in cookie values caused an unhandled `URIError` when calling `decodeURIComponent`.

(cherry picked from commit 280d09b160)
2026-08-04 15:29:50 +00:00
Matthieu Riegler 688a0a7118 fix(http): respect content-type charset in fetch backend text decoder
Extract the charset parameter from the Content-Type response header in FetchBackend and pass it to TextDecoder when decoding text and json responses. When no valid charset is provided or supported, gracefully fall back to default utf-8 decoding.

Fixes #70061

(cherry picked from commit 6a0789dc7f)
2026-08-04 15:28:27 +00:00
Angular Robot 6c6f3d346f build: lock file maintenance
See associated pull request for more information.
2026-08-04 08:26:26 -07:00
Shuaib Hasan Akib 3478df716e refactor(compiler): remove unused code and exports
Removes unused code and exports that are no longer referenced anywhere
in the compiler codebase.

(cherry picked from commit 337053ef1a)
2026-08-03 16:42:12 +00:00
Suraj Yadav 832ff2aff3 test(platform-server): add SSR integration test for null and normal input values
Fixes #69785

Add an Angular SSR integration test in platform-server verifying that null input values do not render string attributes like value="null" during server-side rendering, while normal non-empty string values like value="hello" are properly preserved.

(cherry picked from commit fb698d12cd)
2026-08-03 16:30:48 +00:00
Kam baff4d07aa fix(docs-infra): keep inline code in links as an atomic inline box
Inline code inside a link renders as a chip with its own background. Text
decoration propagates from the anchor and cannot be cancelled by a descendant,
so with the chip laid out as a regular inline box the link underline is drawn
straight across it.

Lay the chip out as an atomic inline box, which the propagated decoration is not
drawn across. This applies to the link rule only; code outside of links keeps
`display: inline` for wrapping in multiline paragraphs, and the link rule
already sets `white-space: nowrap`.

(cherry picked from commit efe1aae1cd)
2026-08-03 16:20:18 +00:00
SkyZeroZx 6b643ab037 refactor(common): modernize directive tests to rely on whenStable
Replace synchronous detectChanges calls with zoneless-compatible scheduling and stability waits. Preserve NgComponentOutlet coverage for components declared by NgModules.

(cherry picked from commit c9c4f2afc6)
2026-08-03 16:13:36 +00:00
Kam 79a819379f docs: fix roadmap link text and preview-site link
Two link issues on the roadmap page:

- "Introduce deferred loading" linked next.angular.dev, the preview build of
  this same site, for a page that exists here at guide/templates/defer. Use the
  relative path so readers stay on the stable docs.
- "Local template variables" linked "`@let` docs", putting a code chip and a
  plain word in one anchor. The anchor's underline crosses the chip and the two
  halves render in different colors. Link only the symbol, as the rest of adev
  does.

Also on the same page:

- Drop a stray space before a period in the Components card.
- Give the older completion labels the same "Completed in <quarter>" wording the
  newer cards already use.

(cherry picked from commit f2f12925bd)
2026-08-03 15:58:40 +00:00
Angular Robot 5e1d535868 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-08-03 08:56:14 -07:00
Matthieu Riegler 3d0067ad98 refactor(animations): remove outdated comment
This isn't necessary anymore.

(cherry picked from commit 1b13db7a1b)
2026-07-31 22:34:08 +00:00