carbon-design-system / carbon-for-ibm-dotcom

Carbon for IBM.com is based on the Carbon Design System for IBM
https://www.ibm.com/standards/carbon/
Apache License 2.0
268 stars 156 forks source link

[Storybook]: "forceReRender" event does not appear to function #8395

Open jkaeser opened 2 years ago

jkaeser commented 2 years ago

Summary

Storybook exposes a "forceReRender" event/option in its client API, and it looks like we have attempted to use it in the web components package's Storybook configuration to re-render stories when the "Carbon theme" input value changes (see https://github.com/carbon-design-system/carbon-for-ibm-dotcom/blob/main/packages/web-components/.storybook/config.ts#L86-L92).

From what I can tell, emitting this event doesn't actually trigger anything within Storybook, and the story contents are not re-rendered. Some searching shows others have found the same issue (albeit in other Storybook flavors):

I'm interested in this since it may help us resolve some bugs that occur when knobs are updated but the web components are not re-rendered.

Does anyone know if we are using this part of the API correctly?

Relevant information

No response

Name and organization

John Kaeser Front End Developer @ Lullabot

Code of Conduct

oliviaflory commented 2 years ago

@jkaeser could you provide examples of where the knobs aren't working?

jkaeser commented 2 years ago

@oliviaflory I've seen a couple bugs that only occur in Storybook environments due to the way Web Components and Storybook interact, and the ability to force a re-render would have provided a clean solution to them. Examples are https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/8301 and https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/8335, both of which have been fixed at this point.

kennylam commented 2 years ago

@jkaeser We'll do a quick audit of the Storybook components and see what next steps are.

stale[bot] commented 1 year ago

We've marked this issue as stale because there hasn't been any activity for 60 days. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions.