monorepo icon indicating copy to clipboard operation
monorepo copied to clipboard

Will Remix-PWA support the move to React Router v7?

Open henryStelle opened this issue 1 year ago • 45 comments

Hi, This seems like a great package. However, it seems Remix is "taking a pause" now that all the functionality has moved to React Router v7:

  • https://remix.run/blog/merging-remix-and-react-router
  • https://remix.run/blog/react-router-v7

Will Remix-PWA publish future versions based around React Router v7 instead of Remix?

Thanks!

henryStelle avatar Nov 30 '24 14:11 henryStelle

Remix PWA would support react router as well as Remix. React Router v7 is very similar to Remix, and my goal is to ensure wether you choose to use existing Remix versions, or new React router versions, Remix PWA would provide support for them

ShafSpecs avatar Dec 05 '24 14:12 ShafSpecs

Hi, thanks for the hard work here!

Just curious if there is a timeline in mind?

I tried remix-pwa v3 today and noticed that it was not compatible with react-router v7, because remix-pwa made assumption that remix-run/react would be installed in the project. In addition, the documentation website has not been up-to-date too: it mentions v3, and v4, but the github repo itself is in the middle of releasing v5?

As someone new to do this package, I would love to know whether v5 is almost ready, or should I give v4 a try?

sindras avatar Dec 16 '24 01:12 sindras

The docs also has a next section that's dedicated to v5, the docs aren't fully done yet tho. Regarding the timeline, I don't have one. React Router v7 is similar to Remix, but with a few distinctions that I need to explore

ShafSpecs avatar Dec 16 '24 11:12 ShafSpecs

Hey @ShafSpecs. Any movement on this?

IgnisDa avatar Jan 31 '25 10:01 IgnisDa

Hey @ShafSpecs. Any movement on this?

Yeah, it's been pretty slow and would be a dev release for a while, but I am working on this

ShafSpecs avatar Jan 31 '25 11:01 ShafSpecs

@ShafSpecs Is there a github branch i can try out for this?

IgnisDa avatar Jan 31 '25 13:01 IgnisDa

@ShafSpecs Is there a github branch i can try out for this?

Not yet unfortunately, I am still trying to get React Router v7 to work on my machine

ShafSpecs avatar Jan 31 '25 18:01 ShafSpecs

Maybe I can help? Can you post the error? I have it working on a new react-router app, as well as upgraded a big remix application to it.

IgnisDa avatar Jan 31 '25 18:01 IgnisDa

Maybe I can help? Can you post the error? I have it working on a new react-router app, as well as upgraded a big remix application to it.

This branch (v5-rc): https://github.com/remix-pwa/monorepo/tree/v5-rc/sandboxes/rr7

I re-worked the sandbox to contain remix spa apps, normal ssr apps and a react router v7 app. The Remix apps work, but React Router throws errors for some reason

Unexpected Server Error

Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner, _store}). If you meant to render a collection of children, use an array instead.

ShafSpecs avatar Jan 31 '25 18:01 ShafSpecs

Okay i got it working. Seems to be a problem with the sandbox being inside a workspace. Changes i made:

  • root package.json
Image
  • run touch package-lock.json && npm i in sandboxes/rr7

  • in sandboxes/rr7/app/root.tsx

Image

I suspect that this problem exists only for npm workspaces since https://github.com/remix-run/react-router-templates uses pnpm which works. and I can tell from personal experience that yarn workspaces also work.

Hope that points you in the right direction...

IgnisDa avatar Jan 31 '25 19:01 IgnisDa

Thanks for the fix @IgnisDa! Started work on reactRouterPWA plugin

ShafSpecs avatar Feb 01 '25 22:02 ShafSpecs

Hi @ShafSpecs! Any updates on this issue?

IgnisDa avatar Mar 01 '25 00:03 IgnisDa

Yeah, I'm still working on the manor PR for react router. https://github.com/remix-pwa/monorepo/pull/287

This update would support both Remix and React Router, and then a second release would be coming after to sunset Remix support. With project renaming and a few other bonuses

ShafSpecs avatar Mar 01 '25 04:03 ShafSpecs

Great to know. Thanks for the update!

IgnisDa avatar Mar 01 '25 05:03 IgnisDa

I know it's not easy to do, but do you have any ballpark estimates on release date?

sjbuysse avatar Mar 01 '25 23:03 sjbuysse

I know it's not easy to do, but do you have any ballpark estimates on release date?

I'm currently pretty slow :sweat_smile:, but once I clear one of my freelance works (planning to wrap that up this month), I can slot this full time into my schedule

ShafSpecs avatar Mar 01 '25 23:03 ShafSpecs

If there is something i (or we) can help with, let me (us) know.

iwan-uschka avatar Mar 02 '25 10:03 iwan-uschka

If there is something i (or we) can help with, let me (us) know.

Thanks for the offer! Currently, one of the last things remaining is lots of testing. I can push to dev later today, so it's available and you can start using (and testing real-time) on your end 👌. Most of the apis are the same, just a few changes

ShafSpecs avatar Mar 02 '25 10:03 ShafSpecs

Merged the first major change, I would be pushing more fixes and features in time

ShafSpecs avatar Mar 02 '25 11:03 ShafSpecs

Before I go update the docs, I would push the current changes to latest.

Create a new release for react-router-pwa, remove Remix support and then go revamp the docs. Sounds good?

ShafSpecs avatar Mar 02 '25 11:03 ShafSpecs

Yep that sounds like a good plan. Maybe also a canary release on npm so that users can try it out and help you iron out the rough edges?

On Sun, Mar 2, 2025, 5:00 PM Abdur-Rahman @.***> wrote:

Before I go update the docs, I would push the current changes to latest.

Create a new release for react-router-pwa, remove Remix support and then go revamp the docs. Sounds good?

— Reply to this email directly, view it on GitHub https://github.com/remix-pwa/monorepo/issues/284#issuecomment-2692686885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOQ5PNADIQBZRJ6SSZX6TAL2SLTVRAVCNFSM6AAAAABSYTHTVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJSGY4DMOBYGU . You are receiving this because you were mentioned.Message ID: @.***> [image: ShafSpecs]ShafSpecs left a comment (remix-pwa/monorepo#284) https://github.com/remix-pwa/monorepo/issues/284#issuecomment-2692686885

Before I go update the docs, I would push the current changes to latest.

Create a new release for react-router-pwa, remove Remix support and then go revamp the docs. Sounds good?

— Reply to this email directly, view it on GitHub https://github.com/remix-pwa/monorepo/issues/284#issuecomment-2692686885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOQ5PNADIQBZRJ6SSZX6TAL2SLTVRAVCNFSM6AAAAABSYTHTVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJSGY4DMOBYGU . You are receiving this because you were mentioned.Message ID: @.***>

IgnisDa avatar Mar 02 '25 12:03 IgnisDa

The canary release is out (via the dev tag). That has been published already

ShafSpecs avatar Mar 02 '25 12:03 ShafSpecs

This is awesome work, truly -- the most immediate thing coming up in testing for me is @remix-pwa/[email protected] referencing @remix-run/server-runtime (not in my RR7 project) for its old json(..) utility.

vite v6.1.1 building for production...
🏗️  Building Service Worker in production mode...
x Build failed in 136ms
Error during worker build: ../node_modules/@remix-pwa/worker-runtime/dist/src/utils/response.js (1:9): "json" is not exported by "__vite-optional-peer-dep:@remix-run/server-runtime/dist/responses.js:@remix-pwa/worker-runtime", imported by "../node_modules/@remix-pwa/worker-runtime/dist/src/utils/response.js".

@remix-pwa/[email protected] seems like it has a heavier use of Remix dependencies so it's 100% possible this is user error on my part.

jack-r-warren avatar Mar 03 '25 02:03 jack-r-warren

I would need to fix that ASAP. Thx for the heads up

ShafSpecs avatar Mar 03 '25 13:03 ShafSpecs

To add, I also get this error while building the project:

Error during worker build: [vite]: Rollup failed to resolve import "@remix-run/react" from "/Users/diptesh/Desktop/Code/ryot/apps/frontend/node_modules/@remix-pwa/sw/dist/src/utils/installPWAGlobals.js".

This is probably due to the usage of @remix-run/react instead of react-router in packages/dev/react-router/*.

IgnisDa avatar Mar 03 '25 16:03 IgnisDa

Look forward to trying this, we want to make the switch.

alexfoxy avatar Mar 07 '25 11:03 alexfoxy

Opened a new PR, still making sure I don't nuke anyone's project. This PR fully sunsets Remix support fully (as dual support had so many issues)

https://github.com/remix-pwa/monorepo/pull/292

ShafSpecs avatar Mar 07 '25 17:03 ShafSpecs

React Router PWA v5 vs React Router PWA v1?

ShafSpecs avatar Mar 07 '25 17:03 ShafSpecs

Do you plan to rename the project to react-router-pwa? I see the package is free on npm (https://www.npmjs.com/package/react-router-pwa).

If you do plan to rename, i recommend pushing a few dummy files to that package so that it is not claimed.

IgnisDa avatar Mar 07 '25 18:03 IgnisDa

React Router PWA v5 vs React Router PWA v1?

I'd personally prefer v1 since the new project targets react-router and not remix. so its a new project IMO.

IgnisDa avatar Mar 07 '25 18:03 IgnisDa