next.js
next.js copied to clipboard
codemod(turbopack): Rewrite more Vc fields in structs as ResolvedVc
This is a (mostly) machine-generated PR.
This uses a much updated version of the ast-grep based codemod script from #70927, which can now match a bunch more patterns.
Codemod scripts: https://github.com/vercel/turbopack-resolved-vc-codemod/tree/90518e64cfaf9328546ff4688692f16f54d4fc3e
I did a small bit of cleanup after running the script with:
sg -U --pattern '$OBJ.resolve().await?.to_resolved().await?' -r '$OBJ.to_resolved().await?'
Notable additions since last time are:
- Runs the compiler/fixer in a loop a few times, as fixing an issue often allows compilation to get further, creating new errors.
- Can apply compiler-suggested edits (usually these are manual derefs needed with
*
) - Knows how to rewrite
$OBJ.cell()
to$OBJ.resolved_cell()
- Knows how to rewrite
Vc::cell($ARG)
toResolvedVc::cell($ARG)
- Knows how to rewrite
$TYPE::cell($ARG)
to$TYPE::resolved_cell($ARG)
. - Knows how to add
.to_resolved().await?
to expressions.