Skip to content

refactor(compiler-cli): abstract type check block metadata to be AST-free#67482

Open
atscott wants to merge 1 commit intoangular:21.2.xfrom
atscott:cptcbadapter
Open

refactor(compiler-cli): abstract type check block metadata to be AST-free#67482
atscott wants to merge 1 commit intoangular:21.2.xfrom
atscott:cptcbadapter

Conversation

@atscott
Copy link
Contributor

@atscott atscott commented Mar 5, 2026

(cherry pick for patch)

…free

This commit refactors the template type checking metadata interfaces to use detached, serializable metadata rather than retaining direct references to ts.Node or ts.Declaration instances.

A new tcb_adapter translates traditional TypeScript AST-bound metadata into these decoupled structures. This abstraction lays the groundwork for supporting native preprocessors (such as Rust or ts-go) which serialize metadata over JSON rather than passing live TypeScript objects.

Key changes:
- Introduced TcbDirectiveMetadata, TcbComponentMetadata, TcbReferenceMetadata, and TcbPipeMetadata to replace TypeCheckableDirectiveMeta where appropriate.
- Substituted deep TS compilation AST references with string module names and source spans to preserve out-of-band diagnostic capabilities.
- Detached generic typeParameters and transformType properties into synthesized, standalone TS mappings.
- Updated generateTypeCheckBlock and corresponding Operations to consume the new metadata.
@angular-robot angular-robot bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Mar 5, 2026
@ngbot ngbot bot added this to the Backlog milestone Mar 5, 2026
@atscott
Copy link
Contributor Author

atscott commented Mar 5, 2026

Blocked on 21.2.2 release, to split TCB refactorings across multiple releases in case we need to narrow down an unforeseen issue

@atscott atscott added the target: patch This PR is targeted for the next patch release label Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compiler Issues related to `ngc`, Angular's template compiler state: blocked target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants