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
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.
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.
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.
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.
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`.
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`.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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().