Use case
Framework
Owner
Fastify/5/Remove Done Callback
This codemod updates
fastify.register
to usereturn
instead ofdone
, reflecting changes in Fastify v5 for asynchronous plugin registration.Fastify/5/MigrationRecipe
This recipe provides a set of codemods designed to assist with migrating to Fastify 5. Each codemod addresses specific changes and enhancements introduced in Fastify 5.
Fastify/5/Rename Logger To Logger Instance
This codemod updates the Fastify logger configuration by renaming the
logger
option tologgerInstance
, in line with Fastify v5 changes.Fastify/5/Make Reply Trailer Async
This codemod updates the
reply.trailer
method to use anasync
function for handling trailers, aligning with Fastify v5's support for asynchronous operations in trailers.Fastify/5/Redirect Arg Order
This codemod updates
reply.redirect
by placing the status code as the second argument, as per Fastify v5 conventions.Fastify/5/GetResponseTime To ElapsedTime
This codemod converts
reply.getResponseTime()
toreply.elapsedTime
, reflecting changes in Fastify v5 for retrieving response time.Fastify/5/Req Connection To Socket
This codemod updates references from
req.connection
toreq.socket
, reflecting changes in Fastify v5's request handling.Fastify/5/Route Schema Enhancement
This codemod enhances the schema definition for query strings by converting it to the full object schema format, adding properties and required fields.
Fastify/5/Decorate Request To Getter Method
This codemod transforms
fastify.decorateRequest
with static objects into the new Fastify v5 pattern using a getter function.Fastify/5/Add Expose Head Routes Option
This codemod introduces the
exposeHeadRoutes: false
option to avoid automaticHEAD
route exposure, while keeping manually definedHEAD
routes intact.Before
Fastify/5/Replace Reply Sent With Hijack
This codemod turns
reply.sent = true
intoreply.hijack()
, updating to the new Fastify v5 method for handling manual responses.Fastify/5/Replace Hardcoded Url In Hasroute
This codemod highlights the shift in how routes with dynamic parameters should be referenced in
fastify.hasRoute
in Fastify v5.Fastify/5/Listen Arg Transformation
This codemod turns
fastify.listen(8000)
intofastify.listen({ port: 8000 })
, reflecting the highlights of the migration from the oldlisten
method signature to the new object-based approach in Fastify v5.Before
Fastify/5/Req Params HasOwnProperty To ObjectHasOwn
This codemod turns
req.params.hasOwnProperty('name')
intoObject.hasOwn(req.params, 'name')
, reflecting the new Fastify v5 approach to property checking.MoveStateToChildComponent
This codemod refactors React components by moving
useState
hooks from parent components to child components when the state and setter function (setState
) are passed down as props. The goal is to simplify the parent components and allow child components to manage their own internal state when appropriate.Meteor/V3/Mongo Db Async Methods
This codemod updates synchronous MongoDB operations in a Meteor project to use their asynchronous counterparts, making the code compatible with modern JavaScript best practices (using
async/await
). It transforms methods such asfind
,findOne
,insert
,update
,remove
, andupsert
to their asynchronous equivalents by appendingAsync
to method names and introducingawait
.Meteor/V3/Api Rename Express Migration
This codemod automates the process of updating API names from Connect to Express in your project. The codemod is specifically designed to align your codebase with the new naming conventions introduced after switching from Connect to Express in Meteor 3.0.
Valtio/V2/Migration Recipe
This recipe provides a collection of codemods to help you migrate your codebase to Valtio v2. These codemods are designed to streamline the transition process by automating common code transformations due to behavioral changes in Valtio v2.
Valtio/V2/Use Snapshot Migration
This codemod automates the migration of Valtio code to accommodate changes in the behavior of
useSnapshot()
. In recent updates,useSnapshot()
has been modified for better compatibility withuseMemo
and the upcoming React compiler. This codemod updates your code to ensure optimal performance and compatibility with these changes.Valtio/V2/Deep Clone Proxy Objects
In Valtio v2, the behavior of the
proxy(obj)
function has changed. In v1,proxy(obj)
was a pure function that deeply copied the objectobj
. In v2,proxy(obj)
is an impure function that deeply modifiesobj
. This codemod updates your code to accommodate these changes by incorporatingdeepClone
to ensure that objects are deeply copied as they were in v1.