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

Investigate removing CJS outputs for client-only entry points #29164

Closed
Tracked by #29038
JReinhold opened this issue Sep 19, 2024 · 1 comment
Closed
Tracked by #29038

Investigate removing CJS outputs for client-only entry points #29164

JReinhold opened this issue Sep 19, 2024 · 1 comment
Assignees

Comments

@JReinhold
Copy link
Contributor

JReinhold commented Sep 19, 2024

When going through the exports in @storybook/core's package.json, the following entry points stands out, because they should theoretically only ever be used in the browser, so there is no need to bundle and distribute a CJS version of them as well:

  • /client-logger
  • /preview-errors
  • /preview-api
  • /manager-api
  • /router
  • /components
  • /theming
  • /theming/create

Collectively these CJS files make up 2.2 MB of the final bundle.

Notice that the manager-errors entry point already does not contain a CJS condition.

I might be missing some crucial context about how Webpack bundles, or how this all work together with Portable Stories (especially in Jest)

@JReinhold
Copy link
Contributor Author

Closing as these entry points might be used in portable stories (in Jest, CJS), which is why they're needed. It would be strange to use these dependencies in stories, but it is possible when eg. users are using DocsContext from addon-docs in a decorator or similarly.

@JReinhold JReinhold closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2024
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

No branches or pull requests

2 participants