Closed pospi closed 11 months ago
Updated the issue title as this does actually manifest in an error due to multiple registration of the NHButton
class within these two files.
This does not affect the test runner since that builds a static Storybook to execute against and thus has a different module resolution behaviour at runtime than the development Storybook that executes via npm start
.
Some additional unforseen complexity in resolving the problem: @storybook/web-components.Meta
accepts an args
property to render
and does not operate as a 'normal' CustomElement, meaning that elementDefinitions
is not usable with the root-level component in a test. Working on a resolution.
resolved earlier
_shared_customElements.ts
should be deprecated in favour of a generator function which can dynamically create wrapper CustomElement classes that have unique tag names bound to each story. This would be the more robust way of ensuring that there are no conflicts in the globalcustomElements
registry definitions.However, this may be more complicated than the simple case since many components use slotted children; meaning that the rendering of child elements is occasionally the responsibility of the root shadow DOM rather than that of the containing component.
(via #3)