Skip to content
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

Upgrade: Improve heuristics around important codemod #14774

Merged

Conversation

philipp-spiess
Copy link
Member

@philipp-spiess philipp-spiess commented Oct 24, 2024

This PR improves the heuristics around the important codemod (e.g. !border => border!) as we noticed a few more cases where we the current heuristics was not enough.

Specifically, we made it not migrate the candidate in the following conditions:

  • When there's an immediate property access: { "foo": !border.something + ""}
  • When it's used as condition in the template language: <div v-if="something && !border"></div> or <div x-if="!border"></div>

Test plan

I added test cases to the unit tests and updated the integration test to contain a more sophisticated example.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @philipp-spiess and the rest of your teammates on Graphite Graphite

@philipp-spiess philipp-spiess marked this pull request as ready for review October 24, 2024 12:26
@philipp-spiess philipp-spiess requested a review from a team as a code owner October 24, 2024 12:26
@philipp-spiess philipp-spiess force-pushed the 10-24-upgrade_improve_heuristics_around_important_codemod branch 2 times, most recently from 9bce67f to 6b28e58 Compare October 24, 2024 12:27
@philipp-spiess philipp-spiess force-pushed the 10-24-upgrade_improve_heuristics_around_important_codemod branch from ddee4c6 to 8abbc77 Compare October 24, 2024 15:21
@adamwathan adamwathan merged commit 3f2afaf into next Oct 24, 2024
2 checks passed
@adamwathan adamwathan deleted the 10-24-upgrade_improve_heuristics_around_important_codemod branch October 24, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants