remix-run / react-router

Declarative routing for React
https://reactrouter.com
MIT License
53.07k stars 10.31k forks source link

Nice to Have: npx migrate-react-router-v7 cli #11637

Open ryanflorence opened 4 months ago

ryanflorence commented 4 months ago

We already have npx upgrade-remix, could work like that.

brophdawg11 commented 3 months ago

Main codemods

jrestall commented 3 months ago

Thanks for creating codemods, will make converting a very large monorepo with several remix apps a lot easier.

Any love for the stub testing api changes? We have 1000's of imports that will need to change. Hopefully it's just the function name and not deeper breaking changes like the function parameters?

createRemixStub -> createRoutesStub

import { createRemixStub } from "@remix-run/testing"; -> import { createRoutesStub } from "react-router";
// Before
const RemixStub = createRemixStub([
      {
        path: "/accounts",
        ...

// After
const RoutesStub = createRoutesStub([
      {
        path: "/accounts",
        ...
brophdawg11 commented 3 months ago

Good catch! Added to the list above - we've already renamed to createRoutesStub in the v7 code 👍