Skip to content

refactor(migrations): ensure tsurge can properly emit references in g3#62447

Closed
devversion wants to merge 1 commit intoangular:mainfrom
devversion:tsurge-1p-emit
Closed

refactor(migrations): ensure tsurge can properly emit references in g3#62447
devversion wants to merge 1 commit intoangular:mainfrom
devversion:tsurge-1p-emit

Conversation

@devversion
Copy link
Copy Markdown
Member

Currently when Tsurge runs in g3, it creates a bare bones Angular compiler plugin. The tsconfigs from compilation units may set options like "useHostForImportGeneration", but the Ngtsc logic doesn't enable because the fileNameToModuleName method is not defined on the host.

This can break reference emission for Tsurge analyzers/programs and result in subtle differences to real ng_module compilations. This commit fixes this by making the method available in 1P Tsurge.

Notably, reference emission can occur during analysis— so even if migrations aren't "emitting TS -> JS" output.

@devversion devversion requested a review from crisbeto July 3, 2025 07:28
@devversion devversion added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jul 3, 2025
@angular-robot angular-robot bot added the area: migrations Issues related to `ng update`/`ng generate` migrations label Jul 3, 2025
@ngbot ngbot bot added this to the Backlog milestone Jul 3, 2025
Currently when Tsurge runs in g3, it creates a bare bones Angular
compiler plugin. The tsconfigs from compilation units may set options
like "useHostForImportGeneration", but the Ngtsc logic doesn't enable
because the `fileNameToModuleName` method is not defined on the host.

This can break reference emission for Tsurge analyzers/programs and
result in subtle differences to real `ng_module` compilations. This
commit fixes this by making the method available in 1P Tsurge.

Notably, reference emission can occur during analysis— so even if
migrations aren't "emitting TS -> JS" output.
@devversion devversion added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jul 3, 2025
@ngbot

This comment was marked as outdated.

thePunderWoman pushed a commit that referenced this pull request Jul 3, 2025
#62447)

Currently when Tsurge runs in g3, it creates a bare bones Angular
compiler plugin. The tsconfigs from compilation units may set options
like "useHostForImportGeneration", but the Ngtsc logic doesn't enable
because the `fileNameToModuleName` method is not defined on the host.

This can break reference emission for Tsurge analyzers/programs and
result in subtle differences to real `ng_module` compilations. This
commit fixes this by making the method available in 1P Tsurge.

Notably, reference emission can occur during analysis— so even if
migrations aren't "emitting TS -> JS" output.

PR Close #62447
thePunderWoman pushed a commit that referenced this pull request Jul 3, 2025
#62447)

Currently when Tsurge runs in g3, it creates a bare bones Angular
compiler plugin. The tsconfigs from compilation units may set options
like "useHostForImportGeneration", but the Ngtsc logic doesn't enable
because the `fileNameToModuleName` method is not defined on the host.

This can break reference emission for Tsurge analyzers/programs and
result in subtle differences to real `ng_module` compilations. This
commit fixes this by making the method available in 1P Tsurge.

Notably, reference emission can occur during analysis— so even if
migrations aren't "emitting TS -> JS" output.

PR Close #62447
@thePunderWoman
Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit 902121e.

The changes were merged into the following branches: main, 20.0.x, 20.1.x

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: migrations Issues related to `ng update`/`ng generate` migrations target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants