You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a preset to automatically decorate all stories with my addon. Rather, my addon depends on some parameters to be set and I just decided it would be easiest to load everything via a preset. The docs have mixed guidance, with some saying that presets should really be used for frameworks.
Or perhaps my approach is incorrect. Are decorators and params from an addon loaded in with preview.js automatically applied to stories? Perhaps then I can avoid using a preset.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Recently upgraded a few addons to v8, and encountered an issue where
preset.js
is expected to be in cjs. Did some digging and found out that they're expected to be used in node-only environments (https://github.com/storybookjs/addon-kit/blob/36fba4f2a73df9d12214c8378a18486c41beee87/tsup.config.ts#L104-L115). I'm curious as to why that is, when we can load preview decorators in with presets?I'm using a preset to automatically decorate all stories with my addon. Rather, my addon depends on some parameters to be set and I just decided it would be easiest to load everything via a preset. The docs have mixed guidance, with some saying that presets should really be used for frameworks.
Or perhaps my approach is incorrect. Are decorators and params from an addon loaded in with
preview.js
automatically applied to stories? Perhaps then I can avoid using a preset.Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions