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

refactor(turbo-tasks): Codemod/migrate all ResolvedVc casting callsites to use the new synchronous APIs #75547

Open
wants to merge 2 commits into
base: canary
Choose a base branch
from

Conversation

bgw
Copy link
Member

@bgw bgw commented Feb 1, 2025

This is a follow-up to #75055.

After #75055, the async methods are just facades around the synchronous versions, to avoid breaking the API.

I made this PR using:

sg run -p 'ResolvedVc::try_sidecast::<$$$TY>($$$ARGS).await?' -r 'ResolvedVc::try_sidecast_sync::<$$$TY>($$$ARGS)' -U
sg run -p 'ResolvedVc::try_sidecast($$$ARGS).await?' -r 'ResolvedVc::try_sidecast_sync($$$ARGS)' -U
sg run -p 'ResolvedVc::try_downcast::<$$$TY>($$$ARGS).await?' -r 'ResolvedVc::try_downcast_sync::<$$$TY>($$$ARGS)' -U
sg run -p 'ResolvedVc::try_downcast($$$ARGS).await?' -r 'ResolvedVc::try_downcast_sync($$$ARGS)' -U
sg run -p 'ResolvedVc::try_downcast_type::<$$$TY>($$$ARGS).await?' -r 'ResolvedVc::try_downcast_type_sync::<$$$TY>($$$ARGS)' -U
sg run -p 'ResolvedVc::try_downcast_type($$$ARGS).await?' -r 'ResolvedVc::try_downcast_type_sync($$$ARGS)' -U

Delete the implementation of the non-sync methods, and then:

sg run -p 'ResolvedVc::try_sidecast_sync' -r 'ResolvedVc::try_sidecast' -U
sg run -p 'ResolvedVc::try_downcast_sync' -r 'ResolvedVc::try_downcast' -U
sg run -p 'ResolvedVc::try_downcast_type_sync' -r 'ResolvedVc::try_downcast_type' -U

Then rename the methods implementations in resolved.rs to match.

@ijjk ijjk added created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js. labels Feb 1, 2025
Copy link
Member Author

bgw commented Feb 1, 2025

@bgw bgw requested review from kdy1, sokra and wbinnssmith February 1, 2025 02:11
@bgw bgw marked this pull request as ready for review February 1, 2025 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants