Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ryanflorence opened this issue Jun 10, 2024 · 3 comments
Open

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

ryanflorence opened this issue Jun 10, 2024 · 3 comments
Assignees
Labels

Comments

@ryanflorence
Copy link
Member

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

@brophdawg11
Copy link
Contributor

brophdawg11 commented Jul 9, 2024

Main codemods

  • package.json: @remix-run/* -> @react-router/*
  • package.json: @remix-run/react -> react-router
  • Update all imports to use the new package names
  • RemixServer -> ServerRouter
  • RemixBrowser -> HydratedRouter
  • createRemixStub -> createRoutesStub

@jrestall
Copy link

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
Copy link
Contributor

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

@brophdawg11 brophdawg11 changed the title npx migrate-react-router-v7 cli Nice to Have: npx migrate-react-router-v7 cli Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants