39456 Commits
Author SHA1 Message Date
Matthieu Riegler 8b15295e8c fix(core): release leavingNodes when animate.leave resolves to no classes
When an element with an `animate.leave` binding is detached,
`node_manipulation` eagerly records `{el, declarationView}` in the
module-level `leavingNodes` `WeakMap`. Previously, if `runLeaveAnimations`
resolved an empty class list (such as `''`, `[]`, `null`, or
`undefined`), it pushed a resolver and resolved immediately without
starting `animateLeaveClassRunner`, so `clearLeavingNodes` was never
called and every removed element and its declaration view remained
retained for the lifetime of the `TNode`.

Avoid registering a resolver or adding the view to `allLeavingAnimations`
when `activeClasses` is empty, and clear the tracked `leavingNodes` entry
from `node_animations` once leave animations settle (or when the
animation queue cannot be resolved). Clearing at settlement preserves
`leavingNodes` tracking and `declarationView` while composed or
descendant leave animations are still running, while keeping the cleanup
inside the tree-shaken animation runtime. Also delete empty `TNode`
entries from `leavingNodes` in `cancelLeavingNodes`.

Fixes #72141
2026-11-20 09:03:23 -08:00
Ferdinand Malcher 6838c9bc77 docs(http): fix typo in httpResource params description 2026-11-20 08:35:52 -08:00
Doug Parker 8d090329ae docs: add outputSchema to WebMCP best practices
Updates the WebMCP documentation to introduce `outputSchema` in the best practices section and demonstrate how to declare explicit output schemas for WebMCP tools. Clarifies that Angular does not validate the runtime return values against this schema.
2026-11-20 08:35:37 -08:00
Doug Parker 4becefe5c2 refactor(forms): hard-code output schema for signal forms WebMCP tool
Hard-code an explicit `outputSchema` for the implicitly generated signal forms WebMCP tool. This schema accurately describes the simplified success and error object returned by the tool execution, allowing AI agents to confidently interpret the results without hallucination.
2026-11-20 08:35:37 -08:00
Doug Parker ec0f0583c3 refactor(core): update WebMCP tool declaration APIs to include outputSchema
Update `ToolDescriptor`, `declareExperimentalWebMcpTool`, and `provideExperimentalWebMcpTools` to explicitly support the `outputSchema` property. This allows tools to specify their expected return format using standard JSON Schema syntax, ensuring that AI agents know exactly how to interpret the tool execution results.
2026-11-20 08:35:37 -08:00
Doug Parker f82d8215f9 refactor(forms): simplify signal forms WebMCP tool output structure
Simplify the output structure of the WebMCP tool for signal forms from a verbose array of content blocks to a simple JSON object containing a boolean success flag and an optional array of error strings. This reduces token usage and provides a more semantic output format for AI agents to consume.
2026-11-20 08:35:37 -08:00
Angular Robot 5aa0b0e429 build: update dependency bazel to v8.9.0
See associated pull request for more information.
2026-11-20 08:13:18 -08:00
Alex Morris 34c6c98f94 fix(core): update standalone directiveDefs and pipeDefs during HMR
In `mergeWithExistingDefinition`, `directiveDefs` and `pipeDefs` were always
restored from `clone` to preserve remote scopes patched by
`ɵɵsetComponentScope` from an `NgModule` file, which does not re-run during HMR
of the component file.

Standalone components never use `ɵɵsetComponentScope` because their imports are
inlined directly onto the component definition (in `ngtsc`, `handler.ts` keeps
non-self dependencies during HMR and emits the component self-reference only
while used in the template). Always restoring `clone` left removed standalone
directives active, caused swapped or newly added standalone directives to fail
silently and pipes to throw `NG0302`, and broke recursive self-references.

Use `newDef.directiveDefs` and `newDef.pipeDefs` directly for standalone
components (including `null`), while keeping `clone.directiveDefs` and
`clone.pipeDefs` unconditionally for non-standalone components. Add DOM-level
acceptance specs in `hmr_spec.ts`.
2026-11-20 07:42:47 -08:00
Alex Morris d201dd76ef fix(core): do not drop nested @defer child blocks while parent hydrates
In `getParentBlockHydrationQueue`, PR #58722 breaks out of the ancestor loop
before calling `hydrationQueue.unshift(currentBlockId)` when it encounters an
ancestor `@defer` block that is already hydrating. Because of that,
`hydrationQueue` never contains the hydrating ancestor, only the unhydrated
descendants below it.

`triggerHydrationFromBlockName` still contains a `hydrationQueue.shift()` added
in PR #60203 under the assumption that the hydrating parent sat at index 0.
When `parentBlockPromise` is non-null, that shifts off the first unhydrated
child block instead: in a 2-level nested `@defer` block it empties the queue
and drops the replay event, and in a 3-level hierarchy (immediate inside
interaction inside immediate) it drops the middle block so both inner blocks
stay dehydrated.

Remove the stale `hydrationQueue.shift()` call and add regression specs in
`incremental_hydration_spec.ts`.
2026-11-20 05:20:30 -08:00
Charles Lyding ee18d57563 refactor(compiler-cli): support external modules, virtual IDs, and type-only import kinds in preprocessor
Bundler-backed AnalysisHost implementations resolve dependencies into both in-bundle modules and
bundle-external dependencies, distinguish runtime imports from type-only imports, and assign opaque
virtual module IDs that are not filesystem paths. Previously, the query engine assumed every
extracted specifier had uniform type-only semantics, treated resolved modules as in-project paths
unless they ended in .d.ts, and computed relative paths across emitted imports and debug metadata.

Classify extracted static imports, re-exports, dynamic import() expressions, and TSImportType
queries with exact ImportKind and type_only flags and forward both on ResolveRequest. Track
authoritative external module flags in FileIdInterner and QueryEngine so external modules pass
external = true to AnalysisHost::load, stay out of ProgramFiles, coordinator roots, and core
compilation, and preserve or rebase their original OwningReference specifiers instead of emitting
paths to resolved external files.

Propagate IdKind onto AnalysisResult, FileUpdate, FileInvalidation, and WASM ModuleRef entry
points. When either side of a reference or a compiled file carries IdKind::Virtual, emit the module
ID verbatim across cross-file import emission, class debug info, and HMR identifiers without path
diffing or rootDir stripping.
2026-11-19 16:40:57 -08:00
Matthieu Riegler 88a931b968 fix(compiler): length-prefix string literals and quoted map keys in ConstantPool keys
Previously, GenericKeyFn.keyOf() wrapped string literals and quoted object literal keys in double quotes without length-prefixing or escaping. As a result, distinct array or object literals extracted during the template compiler's pure function optimization phase (such as ['a', 'b'] and ['a","b'], or {'a': 1, 'b': 2} and {'a":1,"b': 2}) produced identical constant pool keys and erroneously shared the same constant factory.

Prefix string literals and quoted object literal keys with their length ("<length>:<value>") in GenericKeyFn.keyOf() so embedded quotes and delimiters cannot cause key collisions without needing to scan or escape the string.

Fixes #71914
2026-11-19 16:39:37 -08:00
arturovt fee6dbf526 fix(core): throw coded error when @for collection is not iterable
Consider the following example:

```ts
@Component({
  template: '@for (item of items; track item) {{{ item }}}',
})
class App {
  items = {0: 'a', 1: 'b'};
}
```

Prior to this commit, `reconcile()` treated every non-nullish value that is
not an array as an iterable and called `Symbol.iterator` on it without a
check. A plain object therefore failed with a raw `TypeError`:

```
TypeError: t[Symbol.iterator] is not a function
```

That error carries no code, does not mention `@for`, and does not say which
template produced it. In a production build the stack is minified, so error
reporting shows nothing actionable. The same value through `*ngFor` reports
NG02200, which names the problem and suggests the keyvalue pipe, so `@for`
was harder to debug than the API it replaces.

With this commit the same value throws NG0957. Only the message text is
behind `ngDevMode`; the check itself is not, because production is where the
raw error is unreadable today. The array fast path is untouched, and `null`
and `undefined` keep rendering nothing.

The code is negative, which is how this package marks codes that have a
guide on angular.dev, so the fix ships with one.
2026-11-19 15:39:55 -08:00
Doug Parker 73916540c1 release: bump Angular DevTools version to 1.22.3 2026-11-19 10:17:25 -08:00
Angular Robot 3ef4cb5d43 build: update all non-major dependencies
See associated pull request for more information.
2026-11-19 09:37:07 -08:00
Michael Small 3deac2ffea docs: mark Routing navigation as updated 2026-11-19 08:55:21 -08:00
Angular Robot 54c6561669 build: update dependency aspect_rules_js to v3.6.1
See associated pull request for more information.
2026-11-19 08:47:10 -08:00
Angular Robot 7047e1e7bc build: update cypress-io/github-action action to v7.4.10
See associated pull request for more information.
2026-11-19 08:47:02 -08:00
Alon Mishne 250ca07953 docs: release notes for the v22.3.0 release 2026-11-18 11:30:50 -08:00
Alon Mishne 8f7e15eabc docs: release notes for the v22.2.7 release 2026-11-18 11:18:53 -08:00
Jessica Janiuk 661f5c9193 ci: update dev-infra members
This adds 3 new people to the dev-infra pullapprove group.
2026-11-18 10:27:47 -08:00
Angular Robot 2e8eb8596a docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-11-18 10:22:09 -08:00
Angular Robot 2fb8f5fb26 build: update cross-repo angular dependencies to v22.4.0-next.0
See associated pull request for more information.
2026-11-18 10:11:56 -08:00
Andrew Scott 7b50ce3be2 refactor(compiler-cli): attribute NgModule scope queries in perf summaries
In normal perf tracing mode, `ngp.rust.Summary` records top-5 `slowest` entries with `file` paths read from each query span's `file` field. That field was populated from `QueryKey::file_id()`, which returns `None` for `NgModuleExportsScope(ReferenceId)` and `NgModuleImportsScope(ReferenceId)`, leaving their `slowest` entries without file paths unless detail mode was enabled.

Add `QueryKey::perf_file_id()` to return `Some(reference_id.file)` for NgModule scope queries as well, and use it in `QueryEngine::execute` when creating the perf span. Keeping `QueryKey::file_id()` unchanged avoids marking NgModule files dirty or emitting them in `invalidatedPaths` when a downstream dependent evicts a cached scope key.
2026-11-18 10:11:35 -08:00
Andrew Scott f8e9ae8312 refactor(compiler-cli): support cold-start project discovery for html templates
Resolve sibling TypeScript files in ProjectManager.resolveTsconfigPath when a template's filename does not directly match its component (e.g. *.template.html -> *.component.ts), and initialize the TS 7 API session before starting the Angular language client so initial HTML document requests have an active API connection.
2026-11-18 10:11:16 -08:00
Andrew Scott a9d35bad83 refactor(compiler-cli): support go-to-definition for templateUrl and styleUrls
Add getDefinitionForExpressionAtPosition in the preprocessor language service DefinitionBuilder, matching the ngtsc language service structure, to resolve component templateUrl and styleUrls string literals to their target files.
2026-11-18 10:11:16 -08:00
Andrew Scott b208470321 refactor(compiler-cli): skip redundant didChange notifications in TsGoFacade
Cache the last sent document content in TsGoFacade.ensureDocument and skip sending textDocument/didChange when the content is unchanged, avoiding unnecessary cancellation of concurrent in-flight TypeScript 7 language server requests.
2026-11-18 10:11:16 -08:00
Andrew Scott 6d49c19e22 refactor(compiler-cli): configure VS Code extension host launch for ngp language service
Add VS Code launch and task configurations for launching and debugging the ngp-vscode-ng-language-service extension host in the monorepo, and fix build and runtime resolution issues when running outside Bazel:

- Add 'NGP VSCE: Launch Dev Client' and compound attach configs in .vscode/launch.json and 'NGP VSCE: build' task in .vscode/tasks.json.
- Update ngp-vscode-ng-language-service/build.js to use server/esbuild-tsconfig.json, mark @typescript/native-preview external, and define import.meta.url via banner.
- Update ngp-vscode-ng-language-service/tsconfig.json for TypeScript 7 compatibility (remove baseUrl, use relative paths, and specify node types).
- Resolve platform tsc/tsgo binary via createRequire from @typescript/native-preview/package.json so pnpm workspace layouts work, and await clientReady before sending angular/setTsApiPipe from fallback ts7Client.
- Allow analyzer_loader.ts to locate ng_analyze_wasm.js when walking up from a realpath'd bundle inside bazel-out.
2026-11-18 10:11:16 -08:00
Andrew Scott 96832ab41e refactor(compiler-cli): use onLanguageServerInitialized for TS 7 API connection
Updates the VS Code extension handshake with typescriptteam.native-preview
to activate the extension and subscribe to
extApi.onLanguageServerInitialized((sdk) => sdk.initializeAPIConnection()),
forwarding the API pipe via angular/setTsApiPipe when the language server
initializes or restarts.
2026-11-18 10:11:16 -08:00
Andrew Scott 748d3bf417 refactor(compiler-cli): simplify cold-start html project discovery with openFiles
Replaces the cold-start companion .ts file disk read and synthetic LSP
didOpen (facade.ensureDocument) in ProjectManager.resolveTsconfigPath with
api.getCurrentLanguageServerSnapshot({openFiles: [targetPath]}), and
disposes previous snapshots when replaced.
2026-11-18 10:11:16 -08:00
Andrew Scott f442d775f0 build(compiler-cli): update TypeScript 7 language service dependency to 7.1.0-dev
Upgrades the TypeScript 7 dependency in the preprocessor language service
and VS Code extension from the frozen @typescript/[email protected]
package to npm:[email protected], updates binary lookup for
@typescript/typescript-<platform>-<arch> (tsc), updates subpath imports from
/unstable/async to /async, and replaces api.updateSnapshot() with
api.getCurrentLanguageServerSnapshot().
2026-11-18 10:11:16 -08:00