Closed valentinpalkovic closed 10 months ago
Interesting. Does this apply to any addon? We have a few more (e.g. pseudo-states, visual-tests) that are specifying peerDeps on SB packages. Maybe they needn't do that?
These were added in #133 in order not to trigger errors on strict package managers (e.g. pnpm, Yarn PnP). I'm not sure it's still a problem in the current SB architecture though.
@ghengeveld The manager-side of addons will get their storybook dependencies replaced by esbuild with globals.
The preview-side will get @storybook/preview-api
externalized by both the webpack and vite builders.
But the preview side is more fragile, because users can change it's builder-config.
So if you have @storybook/*
dependencies (or to be more precise, these)
https://github.com/storybookjs/storybook/blob/c7028c7b9fdaa77b224c081a8f187906042098d3/code/ui/manager/src/globals/runtime.ts#L17-L33
...then you can don't need to supply those packages at runtime.
You do (and this is very important) need to ensure those dependencies aren't bundled in!
@ndelangen @valentinpalkovic what are the next steps here?
@JReinhold This is a good contender to try our react-peerdependencies removal work on.
Is this still going anywhere?
@JReinhold reminder to recheck this ☝️
All storybook packages, which are mentioned in https://github.com/storybookjs/storybook/blob/next/code/ui/manager/src/globals/runtime.ts don't have to be defined as peer dependencies, since they are made available when the Storybook Manager gets bundled. The
@storybook/preview-api
was not used at all.