Page MenuHomePhabricator

Try storybook v6's “composition” mode
Closed, ResolvedPublic

Description

  • install storybook v6 in vue-components
  • install storybook v6 in docs
  • try and use composition to show vue-components' stories in docs' storybook

References:

Event Timeline

  • port-based include requires for both storybooks to be web hosted
    • and CORS is a thing
  • to allow for a storybook to be composed (used in another one), it needs puppeteer-based post-build treatment (loading is done via a stories.json which - for reasons - is not part of normal storybook build)
    • given this line I may have done something wrong...

https://github.com/wmde/wikit/pull/104

Summary

Particular challenges

  • versioning (so that both storybooks use the same version, or at least communicate that they could be off)

https://github.com/wmde/wikit/pull/105

Summary

  • vue-components has its own storybook which gets copied into a subfolder of the docs storybook
  • docs' storybook composes vue-components' stories into itself by loading the subfolder (same domain)

Particular challenges

  • chromatic UI review is not available without publishing vue-components storybook as a dedicated project - can be mitigated by copying into docs and publishing separately

Remaining challenges (both solutions)

  • conceptual decision: who includes whom? (docs the vue-components [as demoed], or the other way around)
  • somehow this made me question the idea of the docs package. Why didn't we just put this in the project root?
  • chromatic seems to be somewhat unhappy to have two projects for the same repository
  • docs chromatic is unhappy if we delete the dummy component (which is unneeded) because it think there are 0 stories there
  • (low prio in my eyes) getting dev to work in "composition" mode (no X11 in the container is a problem, as it prevents the consumed storybook to successfully publish)