menu

React

A community of developers, designers and others who love React.js. ⚛️

Channels
Team

Have common Storybook for multiple projects?

May 17, 2018 at 10:59am

Have common Storybook for multiple projects?

May 17, 2018 at 10:59am
We have 2 teams working on projects with separate React repos which should be sharing components and styles. Is there a nice way to have a common Storybook between the projects to promote code sharing and visibility? Thanks!

May 17, 2018 at 11:04am
Would love to hear more on this. Nice topic 👍
  • reply
  • like
Hey there! So we're currently working on building two Storybook libraries for our web app as well as our website.
We currently have our Storybook instance for the web app published as a private NPM package for our company. When we include the lib as a dependency in our other React projects we just import the desired components from the library the same way you would if they were included in your projects root!
I hope this help a little! If needed I can provide further explanation'
like-fill
4
  • reply
  • like
I would think that a good solution would be to put the common components in an npm package and import them into each project? how are you currently sharing the components
like-fill
4
  • reply
  • like
Yea at my company we're doing the same. We created a repo called Storybook that contains the Storybook application to display components (this is deployed internally). We use Webpack to bundle the components. We then publish them as a private npm package.
like-fill
4
  • reply
  • like

May 18, 2018 at 7:35am
Thanks a lot! Using private npm package bundles make sense.
  • reply
  • like

May 18, 2018 at 11:38pm
I have something planned to really support this scenario well. But it will take some time to actually develop.
In short I'll make it possible for storybook to consume prebuild storybook previews, this will prevent slow start and rebuild.
like-fill
2
  • reply
  • like

May 21, 2018 at 7:58pm
Hey there! So we're currently working on building two Storybook libraries for our web app as well as our website.
We currently have our Storybook instance for the web app published as a private NPM package for our company. When we include the lib as a dependency in our other React projects we just import the desired components from the library the same way you would if they were included in your projects root!
I hope this help a little! If needed I can provide further explanation'
How do you deal with versioning? Tree shaking?
  • reply
  • like

May 23, 2018 at 8:29am