refactor(compiler-cli): extract TypeScript-free helpers for hybrid preprocessor #71497

Open
atscott opened 4:20pm on October 20, 2026 wants to merge 46 Ξ” into angular/angular main from
extract-hybrid-preprocessor-helpers
Diff Delta:
46
About 57 Diff Delta/hour
Classified as:  General

atscott's Description of Work

Extract the TypeScript-free symbol validation (validateAndRewriteCoreSymbol) and HMR output AST dependency helpers (extractHmrDependenciesFromOutput and PotentialTopLevelReadsVisitor) into src/ngtsc/imports/src/core_symbols.ts and src/ngtsc/hmr/src/extract_dependencies_output.ts, exposed via a dedicated @angular/compiler-cli/private/hybrid_preprocessor entry point with no dependency on :compiler-cli or typescript.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?


  • [ ] Bugfix

  • [ ] Feature

  • [ ] Code style update (formatting, local variables)

  • [x] Refactoring (no functional changes, no api changes)

  • [x] Build related changes

  • [ ] CI related changes

  • [ ] Documentation content changes

  • [ ] angular.dev application / infrastructure changes

  • [ ] Other... Please describe:

What is the current behavior?

validateAndRewriteCoreSymbol, extractHmrDependenciesFromOutput, and PotentialTopLevelReadsVisitor live inside modules (src/ngtsc/imports/src/core.ts and src/ngtsc/hmr/src/extract_dependencies.ts) that depend on TypeScript and ngtsc internals, even though these helpers themselves only operate on strings and @angular/compiler output AST nodes.

Issue Number: N/A

What is the new behavior?

Those TypeScript-free helpers are extracted into standalone modules (src/ngtsc/imports/src/core_symbols.ts and src/ngtsc/hmr/src/extract_dependencies_output.ts) and re-exported from their original locations as well as a dedicated @angular/compiler-cli/private/hybrid_preprocessor entry point that depends only on @angular/compiler.

Does this PR introduce a breaking change?


  • [ ] Yes

  • [x] No

10 total changed files
(4 files ignored)
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
You've reached the end of this PR review
You have reached the final β€œwhy is this here?”