Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary peer dependencies #201

Closed

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Jul 21, 2023

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.

@ghengeveld
Copy link
Member

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?

@pocka
Copy link
Collaborator

pocka commented Aug 18, 2023

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.

@ndelangen
Copy link
Member

@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!

@yannbf
Copy link
Member

yannbf commented Oct 12, 2023

@ndelangen @valentinpalkovic what are the next steps here?

@ndelangen
Copy link
Member

@JReinhold This is a good contender to try our react-peerdependencies removal work on.

@ghengeveld
Copy link
Member

Is this still going anywhere?

@yannbf
Copy link
Member

yannbf commented Oct 30, 2023

@JReinhold reminder to recheck this ☝️

@yannbf yannbf deleted the valentin/remove-unnecessary-peer-dependencies branch December 1, 2023 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants