vercel / ai

Build AI-powered applications with React, Svelte, Vue, and Solid
https://sdk.vercel.ai/docs
Other
10.23k stars 1.54k forks source link

feat (packages/codemods): Allow null transforms to represent no-ops. #3732

Closed shaper closed 1 week ago

shaper commented 1 week ago

jscodeshift treats transforms that return null as having performed no code mutations. This can improve performance and avoid unnecessary rewriting of input code.

This change updates our test utility to treat codemods similar to jscodeshift.

In an upcoming change we'll update our codemod base to take advantage of this to reduce unnecessary transformations we currently see when running on larger codebases.