Replies: 3 comments 5 replies
-
EDIT: DOES NOT SOLVE DISCUSSED PROBLEM Quick answer: depending on your goals with type safety, you could use the "constants object" approach rather than an (typescript) enum. const Tags = { But +1 to another use case to learn more about static analysis needs that prohibit this usage |
Beta Was this translation helpful? Give feedback.
-
On startup we're indexing all the stories in your Storybook and creating a file called We might extend the analysis in the future to support imported constructs in the future. But to start with we're keeping it simple and are focusing our efforts elsewhere. |
Beta Was this translation helpful? Give feedback.
-
I'm on the same opinion as you. The tags should be typesafe and not stringliterals. when we use typescript then this should go. I got the point that the babelParser should be fast and the enums arent availble in raw file. Maybe some day we got this tiny helpful feature? And a docs for the sidebar filters function :D cheers |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Related: #21761
Is there any way to set tags dynamically, to provide type safety? I am unable to set tags dynamically due to "performance purposes" (quote from linked issue above) regarding static analyzability.
The below examples result in
Error: CSF: Expected tag to be string literal
Even the following does not work:
My understanding is that there should be no performance issues with type annotations, as in the above example, since that is simply a hint to the TS compiler.
Beta Was this translation helpful? Give feedback.
All reactions