-
I was trying to get a theming add-on to work in composed storybooks until I bumped into the little Limitation footnote in this section. However, due to how brief it is, I was wondering to what extent the add-ons don't work? It doesn't seem to be a completely broken feature, as I do have a custom add-on that retrieves data about the story and displays it. But it does seem to be that addons that change theme or colour won't have those parameters propagated. I was wondering if anyone had an explanation as to how composed storybooks work and where globals from add-ons aren't being passed correctly, or if there might be work done to add this feature sometime in the future? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Good question, I worked on this feature. There was a tradeoff between avoiding dependency conflicts and maintaining addon functionality. Composition is meant to work with Storybooks that have different sets of renderers and the associated dependencies (e.g., react, vue, etc). In order to do this, we render an iframe into that composed Storybook from the local Storybook. This ensures different Storybook's can be composed with each other and sidesteps dep conflicts that would prevent Storybook from building. But because the args and the component implementation can vary drastically between renderers like React, Vue, or Web Components, it didn't make sense to apply the local Storybook's addons to the composed Storybook. Ideally, the composed Storybook could present it's own addons that a user can manipulate. But we didn't end up implementing that for time/scope reasons. I think we'd be open if someone wants to contribute code that pushes this feature forward. |
Beta Was this translation helpful? Give feedback.
Good question, I worked on this feature.
There was a tradeoff between avoiding dependency conflicts and maintaining addon functionality. Composition is meant to work with Storybooks that have different sets of renderers and the associated dependencies (e.g., react, vue, etc).
In order to do this, we render an iframe into that composed Storybook from the local Storybook. This ensures different Storybook's can be composed with each other and sidesteps dep conflicts that would prevent Storybook from building.
But because the args and the component implementation can vary drastically between renderers like React, Vue, or Web Components, it didn't make sense to apply the local Storybook's addo…