Skip to content

refactor(compiler-cli): allow external TCBs with copied content#68372

Draft
atscott wants to merge 1 commit intoangular:mainfrom
atscott:inlineTemplateExternalCopy
Draft

refactor(compiler-cli): allow external TCBs with copied content#68372
atscott wants to merge 1 commit intoangular:mainfrom
atscott:inlineTemplateExternalCopy

Conversation

@atscott
Copy link
Copy Markdown
Contributor

@atscott atscott commented Apr 24, 2026

This change allows environments that cannot support inline TCBs (such as the language service or source-to-source transforms where TS compilation and emit are downstream) to still perform template type checking.

Instead of inlining the TCB into the original source file when non-exported symbols are referenced, we now copy the file content to the .ngtypecheck.ts shim file and generate the external TCB there. This preserves the local scope of the original file while keeping the original file unmodified.

@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Apr 24, 2026
@ngbot ngbot Bot added this to the Backlog milestone Apr 24, 2026
@atscott atscott force-pushed the inlineTemplateExternalCopy branch 2 times, most recently from 16e96f1 to a2f7604 Compare April 27, 2026 20:54
@angular-robot angular-robot Bot added the detected: feature PR contains a feature commit label Apr 27, 2026
@atscott atscott force-pushed the inlineTemplateExternalCopy branch from a2f7604 to 7bced7c Compare April 27, 2026 22:56
…ific mode

    This change adds a new  that allows environments that cannot support inline TCBs (such as the language service or source-to-source transforms where TS compilation and emit are downstream) to still perform template type checking.

    Instead of inlining the TCB into the original source file when non-exported symbols are referenced, we now copy the file content to the .ngtypecheck.ts shim file and generate the external TCB there, if requested by the inlining mode. This preserves the local scope of the original file while keeping the original file unmodified.
@atscott atscott force-pushed the inlineTemplateExternalCopy branch from 7bced7c to b1b5b9d Compare April 27, 2026 23:14
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 detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant