38764 Commits
Author SHA1 Message Date
Alon Mishne d9514bbe66 release: cut the v22.2.3 release v22.2.3 2026-10-14 16:38:54 -07:00
Amine 54f3de517c fix(compiler): check @boundary blocks in the control flow content projection diagnostic
Like `@if`, `@for` and `@switch`, a `@boundary` block copies the tag name
and attributes of its single root node, so the node can be projected into a
specific `ng-content` slot. The `controlFlowPreventingContentProjection`
diagnostic (NG8011) didn't look at `@boundary` blocks though, so an element
next to a second root node was silently projected into the default slot.

`@error` blocks are left out on purpose: they don't copy the tag name and
attributes of their root node, so the diagnostic's suggestions wouldn't apply.

Fixes #71288
2026-10-14 13:04:31 -07:00
Shuaib Hasan Akib 5e50658fd2 fix(compiler): compare the operand in ReadTemporaryExpr.isEquivalent
`ReadTemporaryExpr.isEquivalent()` didn't take the expression it was
compared against and compared its own `xref` with itself, so a temporary
read was considered equivalent to any expression, including reads of other
temporaries and unrelated expressions like literals.

Compare against the given expression instead, like the other IR
expressions do: it's only equivalent to a read of the same temporary.

No miscompilation is known to be caused by this, since temporaries are
usually converted to variables before expressions are compared, but the
result was wrong for any caller that compared them earlier.

(cherry picked from commit 3aaf026486)
2026-10-14 20:03:19 +00:00
Matthieu Riegler 90af679c3b fix(core): do not swallow compilation errors in computeStandaloneComponentScope
Previously, computeStandaloneComponentScope called verifyStandaloneImport inside a try/catch block to check whether an imported type was standalone or an NgModule. In JIT mode with ngDevMode=false, verifyStandaloneImport is the first place that reads the lazy definition getter (e.g. ɵdir) of an imported directive, which triggers JIT compilation of that directive. Any compilation error thrown while compiling the imported directive (such as an invalid host binding like @HostBinding('attr.onclick')) was caught by the try/catch block and silently swallowed by poisoning the scope instead of surfacing the error.

Check isNgModule and isStandalone directly (matching computeNgModuleScope) so that compilation errors thrown when evaluating imported definitions are not swallowed.

(cherry picked from commit 54acced1d7)
2026-10-14 20:02:51 +00:00
arturovt eca5fa4665 fix(core): don't crash initEventReplay when two apps share an APP_ID
Please note that this change addresses a **real** production issue
observed, rather than a speculative issue identified through
AI-assisted code analysis.

There is no open issue because most people never put two apps with the
same APP_ID on one page.

Prior to this commit, if you bootstrap 2 apps simultaneously, i.e. a
real app + a widget coming from a CDN (the code we don't have control
of, but we only configure the app name in their settings):

```text
TypeError: Cannot read properties of undefined (reading 'c')
```

With this fix, the code no longer fails with a raw type error. It warns
with code NG0511 instead. It does not crash explicitly, because that
might break whenStable().

(cherry picked from commit 3a0835b332)
2026-10-14 20:02:20 +00:00
Angular Robot 3b65dbe41e build: update cross-repo angular dependencies
See associated pull request for more information.
2026-10-14 11:13:56 -07:00
arturovt cc515b8b23 perf(forms): use addEventListener to avoid unconditional CD scheduling on blur
Previously, the blur and input listeners in nativeControlCreate were
registered via host.listenToDom(), which routes through wrapListener and
calls markViewDirty before running the callback. This caused
scheduler.notify() to fire on every blur event, even when the control was
already touched and the signal write was a no-op.

Switch to native addEventListener so that change detection ticks are only
triggered by actual signal changes. Remove the now-unused listenToDom
method from ControlDirectiveHost and its implementation.

(cherry picked from commit 6d36d6c097)
2026-10-14 17:48:24 +00:00
Shuaib Hasan Akib 5761e25356 docs(router): fix the async resources example in the route resources guide
Only the synchronous part of a route `resources` function runs in an
injection context, so the example that created `resource()` after
`await import(...)` failed the navigation with NG0203. Capture the
injector before the `await` and pass it to the resource.

(cherry picked from commit cbbe89c4d2)
2026-10-14 16:37:58 +00:00
Kam c430634760 docs: fix the Express 5 handler and prerender param types in the SSR guide
The Node.js server sample registers its handler with `app.use('*', ...)`,
which Express 5 rejects with "Missing parameter name". Use the same
pathless handler that new projects generate.

`getPrerenderParams` returns `Promise<Record<string, string>[]>`, so the
ids in its examples are strings.

(cherry picked from commit 3ed4a07b24)
2026-10-14 16:37:30 +00:00
TTNAN 20ef0b90e6 docs: mention linkedSignal set customization in its Skill (fixes #71197)
(cherry picked from commit fdebbbaa5a)
2026-10-14 16:34:34 +00:00
SkyZeroZx f6e775539e docs: clarify fixture.changeDetectorRef behavior with OnPush components
Add a callout explaining that `fixture.changeDetectorRef` belongs to the host view, so its `markForCheck()` does not refresh the template of `OnPush` components. Also update the developer skill and AGENTS.md to prefer signals in tests.

Fixes #71293

(cherry picked from commit 2136a25961)
2026-10-14 12:35:21 +02:00
Shuaib Hasan Akib 90ff2d7992 docs(forms): clarify FormRoot and submit() outcomes in the submission guide
`FormRoot` only calls `submit()` when the form was created with a
`submission` option; otherwise it only prevents the default browser
submission. Also document that `submit()` resolves to `false` when a
submission is already in progress, and rejects when the action throws.

(cherry picked from commit 40bb6df6d8)
2026-10-14 12:34:35 +02:00
Angular Robot bc374ff25b build: update cross-repo angular dependencies
See associated pull request for more information.
2026-10-14 12:33:27 +02:00
Shuaib Hasan Akib dcb29a9fb0 docs: fix @param names that don't match their parameters
The API reference only attaches a `@param` description to a parameter
when the names match. Several APIs documented parameters under a
different name than the one in the signature, so angular.dev rendered
those parameters with an empty description.

Update the JSDoc to use the actual parameter names:

- core: `ViewContainerRef.move()` documented `index` instead of
  `currentIndex`.
- core: `inject()` still documented the `flags` parameter, which was
  replaced by `options` when `InjectFlags` was removed from the public
  API. Use the same description as the other `inject()` overloads.
- core: `twoWayBinding()` documented `eventName` instead of `publicName`.
- common: `Location.subscribe()` documented `value` and `exception`
  instead of the `onNext` and `onThrow` callbacks, and didn't document
  `onReturn`.
- common/upgrade: `UrlCodec.encodeSearch()`, `decodeSearch()`,
  `encodeHash()` and `decodeHash()` documented `path` instead of
  `search` or `hash`, and the first `normalize()` overload documented
  `path` instead of `href`. Also fix a "has string" typo.
- router: `DefaultTitleStrategy.updateTitle()` documented a `title`
  parameter instead of `snapshot`. Also update its description, since
  it builds the title from the router state rather than setting a
  given value.
- forms: `minDate()` and `maxDate()` documented `minDate` and `maxDate`
  instead of `minDateValue` and `maxDateValue`.

Verified by rebuilding the docs with `//adev:build` and checking that
each of these parameters now has a description in the generated API
reference pages, and that no other `@param` name mismatches remain
besides `IterableChanges.forEachOperation` (which documents its
callback's arguments) and the `QueryList` constructor.

(cherry picked from commit 6e024600e0)
2026-10-14 12:32:46 +02:00
jhjh1214 276248ff3d docs(forms): document that minDate and maxDate expect UTC dates
A date input reads and writes `Date` values at midnight UTC, which is how
`valueAsDate` behaves. `minDate` and `maxDate` compare against that value
and format the `min` and `max` attributes with UTC getters, so a limit built
from local time (`new Date(2026, 5, 1)` or `new Date()`) is shifted by the
user's UTC offset. Depending on the time zone, the limit date itself is
rejected or the attribute is a day off.

Add a `minDate() and maxDate()` section to the validation guide, which had
none, and note the UTC contract in the JSDoc of `minDate` and `maxDate`.
Point the `@see` links of those two functions at the new section.

(cherry picked from commit 2a66275511)
2026-10-14 12:30:57 +02:00
Minho Yoo d04f214d04 fix(migrations): normalize .d.ts paths in output migration field IDs
getUniqueIdForProperty called id.replace(/\.d\.ts$/, '.ts') and dropped
the result, so an @Output seen through a .d.ts got a different ID than
the same output in its .ts source. The signal input and signal queries
migrations already assign the normalized ID.

Claude-Session: https://claude.ai/code/session_01W9Mk18mBNfkPfgg3hYweKq
(cherry picked from commit baa916d129)
2026-10-14 12:30:02 +02:00
Kristiyan Kostadinov fafec77b5d fix(common): harden param encoding against prototype pollution
The parameter encoding was using a plain object literal lookup to determine how to encode specific characters. This makes it vulnerable to prototype pollution.

These changes mitigate the issue by storing the mapping in a native `Map` instead.

(cherry picked from commit 01c883e2b6)
2026-10-14 11:38:04 +02:00
Kam 68c6c5725b docs: fix snippets, links and demos in the learn and first-app tutorials
Several tutorial steps tell the reader to do something that does not
match the starting code or the answer, so following them literally
breaks the app or shows the wrong result.

- signals: read userStatus() first in isWithinWorkingHours so the
  computed always tracks it, align the step 5 update method with the
  answer, and explain that the step 10 timer effect reads no signals
- learn-angular: fill in the existing showSecretMessage() stub, keep the
  placeholder and loading blocks in the viewport snippet, drop the
  RouterOutlet import the starter already has, link `fill` to the image
  guide, close the last step of the pipe tutorial properly, and drop the
  version mention from the NgIf and NgFor notes
- first-app: import HousingLocationInfo in step 5, move baseUrl with
  the data in step 9, link property binding to the right section, and
  correct stale snippet ranges and a few instructions
- playground: listen for touchcancel in the minigame

(cherry picked from commit 4044cef046)
2026-10-13 22:18:48 +00:00
Dan Russell 51ce6e5380 docs: use consistent headers in best-practices.md
(cherry picked from commit 2a927757a5)
2026-10-13 22:18:17 +00:00
Shuaib Hasan Akib 51823dcd1b docs: fix NG05201 error page trigger and add it to the overview
The NG05201 page said the error is thrown when binding an untrusted value
to a resource URL attribute such as `<iframe [src]>`, but template and
host bindings are checked by core and throw NG0904. NG05201 only comes
from calling `DomSanitizer.sanitize()` with `SecurityContext.RESOURCE_URL`.

Rewrite the page around the direct `sanitize()` call, link to NG0904 for
bindings, align its structure with the NG0904 page, and add NG05201 to
the errors overview.

(cherry picked from commit d63eb750ac)
2026-10-13 22:17:50 +00:00
Shuaib Hasan Akib 4237cb5ab4 docs(forms): fix signal forms compat examples
The compat FormGroup example never passed the `required` schema shown in
the migration guide, so its "Customer name is required." message could
never appear in the live preview. The FormControl example's comment also
claimed the email value was "angular_user" while the model starts empty.

(cherry picked from commit 82227492b8)
2026-10-13 22:17:20 +00:00
Shuaib Hasan Akib 268d6ba12c refactor(docs-infra): use @empty blocks in update guide
The update guide rendered its "nothing to do" messages with an `@if` on the list length placed after each `@for` loop. Use the loops' built-in `@empty` blocks instead. No behavior change.

(cherry picked from commit ff202d32d4)
2026-10-13 22:16:52 +00:00
Shuaib Hasan Akib e8e15c70ab refactor(docs-infra): use routed component input binding instead of ActivatedRoute
Replaces direct `ActivatedRoute` usage with routed component input binding for query params and resolved route data. Keeps `ActivatedRoute` only where it is still needed for relative navigation.

(cherry picked from commit 7c42c4be77)
2026-10-13 22:16:24 +00:00
SkyZeroZx 6a491718a6 docs: Add skills for deferrable views and server-side rendering
(cherry picked from commit 6c6e2108aa)
2026-10-13 22:15:50 +00:00
Angular Robot 522c01e92f build: lock file maintenance
See associated pull request for more information.
2026-10-13 15:08:40 -07:00
Matthieu Riegler c97d6b1de0 refactor(zone.js): ignore onpaint in DOM onProperty hooks test
Ignore the canvas onpaint property when asserting that element properties are patched. Newer versions of Chromium implement the experimental WICG HTML-in-Canvas specification which introduces onpaint on HTMLCanvasElement.prototype. Because zone.js is in maintenance mode and onpaint is experimental, zone.js does not patch this property.

(cherry picked from commit 01bb8cdb5d)
2026-10-13 05:30:00 +02:00
Kristiyan Kostadinov 35a02f8097 fix(compiler): harden JIT against prototype pollution
Fixes a few places in the JIT compiler that were vulnerable against prototype pollution and code injection.

(cherry picked from commit f2b1c1d3d7)
2026-10-12 23:10:03 +00:00
Kristiyan Kostadinov fa21d083fe fix(compiler-cli): inline tcb when depending on local directive
Adds some logic to inline the TCB when depending on a directive in the same file that isn't exported.

Fixes #71291.

(cherry picked from commit 0a77018368)
2026-10-12 23:09:30 +00:00
jhjh1214 b6f9cc5d70 fix(compiler): do not scope comments placed inside of a selector
Comments are replaced with a placeholder before the styles are scoped. A
comment that is placed inside of a selector, e.g. `.a /* comment */ {}` or
`.a, /* comment */ .b {}`, ended up as its own selector part and got the
content attribute appended, which changed what the rule matches (e.g.
`.a[c] [c] {}` and `.a[c], [c] .b[c] {}`).

Parts that only consist of comment placeholders are now left untouched.

(cherry picked from commit 8acf703db6)
2026-10-12 23:08:57 +00:00
Kristiyan Kostadinov e59a2303df fix(core): error when destroying embedded view with animations
Fixes an injection error that was being thrown when an embedded view tih animation is destroyed while destroying its `ApplicationRef`.

Fixes #71254.

(cherry picked from commit 97f8b6af93)
2026-10-12 23:08:25 +00:00