fix(migrations): preserve component imports when pruning NgModules in…#64186
fix(migrations): preserve component imports when pruning NgModules in…#64186SkyZeroZx wants to merge 1 commit intoangular:mainfrom
Conversation
… standalone migration This fix preserves component imports by adding missing statements and replacing module references with the correct component
|
@SkyZeroZx thank you for taking this on! I just tried patching this into our version of angular and it doesn't fix the problem we were facing, of the schematic removing NgModule imports without replacing it with the standalone component import, so I'm not sure the test cases I provided accurately capture the bug we were facing. As this introduces a lot of extra code for a non real issue, it's probably best to close this for now until I can create a more accurate reproduction of the issue we have. |
|
That's strange. I have some small, similar test cases that you provided in a repository for testing, and they worked for me. However, there is one case where if the component and module are in the same file, they won't migrate correctly. |
… standalone migration (angular#64186) This fix preserves component imports by adding missing statements and replacing module references with the correct component PR Close angular#64186
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
… standalone migration
This fix preserves component imports by adding missing statements and replacing module references with the correct component
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #63945
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Should we consider the case where a module and component are defined in the same file as an edge case that doesn’t justify adding extra complexity to the migration logic, or is it worth handling automatically to avoid requiring manual cleanup?