Use case
Framework
Owner
Add Cookie Path To All Methods
This codemod adds
{ path: '/' }
to allcookies
method calls in your TypeScript project. It ensures that cookies are set, deleted, or serialized with the correct path specified, which helps in consistent cookie handling across different environments.Event Handling On Change
This codemod automates the update of your
onChange
event handler function to support the newDescendant[]
type and selection handling introduced in version 0.104.Insert Nodes
Theis transformation ensures that calls to
Transforms.insertNodes
in the updated API remain functional and behave identically to their usage in the older API (v0.88) while adhering to the new, more explicit parameterization.With React Integration
This codemod transforms the usage of
withReact(createEditor())
into auseMemo
-based structure, which wraps the editor creation and introduces an inline-checking function (isInline
) for the editor instance. This transformation optimizes the creation of the editor object by memoizing it.Cursor Selection Handling
This codemod shows how to migrate cursor and
selection
handling from Slate v0.88 to v0.104, including the Preventing runtime errors from null selections.Editor Node
This codemod transforms
Editor.node
usage intoEditor.nodes
format. It also handles cases with both destructuring and non-destructuring .The new API returns an iterator of nodes instead of a single node, requiring changes to existing code patterns.Editor Has Path
This guide covers the migration of
Editor.hasPath
usage from Slate.js v0.88 to v0.104. The API has changed from a property-based check to a function call pattern, requiring updates to existing code.Editor Has Block
Transform
Editor.hasBlock
toEditor.nodes
This codemod replaces occurrences of Editor.hasBlock with the equivalent Editor.nodes structure. The transformation updates the code to use a more modern API, ensuring compatibility and improved functionality.
Custom Renderers
This codemod updates the
renderElement
function to include TypeScript typings and adds a default case for rendering unsupported element types.Deno Refactor TLS Certs Reading
This codemod updates the usage of TLS certificate loading in Deno by replacing deprecated properties with their new counterparts. In Deno V2, loading certificates directly from files is now deprecated. Instead, you should read the certificates yourself.
Flatten Deno.Json
This codemod helps developers migrate their deno.json configuration files to the new flattened schema format, making them easier to read and write. It automates the transformation of nested properties to their new top-level structure as outlined in recent Deno updates.
React 17 Default Props To Params
Example
This codemod turns X into Y. It also does Z. Note: this is a contrived example. Please modify it.
I18n/23/Remove Options
Modification of the InterpolationOptions type. In version 23.0.0, the ns property within InterpolationOptions is now constrained to be of type Namespace instead of being a string or a readonly string[]. This change requires you to adjust your code accordingly.
Webpack To Rspack/Migrate Update Babel Loader To Swc Loader
Using builtin:swc-loader offers better performance compared to the babel-loader and the external swc-loader, as it avoids frequent communication between JavaScript and Rust.
React Router/7/Migration Recipe
This codemods designed to facilitate the migration of your project from React Router to version 7. Each codemod targets specific changes and improvements introduced in React Router v7, ensuring a smoother transition.
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
Node/22.8.0/Vm Context Modifications Codemod
Node.js implements a flavor of vm.createContext() and friends that creates a context without contextifying its global object when vm.constants.DONT_CONTEXTIFY is used. This is suitable when users want to freeze the context (impossible when the global is contextified i.e. has interceptors installed) or speed up the global access if they don't need the interceptor behavior.
Node/22.8.0/Enable Compile Cache In Start Server
This release adds a new API module.enableCompileCache() that can be used to enable on-disk code caching of all modules loaded after this API is called. Previously this could only be enabled by the NODE_COMPILE_CACHE environment variable, so it could only set by end-users. This API allows tooling and library authors to enable caching of their own code. This is a built-in alternative to the v8-compile-cache/v8-compile-cache-lib packages, but have better performance and supports ESM.
Three/R168/Migration Recipe
This recipe is a set of codemods that will help migrate to three r168 from three r167 .