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
manager in @storybook/core bundles in React and React DOM, so it can globalize it and ensure that any code in the manager (including addons') uses a single instance of React.
However if you look at the metafile analysis for the manager entry point in @storybook/core, you'll see that it actually bundles in the development builds of those two packages instead of the production builds.
Not only are these 10x bigger, they are also slower overall on the browser. We should figure out why our bundling tool uses the wrong build here.
The downside of fixing this is that you'll get a slightly worse dev experience when developing for the manager (eg. building an addon), because you'll get worse errors. I'm not sure yet if we can do something in addon-kit to avoid this.
I don't see anything in the bundle scripts or code that indicates that this is explicitly on purpose.
Note the same thing seems to happen with react-router and react-router-dom in the CJS outputs of the router entry point, but not in the ESM one.
The text was updated successfully, but these errors were encountered:
JReinhold
changed the title
Use production build of React in the manager
Use production build of react, react-dom in the manager, react-router, react-router-dom in the router
Sep 19, 2024
JReinhold
changed the title
Use production build of react, react-dom in the manager, react-router, react-router-dom in the router
Use production build of react, react-dom in the manager
Sep 19, 2024
manager
in@storybook/core
bundles in React and React DOM, so it can globalize it and ensure that any code in the manager (including addons') uses a single instance of React.However if you look at the metafile analysis for the
manager
entry point in@storybook/core
, you'll see that it actually bundles in the development builds of those two packages instead of the production builds.Not only are these 10x bigger, they are also slower overall on the browser. We should figure out why our bundling tool uses the wrong build here.
The downside of fixing this is that you'll get a slightly worse dev experience when developing for the manager (eg. building an addon), because you'll get worse errors. I'm not sure yet if we can do something in addon-kit to avoid this.
I don't see anything in the bundle scripts or code that indicates that this is explicitly on purpose.
Note the same thing seems to happen with
react-router
andreact-router-dom
in the CJS outputs of therouter
entry point, but not in the ESM one.The text was updated successfully, but these errors were encountered: