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

Upgrade to React Router 7 #887

Open
MoSattler opened this issue Nov 22, 2024 · 9 comments
Open

Upgrade to React Router 7 #887

MoSattler opened this issue Nov 22, 2024 · 9 comments

Comments

@MoSattler
Copy link
Contributor

React Router 7 has been released, and it offers a few nice improvements and new features. Based on the current setup, it looks like epic-stack is already in a good position to perform this upgrade without major changes.

Here’s the official guide for upgrading from Remix: Upgrading to React Router 7.

@kentcdodds
Copy link
Member

This is definitely the plan. Just a matter of finding time to make it happen.

@MoSattler
Copy link
Contributor Author

MoSattler commented Nov 23, 2024

I’d love to help out with this. If I’m seeing it correctly, the first step should be enabling the last few missing pieces of the future flag docs:

  • Updating tsconfig.json
  • Configuring path aliases
  • Enabling v3_singleFetch
  • Enabling v3_routeConfig

Would you mind if I take a shot at tackling some of these?

@kentcdodds
Copy link
Member

Sure! Someone already has a PR for enabling single fetch. They had to change more than I expected so I need to review it more carefully and I just haven't had time. Hopefully I'll have time soon.

@rory-ferguson
Copy link

One of the dependencies @nasa-gcn/remix-seo doesn't support RRv7 so I eagerly await to see how the sitemap/robots problem is solved.

@itsmegood
Copy link
Contributor

Any update regarding how long will it be.

@sbaechler
Copy link

I was trying a migration today but got stuck. It is not clear how the return value from loaders and actions should be changed. In Remix the return value was a Request that could be thrown. As I understand the new way is:

  • Return a plain object in a success case
  • Use the data() function to return errors and status codes other than 200 and deal with those in a error boundary

The question is, can you still throw a response?

For some reason I am getting a lot of import order lint errors.

@kentcdodds
Copy link
Member

You should still be able to throw a response.

@sbaechler
Copy link

@kentcdodds I think I got as far as I could from the information I had in the migration docs. The migration is quite substantial (currently 81 files changed).

https://github.com/sbaechler/epic-stack/pull/1/files

This should be a good base to continue with the migration. I am afraid the remaining issues require better knowledge about the epic stack and the inner workings of React Router.

I am still getting 71 Typescript errors in 24 files and the build is failing because of an issue with the $ char in the import filename. I am still using file based routes, although I think it would be better to also migrate those to config based.

@kentcdodds
Copy link
Member

That's looking great so far. Thank you!

Once this year is over I'll finally have time to look at this (lots of huge personal projects going on recently) and I'll get it across the finish line. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants