Use case
Framework
Owner
Remix Js/V2/Migration Recipe
This recipe is a set of codemods that will help migrate to Remix.js v2.
Remix Js/V2/Webpack V2 Migrate Dev Server Port
In your remix.config.js, rename devServerPort to future.v2_dev.port.
Remix Js/V2/Typescript 2 Update Links Function And Property Names
Route links properties should all be the React camelCase values instead of HTML lowercase values.
Remix Js/V2/Rename Browser Build Directory
In your remix.config.js, rename browserBuildDirectory to assetsBuildDirectory.
Before
Remix Js/V2/Remix Run 1 Use Transition To Use Navigation
This hook is now called useNavigation to avoid confusion with the recent React hook by the same name. It also no longer has the type field and flattens the submission object into the navigation object itself.
Remix Js/V2/Remix 1 Use Route Error Codemod
In v1, a thrown Response rendered the closest CatchBoundary while all other unhandled exceptions rendered the ErrorBoundary. In v2 there is no CatchBoundary and all unhandled exceptions will render the ErrorBoundary, response or otherwise.
Remix Js/V2/Remix 1 Replace Response With Create Readable Stream
ne place this is likely to surface and require a change is your app/entry.server.tsx file, where you'll also need to convert the Node PassThrough into a web ReadableStream via createReadableStreamFromReadable
Remix Js/V2/Remix 1 Add Meta V1 Wrapper
Using the metaV1 function, you can pass in the meta function's arguments and the same object it currently returns. This function will use the same merging logic to merge the leaf route's meta with its direct parent route meta before converting it to an array of meta descriptors usable in v2.
Remix Js/V2/Nodejs Module Exports Server Build Directory To Path
In your remix.config.js, rename serverBuildDirectory to serverBuildPath and specify a module path, not a directory.
Remix Js/V2/Fetcher Submission Properties Flattening
Like useNavigation, useFetcher has flattened the submission and removed the type field.
Remix Js/V2/Add Matches Param And Array Return To Meta Export
Instead of returning an object from meta, you will now return an array of descriptors and manage the merge yourself. This brings the meta API closer to links, and it allows for more flexibility and control over how meta tags are rendered.
Remix/Single Fetch/Recipe
This codemod runs all of the Single Fetch codemods in order
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Remix/2/Route Exports To Define Route
This codemod adds a
defineRoute({ action, loader, Component })
export to your routes and removes the old exports.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Remix/Single Fetch/Replace Types
This codemod replaces the UIMatch and MetaArgs types with UIMatch_SingleFetch and MetaArgs_SingleFetch
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Remix/Single Fetch/Redirect To Response
This codemod removes Remix's
redirect()
andredirectDocument()
helper functions to take advantage of the new Single Fetch features.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Remix/Single Fetch/New Response To Response
This codemod removes
new Response()
calls in actions and loaders and replaces them with mutations to the newresponse
arg from Single Fetch.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Remix/Single Fetch/Json To Response
This codemod removes Remix's
json()
helper function to take advantage of the new Single Fetch features.Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Remix/Single Fetch/Include Typedef
Adds the typings for Single Fetch to your tsconfig.json file.
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Remix/Single Fetch/Enable Install Globals Native Fetch
Enables the nativeFetch flag in all instances of installGlobals
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community
Remix/Single Fetch/Enable Flag
Enables the single fetch flag in the Remix Vite config.
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community