37685 Commits

Author SHA1 Message Date
Alan Agius 5ba6443e12 release: cut the v22.0.3 release v22.0.3 2026-06-25 17:10:29 +02:00
kirjs f4f7f3755c fix(compiler): remove unused import breaking CI in 22.0.x
The import of createContentBlock from ./r3_content_blocks was erroneously included in a cherry-pick but the file does not exist in this branch.
2026-06-25 06:59:05 -04:00
JoostK f90c20df40 fix(compiler): account for NgModule dependencies in JIT-compiled partial declarations
When partial declarations are not preprocessed to AOT by the linker, the `ngDeclareComponent`
call causes them to be compiled ad-hoc. In this mode, NgModule imports in standalone components
would be dropped, deviating from the linker. This commit changes the ad-hoc compilation of
component declarations to pass the NgModule imports along just like the linker does.

Fixes #69451

(cherry picked from commit ecd047578e)
2026-06-24 14:46:48 -04:00
Matthieu Riegler 489d1707d7 refactor(compiler): desable the legacy template syntax
This disables the legacy `bind`, `bindon-`, `on-`, `let-` `ref-` syntax in g3 ONLY.
This is mostly to evaluate the blast radius

(cherry picked from commit f9c4b71488)
2026-06-24 14:35:17 -04:00
Matthieu Riegler 01d58d7ad7 refactor(core): Tree shake the SimpleChanges & co.
Any application that doesn't use the `ngOnChanges` hook shouldn't pull its code.

(cherry picked from commit 4744bab38e)
2026-06-24 13:04:40 -04:00
Matthieu Riegler 2353bf22a5 refactor(forms): widen AsyncValidatorOptions.factory
This is to accept `Resource` and not only `ResourceRef`.

fixes #69443

(cherry picked from commit 63c7ac325d)
2026-06-24 13:03:41 -04:00
arturovt b0569fdb3f fix(zone.js): harden zoneSymbolEventNames and patches against __proto__ key
Initialize `zoneSymbolEventNames` and `patches` with `Object.create(null)` instead of `{}`.

This is a hardening change rather than a fix for an exploitable vulnerability. Calling `addEventListener('__proto__', fn)` is not directly attacker-controlled; its presence already implies an application bug. However, if such a call does occur, the current implementation can behave unexpectedly depending on the environment.

For `zoneSymbolEventNames`, accessing `zoneSymbolEventNames['__proto__']` on a plain object invokes the inherited `__proto__` accessor and returns `Object.prototype`, which is truthy. This causes `prepareEventNames()` to be skipped, leaving `symbolEventName` undefined and eventually leading to a runtime error when `window['undefined'] = []` is executed.

In Node.js environments running with `--disable-proto=throw`, the assignment:

```ts id="z8n4qm"
zoneSymbolEventNames['__proto__'] = {};
```

throws immediately because it triggers the disabled `__proto__` setter.

The `patches` registry has a similar issue. A `__proto__` key passed to `__load_patch()` bypasses the duplicate-patch check and reaches:

```ts id="f3v7kx"
patches['__proto__'] = fn(...);
```

which invokes the `__proto__` setter and changes the prototype of the `patches` object.

Using `Object.create(null)` removes the inherited `__proto__` accessor entirely, causing these keys to behave like ordinary properties rather than interacting with JavaScript's prototype machinery.

As part of this change, `patches.hasOwnProperty(name)` is also updated to:

```ts id="n2c8wp"
Object.prototype.hasOwnProperty.call(patches, name)
```

since null-prototype objects do not inherit `hasOwnProperty`.

(cherry picked from commit 2d33fd55ff)
2026-06-24 12:19:35 -04:00
arturovt bcc648f4b6 fix(upgrade): support model() signals in downgradeComponent
`model()` signals are special because they combine a signal input with a writable output through an internal `OutputEmitterRef`. During upgrade, `setupOutputs()` subscribes to that emitter to keep Angular → AngularJS two-way binding working.

The issue was that `updateInput()` could overwrite the signal property directly when `isSignal` was `false` (which happens in JIT mode and when `unsafelyOverwriteSignalInputs` is enabled). Once that happened, the original `OutputEmitterRef` was lost, so the two-way binding stopped working.

The fix detects `model()` signals at runtime by checking for both `[SIGNAL]` and a writable `.set()` method, which distinguishes them from read-only `input()` signals. When those traits are present, updates are always applied through `applyValueToInputSignal()` instead of replacing the property directly, regardless of the `unsafelyOverwriteSignalInputs` setting.

Fixes #60599

(cherry picked from commit 8d31b82116)
2026-06-24 12:17:38 -04:00
SkyZeroZx a16f9b2263 fix(service-worker): preserve referrer policy in asset requests
Preserve explicit referrer policy when the service worker reconstructs asset requests for cache-busted and redirected asset fetches.

For example, an application can load a script or image with referrerPolicy: 'same-origin' or 'origin' to limit referrer data. Dropping that policy can expose more of the current URL to that resource host.

(cherry picked from commit 6f98f98f1f)
2026-06-24 12:15:20 -04:00
SkyZeroZx b4a5a2fb4e fix(service-worker): preserve referrer in asset requests
Preserve referrer metadata when the service worker reconstructs asset requests for cache-busted and redirected asset fetches.

For example, an attacker with access to asset host logs could receive a reset token embedded in a page URL if the reconstructed request falls back to default referrer behavior instead of carrying referrer: ''.

(cherry picked from commit 716f9eb032)
2026-06-24 12:15:20 -04:00
aparziale 06d854929c fix(compiler-cli): report diagnostic instead of crashing on malformed host binding
`parseHostBindings` throws plain `Error`s for malformed host bindings
(e.g. a property binding with a non-static value, as can happen while
editing in the language service). These were uncaught during directive
analysis, crashing the compiler and the Angular Language Service.

Wrap the call and surface the error as a `FatalDiagnosticError` so it
becomes a diagnostic and analysis can complete normally.

Fixes #69106

(cherry picked from commit 8b2785b597)
2026-06-24 12:14:27 -04:00
Kam d2b613900c docs(forms): clarify debounce('blur') usage with custom FormValueControl
A custom FormValueControl only participates in debounce('blur') if it emits
the touch output on the native blur event. This was undocumented, and the
touch name reads like a focus event, so users wired it to (focus) and
blur-based debouncing silently did nothing.

Add a dedicated guide section with a working example, link the debounce API
reference to it, and clarify the touch JSDoc that it must fire on blur, not
focus.

Fixes #69370

(cherry picked from commit 12fcec8ce9)
2026-06-24 11:38:52 -04:00
SkyZeroZx cd8f472ab4 docs: add documentation for HttpClient response body size limit and related error NG02825
(cherry picked from commit e5098f00d5)
2026-06-24 11:29:25 -04:00
Modeste ASSIONGBON 9a81d30a58 docs: add doc to focusBoundControl feature
(cherry picked from commit edea40b5a0)
2026-06-24 11:26:32 -04:00
cexbrayat 2d4b57c906 docs: clarify signal forms limit metadata keys
Explain that MIN and MAX are selection keys which point to the type-specific limit metadata keys, such as MIN_NUMBER, MIN_DATE, MAX_NUMBER, and MAX_DATE.

Also list minDate() and maxDate() alongside min() and max() in the Signal Forms metadata docs, so the validator tables match the actual metadata model.

(cherry picked from commit a3a9308894)
2026-06-24 11:26:01 -04:00
Shuaib Hasan Akib 8da801f396 docs: standardize padding and margin for insert-container
(cherry picked from commit 64bb7adda0)
2026-06-24 11:25:27 -04:00
Saurabh Singh 03d1a6444a docs(core): document resource chaining with chain() in params context
Adds a 'Chaining resources' section to the resource guide covering:
- Basic usage of chain() to depend one resource on another
- Status propagation for all ResourceStatus values (idle, loading,
  reloading, error, resolved, local)
- Chaining vs reading .value() directly, shown as an avoid example
- Guidance on passing the chained value directly as params

Also adds an @see link from ResourceParamsContext to the new section.

Closes #69329

(cherry picked from commit 7057b1257f)
2026-06-24 11:23:53 -04:00
arturovt 3d536d7a84 docs: add error guide for NG05102
Adds an error reference page for NG05102 (UNSUPPORTED_EVENT_TARGET) explaining
what triggers it and how to fix it. Also marks the error code as negative (-5102)
so that in dev mode the error message automatically links to the new guide page
on angular.dev/errors, consistent with other documented runtime errors.

(cherry picked from commit ea177257e9)
2026-06-24 10:58:31 -04:00
SkyZeroZx 8cdc202dfc fix(http): prevent caching of responses with Set-Cookie headers
Skip HttpTransferCache serialization for HTTP responses that contain a
Set-Cookie header.

Cookie-setting responses commonly represent session-specific,
user-specific, or security-sensitive state. Serializing their bodies into
SSR TransferState can embed sensitive data into the generated HTML, where
it may be reused during hydration or replayed by a shared cache/CDN.

(cherry picked from commit f76e8a98c1)
2026-06-24 10:57:49 -04:00
Matthieu Riegler 39001be266 refactor(compiler): Move the attribute comment to the HTML AST
This is to help the support for comment formating by third-party tools like prettier.

(cherry picked from commit 826017dd31)
2026-06-24 10:56:39 -04:00
Angular Robot 9d1d1de8fb build: update dependency node to v22.23.1
See associated pull request for more information.
2026-06-24 10:36:26 -04:00
Angular Robot 6ff26e96e4 build: update babel monorepo to v7.29.7
See associated pull request for more information.
2026-06-24 10:35:42 -04:00
Angular Robot f2d3bb16c5 build: update pnpm to v10.34.4
See associated pull request for more information.
2026-06-24 10:35:18 -04:00
Angular Robot b7ab51d7ac build: update all github actions to v6.0.9
See associated pull request for more information.
2026-06-23 15:03:16 -04:00
yamanerkam 01cef1aec3 fix(docs-infra): keep footer headings on a single line
The "Community translations" column heading wrapped to two lines while
the other footer headings stayed on one. Add a `white-space: nowrap`
rule on the footer headings, scoped to the wide (4-column) layout. The
breakpoint is driven by a shared `$columns-breakpoint` variable so the
nowrap rule and the grid's 2-column collapse stay in sync.

(cherry picked from commit af14ce16cf)
2026-06-23 14:59:40 -04:00
Angular Robot 50f252ecb4 build: update bazel dependencies
See associated pull request for more information.
2026-06-23 14:16:06 -04:00
Kristiyan Kostadinov 2799304259 fix(core): avoid uncaught promise errors in injectAsync prefetching
Fixes a minor issue where the `preload` function in `injectAsync` might cause an uncaught promise error.

I also fixed that in `onIdle` we were passing the wrong function into `assertInInjectionContext`.

(cherry picked from commit 91d168e74b)
2026-06-23 12:57:30 -04:00
yamanerkam 9e9b7e7eb4 docs: remove space before question mark in landing page heading
The bottom CTA heading on the landing page read "Want to learn more about
Angular ?" with a space before the question mark, while the matching heading
higher up the page correctly had no space. Removed the space so both read
"Want to learn more about Angular?".

(cherry picked from commit 7421124956)
2026-06-23 12:56:05 -04:00
arturovt f598dcfda0 docs: add error guide for NG05101
Adds a new error reference page for NG05101 (NO_PLUGIN_FOR_EVENT),
which is thrown when no registered EventManagerPlugin supports the
event name passed to addEventListener. The page covers the two common
causes: a typo in the event binding and a missing plugin provider.

(cherry picked from commit dead64fbdb)
2026-06-23 11:25:52 -04:00
SkyZeroZx 5979217e82 docs: Add docs for markAsTouched with skipDescendants
(cherry picked from commit 7fc46ed3a1)
2026-06-23 11:22:09 -04:00
Angular Robot 7766dc0ef4 build: lock file maintenance
See associated pull request for more information.
2026-06-23 10:44:38 -04:00
yamanerkam 261d487a76 docs: add missing space before decorator link in components guide
The `@Component` inline-code span was directly adjacent to the
`[decorator](...)` link, rendering as a mashed-together token in the
source. Added a space so it reads "A `@Component` [decorator] that..."
as intended.

(cherry picked from commit a4e9ff1e0c)
2026-06-23 09:48:20 -04:00
aparziale d817e56493 docs: show selected menu item visually in context menu example
Replace console.log with a lastAction signal and render the result in a styled <p> element with a fade-in animation.

(cherry picked from commit 69ac1d5ee8)
2026-06-22 16:46:57 -04:00
Kam 59ee51e2d4 docs(forms): update package docs for Signal Forms graduation
After #68581 graduated the Signal Forms APIs to public API and #68654 removed
the experimental warnings from the Signal Forms documentation in adev, the
package READMEs still framed the API as experimental.

Update `packages/forms/signals/PACKAGE.md`: drop the experimental title and
intro, remove the now-shipped entries from "Not yet supported" (interop with
reactive/template forms and strongly-typed binding to UI controls), and remove
the remaining experimental and exploratory wording from the FAQ.

Update `packages/forms/PACKAGE.md`: it listed only two ways to build forms
(reactive and template-driven). Add signal forms as the third.

Fixes #68724

(cherry picked from commit 8b1726a1cf)
2026-06-22 16:29:22 -04:00
Kam c4d135df45 fix(docs-infra): remove white flash on example viewer tab labels
The code tabs rendered by the example viewer (e.g. the npm/pnpm/yarn/bun
install tabs) paint their active label as transparent text clipped to a
gradient. Material's MDC tab styles add `transition: color 0.15s linear`
to `.mdc-tab__text-label`, plus a 100ms delay on the active tab. Because
that transition animates `color` from the solid label color to
transparent, the solid color stays visible on top of the gradient for
~100ms when a tab is activated, which reads as a white flash.

Disable the transition on these labels so the color switches instantly,
and target `.mdc-tab__text-label` directly (instead of a generic `span`)
so `color: transparent` drives the gradient clip cleanly.

(cherry picked from commit 642165f6fc)
2026-06-22 16:28:01 -04:00
Angular Robot a477a6990c build: update dependency node to v22.23.0
See associated pull request for more information.
2026-06-22 16:12:46 -04:00
Matthieu Riegler 6342099e55 docs(docs-infra): use ^22.0 for the tutorials
fixes #69438
2026-06-22 16:10:50 -04:00
Kam 0cd3d50de3 fix(docs-infra): prevent inline code in table headers from wrapping mid-word
When a documentation table has a wide content column, the narrow header
columns get squeezed and inline-code header labels break mid-word at
their hyphens. On the MCP server tools page this rendered the `local-only`
and `read-only` column headers as `local-` / `only` and `read-` / `only`.

Apply `white-space: nowrap` to `code` inside `th` so header tokens stay on
a single line. The rule is scoped to headers, whose labels are always
short, so long code signatures in body cells continue to wrap and no
table gains a horizontal scrollbar.

(cherry picked from commit 50bb0d6bfe)
2026-06-22 16:05:49 -04:00
Kam aaac1bcd79 fix(devtools): restore build under stricter ts_project deps
The rules_angular bump in #69410 made ts_project require every `deps`
entry to provide the JsInfo provider. `esbuild_base` listed
`//packages:package_json` in its deps, but `esbuild-base.config.mts` never
imports or reads package.json, so the dependency is unnecessary and now
breaks analysis (`//packages:package_json` is a `copy_to_bin` target that
provides only DefaultInfo). Remove it.

(cherry picked from commit aa7d9fcc61)
2026-06-19 11:37:22 +02:00
Kam 0db4bb0eb0 fix(docs-infra): restore adev build under stricter ts_project deps
The cross-repo dependency update in #69410 bumped rules_angular, whose
ts_project now requires every entry in `deps` to provide the JsInfo
provider. Two adev targets passed deps that don't, so `bazel build
//adev:build` fails analysis and the adev CI check has been red on main
since that PR.

Make generate_nav_items return JsInfo (with the generated routes.json as
its sources) so navigation-entries can keep importing routes.json through
its deps. Also drop the spurious deps entry on llms_lib: llms.mts reads
llms-list.md at runtime via readFile rather than importing it, and the
file is already provided to the binary via data.

Fixes #69429

(cherry picked from commit 350763d84a)
2026-06-19 11:37:22 +02:00
yamanerkam c6b0b87306 fix(docs-infra): align the page title with its edit action
The page title row (`.docs-page-title`) relied on the default flex
alignment, so the edit icon next to the title did not line up with the
title text. Add `align-items: baseline` so the icon sits on the title's
baseline.

(cherry picked from commit e77a8a0c7a)
2026-06-18 14:06:26 -04:00
Joey Perrott 7544593b39 ci: update dev-infra release workflow SHA
Updates the reusable release workflow reference to point to the latest merged commit in dev-infra containing the resilient publish fixes.

(cherry picked from commit ebe92fe291)
2026-06-18 14:05:35 -04:00
Jessica Janiuk 3e7c83b0a3 Revert "fix(core): escape overlapping comment delimiters in escapeCommentText"
This reverts commit ea1a3ed64c.

(cherry picked from commit a849b6fbfd)
2026-06-18 12:34:29 -04:00
yamanerkam 73880c55fd fix(docs-infra): correct select dropdown scrolling, sizing, and selection
Several issues in the shared docs `Select` component (used by the API
reference package filter):

- The options list never scrolled: its element used a class with no styles,
  so the intended max-height/overflow rule was dead. Point it at the styled
  class so long lists scroll within the popover.
- Selecting an option now closes the popup instead of leaving it open.
- Clip the trigger and popover corners (overflow: hidden) so their rounded
  borders render cleanly, and align the popover width with the trigger.
- Drop the selected-option checkmark. The component is single-select and
  already marks the selection with a highlight, so the tick was misleading.
- Remove the unused `disabled` input.

(cherry picked from commit ffcc8eee98)
2026-06-18 10:52:40 -04:00
yamanerkam ece8ba4922 docs: use the @Service decorator in the first-app and signals tutorials
Update the services in the first-app and signals tutorials to use the
`@Service()` decorator instead of `@Injectable({providedIn: 'root'})`.
This affects `HousingService` (first-app steps 10-14) and `CartStore`
(signals step 7).

(cherry picked from commit e7a4e25318)
2026-06-18 10:48:06 -04:00
Matthieu Riegler 291d574b1d docs(docs-infra): remove deprecated ts flags
This fixes the playground & tutorials

(cherry picked from commit c23ddd6a99)
2026-06-18 15:29:44 +02:00
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