Skip to content

Various improvements for the signal input migration #57318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

devversion
Copy link
Member

See individual commits.

Based on top of #57308

@angular-robot angular-robot bot added area: performance Issues related to performance area: migrations Issues related to `ng update`/`ng generate` migrations labels Aug 9, 2024
@ngbot ngbot bot added this to the Backlog milestone Aug 9, 2024
…ompatibility reasons

Adds a markdown document capturing some of the incompatibilty reasons
on why the input wasn't migrated.
Introduces a best effort mode for the signal input migration. This mode
can be used to aggresively migrate as much as possible, ignoring most
of the incompatibility reasons, like "writes to the input".
Instead of fiddling manually with the imports, which worked well, but
comes at a cost of complexity— we are now using the canonical import
manager. This simplifies deletion, insertion and updating of imports.

Notably, our import manager is not super great at preserving whitespaces
right now, but we assume a formatter runs over migrated code anyway.
…alyze phases

Instead of revisiting each source file, and each of its child nodes
twice, we now visit them together using a grouped AST visitor that only
traverses each source file once.

This seemed to speed up migration by 6-8% locally, but is likely
noticable better with large compilation scopes.
@devversion devversion force-pushed the signal-migration-improv branch 2 times, most recently from d9b45e0 to ba116c7 Compare August 9, 2024 18:41
…ation

As of this commit, the migration will also inspect safe property reads
and migrate them, if they reference an input that is being migrated.
@devversion devversion force-pushed the signal-migration-improv branch from ba116c7 to 4b998a4 Compare August 9, 2024 18:47
@devversion devversion requested a review from crisbeto August 9, 2024 18:57
@devversion devversion marked this pull request as ready for review August 9, 2024 18:57
@devversion devversion added the target: patch This PR is targeted for the next patch release label Aug 9, 2024
@devversion devversion added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release and removed action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Aug 12, 2024
@devversion devversion added target: rc This PR is targeted for the next release-candidate and removed target: minor This PR is targeted for the next minor release labels Aug 12, 2024
@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit 52673e6.

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

AndrewKushnir pushed a commit that referenced this pull request Aug 12, 2024
…ompatibility reasons (#57318)

Adds a markdown document capturing some of the incompatibilty reasons
on why the input wasn't migrated.

PR Close #57318
AndrewKushnir pushed a commit that referenced this pull request Aug 12, 2024
…57318)

Introduces a best effort mode for the signal input migration. This mode
can be used to aggresively migrate as much as possible, ignoring most
of the incompatibility reasons, like "writes to the input".

PR Close #57318
AndrewKushnir pushed a commit that referenced this pull request Aug 12, 2024
…57318)

Instead of fiddling manually with the imports, which worked well, but
comes at a cost of complexity— we are now using the canonical import
manager. This simplifies deletion, insertion and updating of imports.

Notably, our import manager is not super great at preserving whitespaces
right now, but we assume a formatter runs over migrated code anyway.

PR Close #57318
AndrewKushnir pushed a commit that referenced this pull request Aug 12, 2024
…alyze phases (#57318)

Instead of revisiting each source file, and each of its child nodes
twice, we now visit them together using a grouped AST visitor that only
traverses each source file once.

This seemed to speed up migration by 6-8% locally, but is likely
noticable better with large compilation scopes.

PR Close #57318
AndrewKushnir pushed a commit that referenced this pull request Aug 12, 2024
…ation (#57318)

As of this commit, the migration will also inspect safe property reads
and migrate them, if they reference an input that is being migrated.

PR Close #57318
AndrewKushnir pushed a commit that referenced this pull request Aug 12, 2024
…57318)

Introduces a best effort mode for the signal input migration. This mode
can be used to aggresively migrate as much as possible, ignoring most
of the incompatibility reasons, like "writes to the input".

PR Close #57318
AndrewKushnir pushed a commit that referenced this pull request Aug 12, 2024
…57318)

Instead of fiddling manually with the imports, which worked well, but
comes at a cost of complexity— we are now using the canonical import
manager. This simplifies deletion, insertion and updating of imports.

Notably, our import manager is not super great at preserving whitespaces
right now, but we assume a formatter runs over migrated code anyway.

PR Close #57318
AndrewKushnir pushed a commit that referenced this pull request Aug 12, 2024
…alyze phases (#57318)

Instead of revisiting each source file, and each of its child nodes
twice, we now visit them together using a grouped AST visitor that only
traverses each source file once.

This seemed to speed up migration by 6-8% locally, but is likely
noticable better with large compilation scopes.

PR Close #57318
AndrewKushnir pushed a commit that referenced this pull request Aug 12, 2024
…ation (#57318)

As of this commit, the migration will also inspect safe property reads
and migrate them, if they reference an input that is being migrated.

PR Close #57318
@angular-automatic-lock-bot
Copy link

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 Sep 12, 2024
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 area: performance Issues related to performance target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants