Use case
Framework
Owner
Next/15/Refactor Imports From @Next/Font To Next/Font
Refactor Imports from @next/font to next/font
Next/13/App Router Recipe
The App Router Recipe is a set of codemods that assist you with the pages-to-app migration process.
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/14/Next Og Import
This codemod moves transforms imports from
next/server
tonext/og
for usage of Dynamic OG Image Generation.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/14/Metadata To Viewport Export
This codemod migrates certain viewport metadata to
viewport
export.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Upsert Use Client Directive
Since Next.js 13.4, you can mark the files that contain only client-side code with the
use client
directive at the top.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Replace Use Search Params
A recent update in Next.js brought a breaking change: the
useSearchParams
hook no longer includesparams
. To ease the migration, the newuseCompatSearchParams
hook can be used. This hook mimics the behavior of the olduseSearchParams
in two ways:Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Replace Next Router
Since Next.js 13.4, you can use the following hooks from the
next/navigation
module:Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Replace Next Head
This codemod generates a static metadata object based on meta tags managed by
next/head
.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Replace Api Routes
Replaces API Routes with Route Handlers.
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Remove Next Export
The
next export
command is deprecated. This codemod dangerously removes all references to the command in*.md
,*.sh
,package.json
. It also adds a propertyoutput
with the valueexport
to themodule.exports
object innext.config.js
files.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Remove Get Static Props
The following data fetching methods are no longer available in the
app
directory:Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Next Image To Legacy Image
This codemod safely migrates existing Next.js 10, 11, 12 applications importing
next/image
to the renamednext/legacy/image
import in Next.js 13 by replacingnext/image
imports withnext/legacy/image
and replacingnext/future/image
imports withnext/image
.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/New Link
Safely removes
<a>
fromLink
components imported from thenext/link
module or adds thelegacyBehavior
prop on the component level.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/New Image Experimental
This codemod dangerously migrates the usages of the
Image
component from thenext/legacy/image
module to thenext/image
module. This is achieved by adding inline styles and removing unused props.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Move Css In Js Styles
This highly experimental codemod moves the CSS-in-JS styles into the CSS Modules.
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Comment Deletable Files
This codemod is recommended when migrating from the
/pages
to the/app
directory.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Built In Next Font
This codemod transforms the module specifier
@next/font/*
in import statements intonext/font/*
.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/App Directory Boilerplate
The first step to migrate your pages to the
app
directory is to provide a new file structure, respected by the App router.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Next/13/Ab Test
This codemod generates boilerplate code for A/B tests using the Next.js middlewares. The middleware controls the redirects from the legacy to the future pages. You can control the redirection probability and targeted pages using environment variables.
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community