storybook-rsbuild icon indicating copy to clipboard operation
storybook-rsbuild copied to clipboard

Creating new stories and saving stories in UI is not currently supported?

Open jeffijoe opened this issue 1 year ago • 6 comments

After switching to storybook-rsbuild, the Save functionality in the Storybook UI stopped working:

image

The + button to create a new story is also not available:

image

jeffijoe avatar Jul 23 '24 13:07 jeffijoe

Which version of storybook are you using. In the project's sandbox, these functionality works whereas they're in different UI (8.2.1). image

fi3ework avatar Jul 23 '24 14:07 fi3ework

I'm on Storybook 8.2.5. I can get the Create new story (within an existing .stories.tsx) UI to show, but it won't save.

jeffijoe avatar Jul 23 '24 14:07 jeffijoe

I took a look into the source code. The new button will show when https://github.com/storybookjs/storybook/blob/next/code/core/src/builder-manager/utils/framework.ts/#L38 is true, and extractProperRendererNameFromFramework can only detect enumerated frameworks here (https://github.com/storybookjs/storybook/blob/next/code/core/src/common/utils/get-storybook-info.ts#L30-L49). The solution is to add storybook-react-rsbuild and storybook-vue3-rsbuild to Storybook's monorepo.

fi3ework avatar Jul 23 '24 17:07 fi3ework

the Save functionality in the Storybook UI stopped working:

Could you provide a minimal reproduction? It at least works in sandbox.

https://github.com/user-attachments/assets/d0e41225-f9d0-4471-a7a7-98043d841480

fi3ework avatar Jul 23 '24 17:07 fi3ework

Turns out the Save just required a restart of Storybook. 👍

So I guess we need to open a PR with Storybook to add the Rsbuild framework to their known list?

jeffijoe avatar Jul 23 '24 17:07 jeffijoe

Yes, I'm opening the PR to add the frameworks.

fi3ework avatar Jul 23 '24 17:07 fi3ework

I have confirmed that this now works in the latest Storybook 8.3.0 prereleases (if you apply the workaround described in #76)

image

🚀

JReinhold avatar Aug 29 '24 11:08 JReinhold

Closing this as it has been resolved, and will be shipped with Storybook 8.3.0. 🥳

fi3ework avatar Sep 03 '24 04:09 fi3ework