37639 Commits

Author SHA1 Message Date
Jessica Janiuk aac85773cb release: cut the v22.0.2 release v22.0.2 2026-06-17 14:08:08 -07:00
Angular Robot 1d0256bfa7 build: update cross-repo angular dependencies to 1ce5d68
See associated pull request for more information.
2026-06-17 13:58:05 -07:00
Joey Perrott 52f5501795 ci: update dev-infra reference to new commit SHA
Updates the reusable release workflow reference to use the new commit SHA 1ce5d6899a2634fccf021a84656026bed0acbe16 from angular/dev-infra PR 3796.

(cherry picked from commit 45192ba749)
2026-06-17 20:10:47 +00:00
Cameron Smick 152601ed94 refactor(core): add childSignalProp to ReactiveNodeKind
Add `childSignalProp` to `ReactiveNodeKind` in order to consolidate `ReactiveNodeKind` types and enable Client-Only Wiz to use it.

(cherry picked from commit ae6d8dae75)
2026-06-17 20:03:17 +00:00
arturovt 59dea13f80 fix(core): guard against DOM clobbering in declareExperimentalWebMcpTool
Previously, the modelContext truthiness check could be bypassed via DOM
clobbering (e.g. `<form id="modelContext">`), causing a truthy HTMLElement
to pass the guard and then throw when `registerTool` was called on it.

Replace the truthiness check with a duck-type check that asserts
`registerTool` is a function, rejecting both absent and clobbered values.

(cherry picked from commit 8cf7731468)
2026-06-17 20:02:14 +00:00
Andrew Scott 81cb4570b2 refactor(router): Add handling for ActivatedRoute-scoped injector
Add handling in navigation for creating and destroying injectors scoped
to `ActivatedRoute` life.
The code for creating the injectors is certainly more complicated
than it _could_ be since there's no actual feature built around this yet.

Keeps as much implementation code tree-shakeable as possible:
Raw size: +764 bytes
Gzipped size: +182 bytes

(cherry picked from commit 1e79dd3140)
2026-06-17 18:39:17 +00:00
Joost Koehoorn f902d1d35e perf(core): detect existing signal dependency without checking all producer links
This commit addresses a scaling issue in the signal dependency graph where
the detection of duplicate dependency links would perform a linear scan across
all consumer links of all producers. The linear scan is replaced with a version
comparison of the dependency edge against the current epoch; if they are
equal the existing dependency edge is known to be valid in this epoch. This means
that the link won't be eligible for removal and therefore doesn't have to be
recreated.

(cherry picked from commit 327744ac17)
2026-06-17 18:38:09 +00:00
rootvector2 e17e8d5422 fix(core): escape overlapping comment delimiters in escapeCommentText
`COMMENT_DISALLOWED` is matched globally, so overlapping delimiter
sequences are skipped: `<!-->` only escapes the leading `<!--` and
leaves a live `-->` that can close a programmatically created comment
node early. Drop the `^` anchors so a standalone `>`/`->` is escaped
wherever it appears, which neutralizes the trailing delimiter left
behind by an earlier match.

(cherry picked from commit ea1a3ed64c)
2026-06-17 18:37:12 +00:00
Joey Perrott e3d392f2bf ci: add id-token: write permission to release workflow
Adds id-token: write permission to the release workflow to allow the called reusable workflow to generate NPM provenance metadata during publishing.

(cherry picked from commit ea18ab24dd)
2026-06-17 17:32:32 +00:00
Angular Robot 0f9f7742b1 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-06-17 10:31:42 -07:00
aminesbdev 27a8f34c2b docs(docs-infra): update environment configuration examples and remove production flag
(cherry picked from commit a89ab78a11)
2026-06-17 17:01:40 +00:00
aminesbdev 6ce12d2d9e docs(docs-infra): add environment runtime configuration
Add a new reference explaining Angular environment configuration strategies,
including both build-time and runtime approaches.

Register the reference in SKILL.md so it is discoverable by the skill system.

(cherry picked from commit 0a06167208)
2026-06-17 17:01:40 +00:00
Angular Robot 8dec7753a3 build: lock file maintenance
See associated pull request for more information.

Closes #69368 as a pr takeover
2026-06-17 09:59:32 -07:00
Andrew Scott 74f2b91c12 refactor(compiler): correct TcbInvalidReferenceOp initializer
initializer should use null! as any rather than simply '= any'

(cherry picked from commit a5ee50beac)
2026-06-17 15:14:55 +00:00
Joey Perrott 91c7e61db5 ci: update reusable release workflow target SHA, pass robot key, and downgrade permissions
Updates the reusable workflow reference to target the merged dev-infra commit e9faacd5b4df391f59989b6fb448b2c24115d592. Passes the ANGULAR_ROBOT_PRIVATE_KEY secret as angular-robot-key. Downgrades default contents permission to read as write access is handled by the App token in the custom action.

(cherry picked from commit a7d142913f)
2026-06-17 15:11:04 +00:00
Joey Perrott 0ec5273524 ci: introduce GHA release publish workflow
Introduce the caller GitHub Actions workflow for release publishing, which delegates the build and publish steps to the centralized reusable workflow in dev-infra. This targets the merged reusable workflow in dev-infra by SHA.

(cherry picked from commit 182fbb8476)
2026-06-17 15:11:04 +00:00
Angular Robot 0f1cfe3082 build: update cross-repo angular dependencies to v22.0.2
See associated pull request for more information.
2026-06-17 08:05:50 -07:00
rudzikdawid 35219dcac3 fix(docs-infra): increase SSR fetch limit to prevent 404 on page reload
Navigating to specific ARIA guide pages directly or via hard refresh
causes a 404 error because the payload exceeds the default SSR fetch
limit. This commit increases the maxResponseBodySize to 2MB.

(cherry picked from commit 02d6b436f1)
2026-06-17 15:03:59 +00:00
Alex Rickabaugh ffbbbf9129 refactor(compiler): add support for @Input transforms under isolatedDeclarations
Adds support for `@Input` transform functions in isolated declarations mode (`emitDeclarationOnly: true`), allowing components and directives to specify `transform` functions without triggering fatal compiler errors.

Synthesizes the `ngAcceptInputType_` write type syntactically:
- For referenced functions (`transform: booleanAttribute`), emits `Parameters<typeof booleanAttribute>[0]`, relying on downstream template type checking to resolve the type.
- For inline functions (`transform: (v: string) => boolean`), extracts `parameters[0].type` directly from the local TypeScript AST.

(cherry picked from commit 86ade07de6)
2026-06-16 17:27:23 +00:00
Alex Rickabaugh 568bd3a816 refactor(compiler): add support for host directives under isolatedDeclarations
Removes restrictions around using external references and local directives in `hostDirectives` under isolated declarations mode (`emitDeclarationOnly: true`).

By wrapping the host directive reference in a `WrappedNodeExpr`, TypeScript's declaration emitter seamlessly emits `typeof hostReference.node`, preserving existing imports or local identifiers exactly as authored. Also adds support for translating `PropertyAccessExpression` inside `WrappedNodeExpr` into `QualifiedName` for `.d.ts` emission, ensuring namespace imports (`import * as n from './dir'`) are preserved correctly.

(cherry picked from commit 5d2b1c4100)
2026-06-16 17:27:23 +00:00
SkyZeroZx b32ee7ceb3 fix(core): treat iframe credentialless as security-sensitive
Mark the iframe `credentialless` attribute as security-sensitive so dynamic
bindings are handled consistently with other iframe attributes that affect the
initial navigation, such as `sandbox`, `allow`, `referrerPolicy`, `csp`, and
`fetchPriority`.

Because `credentialless` must be present before the iframe starts loading to
affect the navigation’s credential mode, late dynamic updates can leave the final
DOM looking correct while the initial request was not loaded credentiallessly.

(cherry picked from commit 0152e3cbdf)
2026-06-16 16:05:57 +00:00
yamanerkam f2c5045e0a docs: use the @Service decorator in the learn-angular DI tutorial
The "Creating an injectable service" tutorial introduced services with
`@Injectable({providedIn: 'root'})`, even though the essentials guide and
the in-depth dependency injection guides have already moved to the newer
`@Service` decorator. This left the tutorial out of step with the rest of
the documentation.

Update steps 19 and 20 to use `@Service()`. Because `@Service()` is an
ergonomic shorthand for `@Injectable({providedIn: 'root'})`, the examples
behave identically while teaching the recommended modern API. The step 19
README is reworked to match: it drops the now-unnecessary `providedIn`
configuration step and adds a note linking to the in-depth services guide
for the `autoProvided: false` opt-out.

(cherry picked from commit cbccd368af)
2026-06-16 15:49:09 +00:00
Kristiyan Kostadinov 93d0a5f95c fix(core): prevent unsubscribe during emit from throwing off other listeners
Fixes that when a listener unsubscribes from an `output` within its own callback, it was preventing subsequent listeners from running.

These changes fix the issue by not mutating the array while the emit loop is running, but replacing the listener with `null` and coming back later to remove it.

Fixes #69325.

(cherry picked from commit 28cb15a2bb)
2026-06-16 15:29:36 +00:00
Matthieu Riegler 4183e11aac refactor(devtools): ensure code is escaped
By stringifying twice we ensure the code is escape before building the string template.

(cherry picked from commit 74fa0588b1)
2026-06-16 15:25:40 +00:00
Angular Robot 08f198b4ca build: update cross-repo angular dependencies
See associated pull request for more information.
2026-06-16 08:20:48 -07:00
Andrew Scott fef8bcfb38 refactor(compiler-cli): Export indexer API for use in hybrid analysis
exports indexer API for use in hybrid analysis

(cherry picked from commit 83622ee519)
2026-06-15 18:53:40 +00:00
Andrew Scott be45e8e7cb refactor(compiler-cli): Change indexComponent file to be fileUrl
We do not need ParseSourceFile which contains the whole content. Only the file url is ever used.

(cherry picked from commit 21fccd4038)
2026-06-15 17:56:55 +00:00
Matthieu Riegler f309727ada refactor(compiler): Collect in-element comments
PR #67179 forgot to implement that part.

(cherry picked from commit 471dcb42ca)
2026-06-15 17:54:09 +00:00
SkyZeroZx 528a34f766 fix(core): avoid caching missing locale data
Only cache locale data loaded from the global locale registry when an actual locale entry is found.

This prevents attacker-controlled missing locale identifiers from being retained indefinitely in SSR when locale lookup falls back to a parent locale or the built-in English locale, avoiding unbounded process memory growth in locale-aware pipes and formatters.

(cherry picked from commit 98f42eaaae)
2026-06-15 17:53:12 +00:00
Alan Agius 6f1171991a fix(compiler): restrict possible event handler check to property names longer than 2 characters
Previously, the compiler disallowed translation of any attribute starting with 'on' for security reasons. This incorrectly disallowed translation of the 'on' attribute itself, which is not an event handler.

This commit introduces `isPossibleEventHandler` to verify that the property name has a length greater than 2 in addition to starting with 'on'. This allows attributes like 'on' to be translated while still correctly disallowing actual event handlers like 'onerror', 'onclick', etc.

(cherry picked from commit 417a4071a7)
2026-06-15 16:23:53 +00:00
Andrew Scott 06e9dbf9a5 refactor(core): ɵɵgetInheritedFactory should accept abstract type
An abstract component or directive can extend another class, meaning
ɵɵgetInheritedFactory needs to allow abstract

(cherry picked from commit 2112edefe1)
2026-06-15 16:22:39 +00:00
Angular Robot dad4169cbd build: update cross-repo angular dependencies
See associated pull request for more information.
2026-06-15 09:19:58 -07:00
Kam 929a1553f2 fix(docs-infra): align homepage banner and search field
The homepage hero lays out the announcement banner and the search field on
the same flex row. The `.search-field` wrapper was a plain block, so its
`docs-text-field` kept its intrinsic height instead of filling the row,
leaving the two pills at different heights and vertically misaligned.

Make `.search-field` a flex container so the search control stretches to the
row height and matches the banner.

(cherry picked from commit 4ba8ba4ef2)
2026-06-15 16:15:33 +00:00
Kam fe7f9ed505 fix(docs-infra): center social and theme menus under their triggers on tablet
On tablet the social and theme mini-menus didn't line up with the buttons that
open them.

All three mini-menus now share one tablet positioning rule on `.adev-mini-menu`
that centers each panel under its trigger, with `--social`/`--theme`/`--version`
modifiers selecting the anchor; the version picker's on-screen behavior is
unchanged. The social trigger also gains `aria-controls` + a matching menu `id`
for a11y parity with the theme trigger.

(cherry picked from commit 50e7f3a1cd)
2026-06-15 15:59:22 +00:00
Kam eafdbe008a fix(docs-infra): use a facade for docs-video to fix Firefox embeds
Follow-up to #69205. After switching adev's COEP to `credentialless`, the
cross-origin YouTube iframe in `<docs-video>` loads in Chromium and Safari but
not Firefox, whose `credentialless` policy does not extend to nested frames. The
result was a COEP error screen instead of the player.

Render `<docs-video>` as a lightweight thumbnail facade instead of embedding the
iframe directly. The thumbnail is a cross-origin subresource, so it loads under
`credentialless` in every browser. `DocViewer` then upgrades the facade to the
inline player on hydration in browsers that can load the embed (Chromium,
Safari), preserving the previous behavior there. On Firefox the facade stays a
plain link that opens the video on YouTube (with autoplay), which replaces the
error screen.

The thumbnail uses `maxresdefault` and falls back to `hqdefault` when a video
has no max-resolution image.

(cherry picked from commit 43acead06d)
2026-06-15 15:58:04 +00:00
Matthieu Riegler bbd056919f docs: add item about the resource breaking change.
In #67382 we changed how values are resolved which ended up being a breaking change for some unit tests.

fixes #69360

(cherry picked from commit 3b8bb7219b)
2026-06-15 15:57:06 +00:00
kirjs 34f9539623 docs(forms): use touch.emit() in custom controls example
(cherry picked from commit c0e2364f12)
2026-06-15 15:56:17 +00:00
Angular Robot 3856ef7b98 build: update pnpm to v10.34.3
See associated pull request for more information.
2026-06-15 08:54:56 -07:00
whit33y 1d973551d1 docs: clarify value attribute on radio/checkbox inputs is allowed with formField
(cherry picked from commit 40f7fbdccb)
2026-06-12 17:16:48 +00:00
aparziale 15314c1736 fix(migrations): migration skip any target are not build or test
Fix migration behaviout that skip any target are not build or test

Fixes #66865

(cherry picked from commit 58efd86c78)
2026-06-12 16:24:47 +00:00
Alan Agius 8bb3947e99 refactor: optimize dom security schema lookups
Restructure the security schema map to index by property name instead of tag name, improving lookup efficiency.

(cherry picked from commit 32d7315094)
2026-06-12 16:20:40 +00:00
hawkgs 02c1652091 fix(docs-infra): stabilize html element scroll gutter
Stabilize `<html>` scroll gutter.

Fixes #69036

(cherry picked from commit db677a4349)
2026-06-12 16:19:36 +00:00
hawkgs b7aa8dca6b fix(docs-infra): add explicit font styles to docs-primary-btn
Add font family, size and weight to the `.docs-primary-btn`. This guarantees that applying the class to non-button elements, like anchors, will results in the same visual representation.

(cherry picked from commit 91ab7c6dea)
2026-06-12 16:08:06 +00:00
Angular Robot d45e318afd build: update pnpm to v10.34.2
See associated pull request for more information.
2026-06-12 08:26:26 -07:00
Angular Robot e74b8840a1 build: update cross-repo angular dependencies to 11ee1f5
See associated pull request for more information.
2026-06-12 08:17:28 -07:00
Andrew Scott 0f68807836 refactor(core): ComponentDef should allow abstract types too
d1539a8513 incorrectly assumed components wouldn't be abstract but
it is still possible (though probably should be an abstract directive instead).

(cherry picked from commit 8984c59626)
2026-06-11 20:08:13 +00:00
Jessica Janiuk 3013982f75 release: bump VSCode extension version to 22.0.1 (#69318) vsix-22.0.1 2026-06-11 11:25:46 -07:00
Kai Guo 3a48abc15c fix(core): preserve leave animation for sibling instances sharing a TNode
`animate.leave` was skipped — the element was removed from the DOM
synchronously instead of running its leave animation — whenever a
sibling instance of the same template entered in a different DOM parent
during the same change-detection tick (e.g. an exclusive-expansion
accordion or nav where opening section B collapses section A).

`leavingNodes` is keyed by `TNode`, which is shared by every instance of
a template. When a node was inserted, `cancelLeavingNodes` force-removed
any tracked leaving node whose DOM parent differed from the entering
node's parent (the `leavingParent !== newParent` branch added to
de-duplicate a dynamic component re-rendered into a fresh overlay pane).
For two distinct live sibling instances that merely share a `TNode`,
"different parent" is the normal situation, so the still-animating
sibling was ripped out.

Track the declaration view of each leaving element alongside it, and
only perform the cross-parent removal when the entering element belongs
to the same declaration view as the leaving one — i.e. the same logical
view re-rendered, the case the branch was written for. Two distinct
instances of a shared template have different declaration views, so
their `animate.leave` is now left to run to completion.

This preserves the dynamic-component/overlay de-duplication (#67032) and
the drag-and-drop node-move rescue (#67361), which are unchanged.

Fixes #69291

(cherry picked from commit 6b5616b2c7)
2026-06-11 17:39:01 +00:00
Hexix23 6867f77ec7 fix(http): distinguish repeated transfer cache params
Serialize transfer cache request parameters without comma-joining repeated values so distinct HttpClient requests cannot reuse the same cached response.

(cherry picked from commit a6c7fc5c13)
2026-06-11 16:59:31 +00:00
SkyZeroZx 6c1f3e9d49 fix(common): skip transfer cache for uncacheable HTTP traffic (#69316)
Do not store HTTP transfer cache entries when either the request or response
uses `Cache-Control: no-store`, `Cache-Control: private`, or
`Cache-Control: no-cache`.

Also skip transfer cache when requests use the Fetch API `cache` option with
`no-store` or `no-cache`.

Because transfer cache serializes SSR HTTP responses into the rendered HTML,
Angular now treats these directives conservatively to avoid exposing sensitive
or explicitly uncacheable data through `TransferState`.

PR Close #69316
2026-06-11 16:58:24 +00:00