Skip to main content
PRONeed enterprise-grade codemods tailored to your codebase?

Assess, plan, evolve.

Reusable compiler-aware skills that help coding agents understand, plan, and safely evolve your codebase.

5 packages

Sort by
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. ### Before ```ts import { useCatch } from '@remix-run/react'; export function CatchBoundary() { const caught = useCatch(); return ( < div > < h1 > Oops < /h1> < p > Status: { caught.status } < /p> < p > { caught.data.message } < /p> < /div> ); } export function ErrorBoundary({ error }) { console.error(error); return ( < div > < h1 > Uh oh... < /h1> < p > Something went wrong < /p> < pre > { error.message || 'Unknown error' } < /pre> < /div> ); } ``` ### After ```ts import { useRouteError, isRouteErrorResponse } from '@remix-run/react'; export function ErrorBoundary() { const error = useRouteError(); // when true, this is what used to go to `CatchBoundary` if (isRouteErrorResponse(error)) { return ( < div > < h1 > Oops < /h1> < p > Status: { error.status } < /p> < p > { error.data.message } < /p> < /div> ); } let errorMessage = 'Unknown error'; if (isDefinitelyAnError(error)) { errorMessage = error.message; } return ( < div > < h1 > Uh oh... < /h1> < p > Something went wrong. < /p> < pre > { errorMessage } < /pre> < /div> ); } ```

  • remix.js
  • v2
  • +1
Ddfordp
v1.0.0
0
2 years ago
@e18e/error-cause

# Error Cause Codemod ## Introduction This codemod removes the import of the `error-cause/auto` package from the codebase. By eliminating this unnecessary dependency, it helps reduce bundle size and improve the performance of the application. ### Before ```javascript import { createError } from 'error-cause/auto'; const error = createError('An error occurred'); ``` ### After ```javascript const error = new Error('An error occurred'); ```

  • e18e
  • module-replacement
Ee18e
v1.0.5
36
2 years ago
react-router/6/use-route-match

  • migration
CCodemod
v1.0.1
14
a year ago
react-router/6/use-navigate

  • migration
CCodemod
v1.0.1
43
a year ago
fastify/4/await-register-calls

This codemod helps to improve error reporting in route definitions, route registration is now synchronous, so if you specify an onRoute hook in a plugin, you should now use await.register() ## What Changed To improve error reporting in route definitions, route registration is now synchronous. As a result, if you specify an onRoute hook in a plugin you should now use await.register() ## Before ```jsx fastify.register((instance, opts, done) => { instance.addHook('onRoute', (routeOptions) => { const { path, method } = routeOptions; console.log({ path, method }); }); done(); }); ``` ## After ```jsx await fastify.register((instance, opts, done) => { instance.addHook('onRoute', (routeOptions) => { const { path, method } = routeOptions; console.log({ path, method }); }); done(); }); ```

  • fastify
  • 4
  • +1
Aarshcodemod
v1.0.4
1,171
a year ago

Build your own codemod!

Describe the migration you need and Codemod Agent will create a codemod for you.

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.