37829 Commits

Author SHA1 Message Date
Matthew Beck f8df06d702 release: cut the v22.0.7 release v22.0.7 2026-07-15 21:23:21 -07:00
XananasX7 3b82aea861 ci: harden workflow against expression injection
Interpolating GitHub context values directly into `run:` steps creates
an expression-injection vector. Move the affected values into an `env:`
block and reference them as environment variables in the shell script
instead. This prevents shell metacharacters in context values from
altering step behaviour.

Signed-off-by: El Mehdi Abenhazou <mehdiananas007@gmail.com>
(cherry picked from commit d43acaf80c)
2026-07-15 17:44:48 -07:00
Jaime Burgos 64d6d47a0c fix(forms): preserve intermediate number values in signal forms
Preserve raw native input text while editing so parsed model values are not written back on every keystroke.

(cherry picked from commit 2e32872720)
2026-07-15 15:56:52 -07:00
Angular Robot 829d98e9ae build: update cross-repo angular dependencies to v22.0.7
See associated pull request for more information.
2026-07-15 14:49:17 -07:00
splincode fa6a1d26bd test(elements): disambiguate the setTimeout spy type
Bind spyOn explicitly to Window so Jasmine uses the DOM setTimeout signature that returns a number instead of the Node.js Timeout type. Remove the unsafe any cast and the obsolete TODO.

(cherry picked from commit 24a3c63976)
2026-07-15 14:48:32 -07:00
Kam 966e5eb231 feat(devtools): show Angie on the empty-state screens
The DevTools state screens (Angular not detected, unsupported version,
production build) showed a plain Material icon above the message. Show
the Angie mascot instead, matching the treatment already used across
angular.dev (the 404 page, empty search, the preview error state).

Each screen uses a pose that fits its message: the dizzy `error` pose for
"application not detected", `coding-01` for the version-upgrade prompt,
and `sad` for the production build notice.

(cherry picked from commit d4f2313e4d)
2026-07-15 14:48:05 -07:00
cexbrayat 70500e4067 fix(core): preserve explicit input transform write type
If a directive has an input declared as `dismissible = input<boolean>(true, {transform: booleanAttribute});` then the following templates were not compiling:

```
<div directiveName dismissible="true"></div>
<div directiveName dismissible></div>
```

This commit fixes the issue, without breaking contravariant consumers.

(cherry picked from commit 0ae6d81ed2)
2026-07-15 12:02:23 -07:00
arshiya tabasum 91e33aa1de fix(common): avoid prototype lookups in date format caches
The NAMED_FORMATS and DATE_FORMATS caches were plain objects read with a
truthy check keyed by a token from the format string, so a token matching
an inherited Object member (e.g. `__proto__`) resolved to a prototype
value. Create both caches with a null prototype so only real entries are
returned.

(cherry picked from commit 359fb503b8)
2026-07-15 12:01:53 -07:00
Shuaib Hasan Akib a6174d5900 refactor(forms): warn when a text input receives a null value in Signal Forms
Native text `<input type="text">` controls do not support `null` values.
When a Signal Forms model bound to a text input is set to `null`, the value
is silently coerced to an empty string.

(cherry picked from commit 37f3279fe7)
2026-07-15 12:01:17 -07:00
Kristiyan Kostadinov c89f71a74c fix(core): ignore processing instruction syntax in templates
Updates the template parser to detect and ignore processing instruction syntax (e.g. `<? foo ?>` or `<? foo >`). Currently it is being printed out as text.

Fixes #34371.

(cherry picked from commit 68ac204074)
2026-07-15 11:57:06 -07:00
Paweł Maniecki b21d6cdd58 docs: update "browser set" links to avoid bad redirect
"Supported browsers" page got moved from
https://web-platform-dx.github.io/web-features/supported-browsers to https://web-platform-dx.github.io/supported-browsers/

There's a redirect in place, but it drops the query parameter with the date, so all versions link to the current browser set.

(cherry picked from commit ea83f13388)
2026-07-15 11:55:29 -07:00
Kam ae1d81c8c5 feat(docs-infra): greet visitors with Angie in the cookie popup
The cookie consent popup showed only text and two buttons. Add the
Angie greeting pose to it so the first thing a new visitor sees carries
the same mascot treatment already used across the docs (the 404 page,
empty search results, the preview error state).

The message and mascot sit in a flex header row; the two action buttons
now share the row equally so they fill the card instead of leaving a
trailing gap. Layout only, the consent behaviour is unchanged.

(cherry picked from commit 6a3487f7b7)
2026-07-15 11:54:54 -07:00
Cameron Smick e881b962cc refactor(core): move signal debug graph interfaces to primitives/devtools
Move the DebugSignalGraph, DebugSignalGraphEdge, and DebugSignalGraphNode interfaces from packages/core/src/render3/util/signal_debug.ts into the packages/core/primitives/devtools/src package. This decouples the signal graph debug types from runtime render3 utilities and allows devtools and internal core tooling to import them directly from primitives as type-only exports.

(cherry picked from commit d997a96b47)
2026-07-14 11:09:27 -07:00
CYANO-01 b34bf0dce8 fix(platform-browser): prevent ReDoS in SOURCEMAP_URL_REGEXP
Replace the lazy quantifier (.+?) with a negated character class
([^\s*]+) that excludes whitespace and asterisks. Source map URLs
never contain these characters, so the fix is semantically
equivalent while eliminating the O(n²) backtracking path triggered
by unclosed /*# sourceMappingURL= fragments.

Fixes: polynomial ReDoS in addBaseHrefToCssSourceMap
(cherry picked from commit fb6b354fbd)
2026-07-14 10:57:25 -07:00
Sonu Kapoor 20b7dc3023 fix(http): prevent interceptor signal reads from leaking into calling reactive contexts
When `HttpClient` is called from within an `effect()` or other reactive
context, any signal reads performed inside HTTP interceptors were
inadvertently tracked by that context. This caused the effect to
re-execute whenever those signals changed, regardless of whether the
signal was semantically related to the HTTP call.

The fix wraps the interceptor chain invocation in `untracked()` so that
signal reads inside interceptors — both functional (`withInterceptors`)
and class-based (`withInterceptorsFromDi`) — are invisible to the
calling reactive context. This matches the precedent set by the resource
API, which also wraps its loader in `untracked()` for the same reason.

Fixes #58682

(cherry picked from commit 6d043f8657)
2026-07-14 09:21:13 -07:00
LordKay-sudo c88ddde1c9 fix(compiler-cli): re-tag SourceFiles after TsCreateProgramDriver.updateFiles()
TypeScript reuses SourceFile objects between old and new programs, so untagging the old program also untags shared files in the new program. Re-apply shim tags on the new program to prevent getSemanticDiagnostics() crashes with TS 5.5+.

(cherry picked from commit ae0ec7315c)
2026-07-14 09:18:40 -07:00
Ben Hong 26952902a9 docs: add native html validation clarification in signal forms docs
(cherry picked from commit ca377900a2)
2026-07-14 08:01:07 -07:00
Angular Robot 86b10d7138 build: lock file maintenance
See associated pull request for more information.
2026-07-14 08:00:35 -07:00
Kam d726aa80de feat(docs-infra): show Angie in the error snack bar
The error snack bar (the chunk-load reload prompt and the embedded
editor's memory / mobile alerts) showed only text and an action button.
Add an Angie press-kit pose to the left of the message so the failure
state matches the mascot treatment already used for the preview error
card and the empty search states.

The pose is data-driven: ErrorSnackBarData gains a required `pose` field
so each caller picks the mascot that fits the message tone (`greeting`
for the docs-updated reload prompt and the mobile notice, `error` for
the out-of-memory warning). The message moves into a `<p>` that flexes
to fill the row, keeping the action button aligned to the right.

Presentation only; when and why the snack bar appears is unchanged.

(cherry picked from commit d5e0b131ed)
2026-07-13 14:47:30 -07:00
Matthieu Riegler 7658a81b06 docs: Add mention that about signal narrowing on @switch blocks
(cherry picked from commit d55f5c4ce5)
2026-07-13 12:59:40 -07:00
Angular Robot ac5f4769dd build: update pnpm to v10.34.5
See associated pull request for more information.
2026-07-13 11:52:20 -07:00
Kam cc286cee30 docs(docs-infra): remove orphaned IDX config left behind by #68946
PR #68946 removed the "Open in Firebase Studio" (Project IDX) launcher
from the embedded editor, but left its supporting configuration behind:
a per-tutorial `idx/dev.nix` workspace file in seven tutorials, plus an
`'idx'` entry in `excludeFromRoot` whose only job was to keep those
folders out of the StackBlitz/download bundle.

With the launcher gone nothing reads these files anymore, so remove the
seven `dev.nix` configs and the now-dead `'idx'` exclude entry.

(cherry picked from commit f6a00ffde5)
2026-07-13 11:51:01 -07:00
Shuaib Hasan Akib 04b75c1c1f fix(docs-infra): don't show $ prompt on empty lines
Fenced shell code blocks prepended a `$` prompt to every rendered line  via a CSS `::before`, including blank lines are not commands to run.

(cherry picked from commit aca7371431)
2026-07-13 11:50:13 -07:00
Kam 50c0291a74 fix(docs-infra): render the Console tab error badge in the embedded editor
The Console tab's error-count badge lives in an `<ng-template
mat-tab-label>`, but the component didn't import `MatTabLabel`, so
Material ignored the templated label and fell back to the plain
"Console" text. Import it so the badge renders when there are errors.

(cherry picked from commit f94da4d5ca)
2026-07-13 11:48:58 -07:00
Angular Robot cfb77d68d3 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-07-10 14:24:16 -07:00
Kam e6272f2931 feat(docs-infra): add Angie to the embedded editor error state
When the embedded editor fails to boot the preview sandbox, the error
card showed only a text message. Add the press-kit Error pose above the
message so the failure state matches the mascot treatment already used
for the loading steps and the empty search states.

The card is also centered in the preview pane (previously pinned 5% from
the top) so the pose and message read as one block. Behaviour is
unchanged; this is presentation only.

(cherry picked from commit 72cc548d34)
2026-07-10 11:12:20 -07:00
Kam c42903628e fix(docs-infra): avoid search dialog empty-state flicker while re-querying
The search dialog picked its empty state ("Start typing" vs "No results
found") with `!resultsResource.hasValue()`, which during a re-query looks
identical to a freshly opened dialog since the resource resets its value and
reports `loading`. This flipped the message and mascot back to "Start typing"
mid-search, causing a question -> magnifying-glass -> question flicker on every
keystroke. Add an `emptyState` signal that holds the previous state while a
search is settling, so the dialog only changes once results resolve.

(cherry picked from commit e6378eb330)
2026-07-10 10:58:57 -07:00
Doug Parker 1046fd9e56 refactor(core): remove deprecated unregisterTool from ModelContext
In the WebMCP specification, tools are unregistered by aborting the `AbortSignal` provided in `registerTool(tool, {signal})`. The deprecated `unregisterTool` method on `ModelContext` is no longer needed or part of the standard, and is now removed from the TypeScript interface definition.

(cherry picked from commit ce4f7adc95)
2026-07-10 10:56:45 -07:00
Doug Parker 5936ffb80c refactor(core): update WebMCP tool registration to be asynchronous
In the latest WebMCP specification and Chromium preview builds, `document.modelContext.registerTool` was updated to be asynchronous and return a `Promise`: https://groups.google.com/a/chromium.org/g/chrome-ai-dev-preview/c/xQWt0b1sZIE/m/UJznbNCIAwAJ?utm_medium=email&utm_source=footer

This commit update adjusts Angular's experimental WebMCP implementation (`declareExperimentalWebMcpTool` and form registration) to be async as well, returning `Promise<void>`.

(cherry picked from commit f908140d71)
2026-07-10 10:56:45 -07:00
Angular Robot 2b08d92166 build: update github/codeql-action action to v4.37.0
See associated pull request for more information.
2026-07-10 10:55:45 -07:00
Matthew Beck c82ae67e3d Revert "fix(core): allow static attributes for explicit input transforms"
This reverts commit 9b9b0e93c9.

This broke g3. Not sure yet why it didn't break externally. We can
investigate and fix following this revert.

(cherry picked from commit 1fb4678207)
2026-07-09 17:58:26 -07:00
leonsenft 97c830b2ca ci: fix workflows broken by renamed command
This command was renamed in
https://github.com/angular/dev-infra/commit/ff4046900c623801d13f764a1ee59ce7d2b49599.
2026-07-09 16:05:25 -07:00
Angular Robot ec9b4793e8 build: update cross-repo angular dependencies
See associated pull request for more information.

Closes #69411 as a pr takeover
2026-07-09 16:05:25 -07:00
arshiya tabasum 8ce1fcf7fa fix(localize): use Object.hasOwn for placeholder lookup in translate
`translate()` looked up substitutions with `message.substitutions.hasOwnProperty(placeholder)`. A message whose placeholder is named `hasOwnProperty` stores that key on the plain substitutions object, shadowing the method, so the lookup calls the substitution value and throws a TypeError. Use `Object.hasOwn` instead, which resolves through `Object` and is unaffected by the shadowed key, matching the recent `I18nSelectPipe` fix.

(cherry picked from commit 2a4f582731)
2026-07-09 12:29:59 -07:00
Bhuvansh855 5d06fcb109 test(forms): register writeback test control as CVA
Register the custom writeback test control as an NG_VALUE_ACCESSOR
so it is recognized as a valid formField host during debounce
writeback testing.

(cherry picked from commit 12fe700ad8)
2026-07-09 12:29:11 -07:00
Bhuvansh855 6cf7446afa fix(forms): prevent stale CVA writeback during debounce
Use controlValue() instead of value() when synchronizing
ControlValueAccessor instances.

When debounce is active, value() can still contain the
previous model value while controlValue() reflects the
latest user-entered value. This prevents stale values
from being written back to the CVA before the debounce
is flushed.

Adds a regression test covering the debounce scenario.

(cherry picked from commit 2e0cb52dbf)
2026-07-09 12:29:10 -07:00
cexbrayat 94d9591b51 fix(core): allow static attributes for explicit input transforms
This is a follow-up to #67997, which allowed explicit read generics with input transforms, such as `input<boolean>(false, {transform: booleanAttribute})`.

That fixed the declaration, but static template attributes like `dismissible="true"` and bare `dismissible` were still checked as strings against the read type. Allow the fallback write type to include static attribute strings so these template forms compile.

(cherry picked from commit 9b9b0e93c9)
2026-07-09 12:28:29 -07:00
Michael Small 3a9351f221 docs: remove \'s from schematics helloWorld block
(cherry picked from commit cf6d693985)
2026-07-09 12:23:36 -07:00
hawkgs 23ea61014d fix(devtools): bump settings z-index due to overlapping elements
Fixes the bug where the Transfer State table header is overlapping the settings window.

(cherry picked from commit 5ff14e9915)
2026-07-09 12:19:43 -07:00
franmc01 6fdde4f941 docs: show ng-add schema files in schematics-for-libraries guide
The ng-add walkthrough references two files it never shows: the
collection points to `ng-add/schema.json` and `index.ts` imports its
`Schema` interface from `ng-add/schema.ts`. Add the missing code blocks,
mirroring the generation-support section, so the example is complete.

Fixes #57005

(cherry picked from commit 454af71609)
2026-07-09 12:13:54 -07:00
hawkgs 844b6fd0ae refactor(devtools): stop component inspector on esc press
Stop the component inspector when Escape is pressed similarly to Chrome DevTools.

(cherry picked from commit 3685755333)
2026-07-09 12:13:09 -07:00
Kam cd6b903504 feat(docs-infra): add Angie to the embedded editor loading steps
While the embedded editor's preview sandbox boots, the pane shows a plain
text label for each step (Booting, Creating project, Installing packages,
Initializing dev server). Add an Angie pose above the label so the wait
tells a small story. Behaviour is unchanged; this is presentation only.

Poses map to the existing LoadingStep values:
  Starting / Booting / Creating project -> greeting
  Installing packages                   -> coding-01
  Initializing dev server               -> superhero

The mascot sits in a fixed-size box (object-fit: contain) so swapping
poses of different aspect ratios never shifts the label or progress bar.

(cherry picked from commit c92d995260)
2026-07-09 12:00:50 -07:00
Shuaib Hasan Akib 9e13b6126e docs: update ng-content syntax to self-closing tags in content projection and component harnesses guides
(cherry picked from commit 4fc6d6f765)
2026-07-09 11:57:42 -07:00
Shuaib Hasan Akib c0c97b5b22 docs(platform-server): add error reference page for NG05703 and wire up RuntimeError
Add a dedicated error reference page for NG05703 (suspicious URL origin
change during SSR) and update the error to use RuntimeError with a
negative code so the error message automatically includes a link to the
docs page in both dev and production builds.

Update affected tests in url_spec.ts, platform_location_spec.ts, and
integration_spec.ts to match the new NG05703-prefixed error message
format.

Fixes: #69667
(cherry picked from commit 13b6bbd6a0)
2026-07-09 11:56:06 -07:00
hawkgs aa03cb97a9 test(language-service): empty template literal interpolation
Ensure that empty template literal interpolation is handled gracefully.

(cherry picked from commit 53ca8c25cb)
2026-07-09 09:56:45 -07:00
hawkgs 5b516e3a58 fix(compiler): parsing of an empty template literal interpolation
Even if we have an `EmptyExpr`, add that expression to the expressions array when a literal is parsed.
The lack of the expression results in a discrepancy in the sizes of the `elements` and the `expressions`
arrays of a `TemplateLiteral`, that result in an error when we visit that same literal due to the missing
expression.

Fixes #69699

(cherry picked from commit da52137724)
2026-07-09 09:56:45 -07:00
arshiya tabasum 22d5a091d1 fix(localize): build runtime translations map with a null prototype
loadTranslations stores parsed translations into the shared global
$localize.TRANSLATIONS keyed by message id. Those ids come verbatim from
the translations map (typically parsed from a translation file), so a
translation whose id is __proto__ assigns through the inherited __proto__
setter, reparenting the map rather than storing the entry (and throwing
under --disable-proto=throw). Create the map with Object.create(null) in
loadTranslations and clearTranslations so __proto__ is an ordinary key.

(cherry picked from commit 5de0ea5f23)
2026-07-09 09:56:14 -07:00
Matthieu Riegler 1b9964675f fix(forms): allow multiple async validators
When a parent form element defines an async validator, its resource's `params` function needs to evaluate `syncValid()`, which causes unvisited child form nodes to be lazily instantiated. If any of these lazily instantiated child nodes also define an async validator, their resource is initialized while the parent's `params` function is still evaluating. This incorrectly triggers Angular core's `NG0992` guard (`Cannot create a resource inside the params of another resource`).
This commit exports `ɵsetInParamsFunction` and `ɵisInParamsFunction` from `@angular/core` and uses them in `FieldMetadataState.runMetadataCreateLifecycle` to explicitly detach the lazy creation of form metadata from the parent's reactive `params` context.

fixes #69620

(cherry picked from commit 5cb8c733a3)
2026-07-09 09:55:33 -07:00
leonsenft 89e2c77974 release: cut the v22.0.6 release v22.0.6 2026-07-08 14:36:38 -07:00
Kam d1aaf1a178 feat(docs-infra): add Angie mascot to the not found page
Replaces the plain "Page Not Found" text with the sad Angie mascot
speaking the message from a speech bubble, for a warmer, more on-brand
not-found page. Copy is unchanged and the "Feeling lucky?" search
results are untouched.

The sad pose is added as an SVG asset (cropped tight to the artwork) under
assets/images/angie/. The mascot is decorative (aria-hidden), and it scales
down to stay beside the bubble on mobile.

(cherry picked from commit 3ac2c7b2bc)
2026-07-08 12:45:48 -07:00