storybook-addon-remix-react-router icon indicating copy to clipboard operation
storybook-addon-remix-react-router copied to clipboard

add support storybook 9 for RR v6

Open popuguytheparrot opened this issue 6 months ago • 16 comments

add support storybook 9 for RR v6

popuguytheparrot avatar May 30 '25 12:05 popuguytheparrot

Currently, the latest version of Remix 2.16.7 uses React Router v6. Therefore, it is currently not possible for me to use Storybook v9 with Remix.

Will support be added in future?

Or have I overlooked something and is there a version that works?

SpiderDan98 avatar Jun 04 '25 13:06 SpiderDan98

@popuguytheparrot @SpiderDan98 this will likely come by the end of the next week or the week after that.

JesusTheHun avatar Jun 04 '25 14:06 JesusTheHun

Any update on this?

Spence1115 avatar Jun 27 '25 15:06 Spence1115

@Spence1115 I have a very practical issue : I don't know what version to give to this. I can't do a major (new projects would not work) and I can't do a minor (existing projects would break). So I'm stuck and I had less time than I expected so I have not been able to figure this out yet

JesusTheHun avatar Jun 27 '25 15:06 JesusTheHun

do minor updates for package looks to 6 version

popuguytheparrot avatar Jun 27 '25 19:06 popuguytheparrot

do minor updates for package looks to 6 version

Then every project who upgrade within their major version will break

JesusTheHun avatar Jun 27 '25 20:06 JesusTheHun

do minor updates for package looks to 6 version

Then every project who upgrade within their major version will break

I think it's not your problem that people don't pin dependencies and use ^. Release as a minor in each major version

popuguytheparrot avatar Jun 28 '25 18:06 popuguytheparrot

hey @SpiderDan98 is there any workaround for this issue?

zernie avatar Jul 15 '25 18:07 zernie

hey @SpiderDan98 is there any workaround for this issue?

@zernie I have not found anything. That's why I haven't updated to the latest version yet 😕

SpiderDan98 avatar Jul 16 '25 15:07 SpiderDan98

Guys, I have a lot less time than I thought I would, can someone push a PR for this ?

You can check the latest commits to see what need to be done ; don't forget to start the branch on the latest commit compatible with RR 6

JesusTheHun avatar Jul 21 '25 07:07 JesusTheHun

I'm also experiencing this issue, and I'm happy to do a bit of work to get it solved. Just to confirm some specifics:

  • Last version of this package supporting RR 6 (Remix) is 3.1.0
  • First version of this package to support SB 9 is 5.0.0

@JesusTheHun I'm working on a branch based on 5.0.0 which pins "react-router": "^6.30.0" (version used by Remix 2.16 and 2.17).

Would the idea be to publish this SB9 variant as version "3.2.0"? Or am I misunderstanding?

Otherwise, if the versioning is too complicated, I'm happy to just publish a fork with a stupidly verbose name like storybook-addon-remix-react-rr6-sb9. Any thoughts?

mnemitz avatar Sep 18 '25 11:09 mnemitz

don't forget to start the branch on the latest commit compatible with RR 6

@JesusTheHun From what I understand, 3.1.0 is the latest commit compatible with RR6 and https://github.com/JesusTheHun/storybook-addon-remix-react-router/commit/b8d774aea4db9fc87a75cf47febce5dd28ff250b contains the relevant changes needed to make things work with Storybook 9.

I applied the same changes on top of 3.1.0 and see things working again, but I'm having trouble getting the "handle route action with file form" unit tests to pass, despite seeing things working fine when tested in Chrome. After finding a similar test being skipped for 5.0.0, I also skipped them for now but unsure if that's a safe approach.

What branch should I open a PR against? It doesn't appear to be safe to target main, as I can see that between 3.1.0 and 5.0.0, you have restructured the repo to use pnpm workspaces, so they are effectively two different repos. Also the react-router-dom imports have been dropped in RR7, so clearly this won't be a good merge into 5.0.0. Any advice would be appreciated!

darrenvong avatar Oct 03 '25 14:10 darrenvong

@JesusTheHun From what I understand, 3.1.0 is the latest commit compatible with RR6 and https://github.com/JesusTheHun/storybook-addon-remix-react-router/commit/b8d774aea4db9fc87a75cf47febce5dd28ff250b contains the relevant changes needed to make things work with Storybook 9.

That's correct.

I applied the same changes on top of 3.1.0 and see things working again, but I'm having trouble getting the "handle route action with file form" unit tests to pass, despite seeing things working fine when tested in Chrome. After finding a similar test being skipped for 5.0.0, I also skipped them for now but unsure if that's a safe approach.

I'm unsure why but the internals regarding file upload tend to change a lot ; it has become annoying to the point I tested manually and skipped the automated tests.

What branch should I open a PR against?

I have absolutely no idea. That's one of the main issue. Like I mentioned above, it looks like we should either use the old name storybook-addon-react-router-v6, or risk break existing setups with a weird version bump like 3.5.0 (when SB10 is released then what, 3.10.0 ?).

As much as I dislike it, I think pushing this to storybook-addon-react-router-v6 is the lesser evil. To do that would also involves pushing a patch to [email protected] to include an announce during install, to say that support for RRv6 is back to storybook-addon-react-router-v6. Then we drop support for v6 on storybook-addon-remix-react-router.

I didn't consider the dual dependency issue when I renamed the package to storybook-addon-remix-react-router. Now I can see that storybook-addon-react-router-v6 and storybook-addon-react-router-v7 would have been a more practical choice. Less catchy than storybook-addon-remix-react-router but definitely easier to maintain.

Let's go for a new branch that will track the versions of SB along with RRv6 exclusively : react-router-v6. I'll publish the package under storybook-addon-react-router-v6 and take accountability for the mess my decision have created.

JesusTheHun avatar Oct 03 '25 15:10 JesusTheHun

As much as I dislike it, I think pushing this to storybook-addon-react-router-v6 is the lesser evil. To do that would also involves pushing a patch to [email protected] to include an announce during install, to say that support for RRv6 is back to storybook-addon-react-router-v6. Then we drop support for v6 on storybook-addon-remix-react-router.

This sounds like a pragmatic approach to me to avoid breaking existing setups, even though the package name is less catchy. Will storybook-addon-remix-react-router then be exclusively for RR v7 support going forward (tracking different versions of SB)?

Let's go for a new branch that will track the versions of SB along with RRv6 exclusively : react-router-v6

Will this branch be part of this repo too, despite having to publish the package under the old name? I don't see this branch available at the moment, but I will be happy to open a PR against it once you have created it

darrenvong avatar Oct 06 '25 09:10 darrenvong

@darrenvong the branch has been created at the v3.1.0

JesusTheHun avatar Oct 13 '25 14:10 JesusTheHun

@JesusTheHun Sorry for the delay, I've created 2 PRs:

  • The first for making a patch to [email protected] with a simple postinstall script informing the user to use storybook-addon-react-router-v6 again if they want RR v6 support with different versions of Storybook going forward
  • The second makes the actual changes needed for the add-on to work with Storybook 9 and RR v6 together. I've renamed the package back to its old name and bumped it to v4.

Let me know if this matches what you were thinking and happy to make any required changes to help get this in. I'm aware Storybook 10 has been released in-between since but adding support for that with RR v6 should be trivial once this is done.

darrenvong avatar Nov 04 '25 15:11 darrenvong