Visitar URL original
refactor(compiler-cli): detect @angular/core compilations like ngtsc in the preprocessor by clydin · Pull Request #71731 · angular/angular · GitHub
The Wayback Machine - https://web.archive.org/web/20261102040530/https://github.com/angular/angular/pull/71731
Skip to content

refactor(compiler-cli): detect @angular/core compilations like ngtsc in the preprocessor - #71731

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:ngp-host-h2-1
Open

clydin wants to merge 1 commit into
angular:mainfrom
clydin:ngp-host-h2-1

Conversation

@clydin

@clydin clydin commented Oct 29, 2026

Copy link
Copy Markdown
Member

The preprocessor recognized @angular/core by walking up to the nearest package.json named @angular/core, which ngtsc never does and which a host without file system access cannot do. Follow ngtsc's rule instead: the internal angularCoreCompilation option, falling back to the tsconfig's _isAngularCoreCompilation, then to an explicit r3SymbolsFile, and otherwise to whether the root r3_symbols.ts exports ITS_JUST_ANGULAR = true (ngtsc's isAngularCorePackage).

The ITS_JUST_ANGULAR check reads r3_symbols.ts through the query engine, so edits to it invalidate dependent analyses. A new pseudo-dependency on the r3_symbols.ts root lookup re-runs only the queries that read it when the roots add or remove that file, instead of every query on each root change.

Also remove the unused resolve_to_dts helper.

@clydin clydin added the target: minor This PR is targeted for the next minor release label Oct 29, 2026
@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Oct 29, 2026
@ngbot ngbot Bot added this to the Backlog milestone Oct 29, 2026
@clydin
clydin force-pushed the ngp-host-h2-1 branch 2 times, most recently from 118648c to 4262b7c Compare October 29, 2026 22:23
…in the preprocessor

The preprocessor recognized `@angular/core` by walking up to the nearest
`package.json` named `@angular/core`, which ngtsc never does and which a
host without file system access cannot do. Follow ngtsc's rule instead:
the internal `angularCoreCompilation` option, falling back to the
tsconfig's `_isAngularCoreCompilation`, then to an explicit
`r3SymbolsFile`, and otherwise to whether the root `r3_symbols.ts`
exports `ITS_JUST_ANGULAR = true` (ngtsc's `isAngularCorePackage`).

The `ITS_JUST_ANGULAR` check reads `r3_symbols.ts` through the query
engine, so edits to it invalidate dependent analyses. A new
pseudo-dependency on the `r3_symbols.ts` root lookup re-runs only the
queries that read it when the roots add or remove that file, instead of
every query on each root change.

Also remove the unused `resolve_to_dts` helper.
@clydin
clydin marked this pull request as ready for review October 30, 2026 01:20
@clydin
clydin requested a review from crisbeto October 30, 2026 01:20
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 30, 2026
@clydin
clydin requested a review from mattrbeck October 30, 2026 01:36
@clydin
clydin removed the request for review from crisbeto October 30, 2026 23:04
@clydin clydin removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 30, 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 target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants