break-stuff / wc-storybook-helpers

Helpers designed to make integrating Web Components with Storybook easier.
MIT License
52 stars 9 forks source link

Default Component Variable Assignment #34

Closed break-stuff closed 7 months ago

break-stuff commented 8 months ago

Add the option to remove the default component variable assignment in the template.

rstoneIDBS commented 8 months ago

Not sure that the linked PR will fix this, it seems to be all about hiding default attribute values?

I've been looking at this issue and thought that the obvious fix was a new global option (noDefaultComponent ?) however this would also be a little unfriendly if 1 particular component out of many actually needed this functionality.

I then went down a bit of a rabbit hole trying to see how this could be done globally but overridden locally. Is there a "native" storybook mechanism that could be used to support this (parameters in a story config maybe?)

break-stuff commented 8 months ago

@rstoneIDBS, you are correct. I think maybe #38 matches this feature.

break-stuff commented 8 months ago

@ArcoMul, what I was thinking for some of these new configurable features was that these could be set globally in the setWcStorybookHelpersConfig or locally for each component on the getWcStorybookHelpers function. I think having it be able to be set in either place would provide the flexibility you are talking about, @rstoneIDBS.

ArcoMul commented 7 months ago

@break-stuff Sorry overlooked this comment. That makes a lot of sense to be able to define the options per getWcStorybookHelpers call.

break-stuff commented 7 months ago

I added a new task (#49) for the component-level configuration, so we can close this ticket. Thank you!