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
StorybookConfig: Add babel field #15220
StorybookConfig: Add babel field #15220
Conversation
☁️ Nx Cloud ReportCI ran the following commands for commit 0e3bf30. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
yarn build
Built: @storybook/core-common@6.3.0-rc.4
lerna ERR! yarn run prepare exited 1 in '@storybook/core-server'
lerna ERR! yarn run prepare stdout:
Successfully compiled 28 files with Babel (1171ms).
Successfully compiled 28 files with Babel (1175ms).
Successfully compiled 28 files with Babel (1320ms).
src/presets/babel-cache-preset.ts(11,14): error TS2742: The inferred type of 'babel' cannot be named without a reference to '@babel/parser/node_modules/@babel/types'. This is likely not portable. A type annotation is necessary.
src/presets/babel-cache-preset.ts(11,14): error TS4023: Exported variable 'babel' has or is using name 'InputSourceMap' from external module "/Users/tyankatsu/project/storybook/lib/core-server/node_modules/@types/babel__core/index" but cannot be named.
src/presets/babel-cache-preset.ts(12,14): error TS2742: The inferred type of 'managerBabel' cannot be named without a reference to '@babel/parser/node_modules/@babel/types'. This is likely not portable. A type annotation is necessary.
src/presets/babel-cache-preset.ts(12,14): error TS4023: Exported variable 'managerBabel' has or is using name 'InputSourceMap' from external module "/Users/tyankatsu/project/storybook/lib/core-server/node_modules/@types/babel__core/index" but cannot be named. |
I don't know the solution that fixable this error... |
You see this error because It's a bit annoying to have |
@tyankatsu0105 I saw that you tried to add the type package to dependencies but the test still failed. It's likely that because the lock file hasn't been updated so the CI still picked up the old setting. |
7ef289e
to
ccd8f3a
Compare
@shilman Do you know the solution of CI's error? |
@tyankatsu0105 Seems like it's an issue fixed in #15863 |
@shilman It appears that it's a lock file problem that makes CI tests fail. But I can't find anywhere that uses |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hello @tyankatsu0105 I'm unfortunately the bringer of bad news :( I really want to thank you for this PR. I know it can't have been easy, figuring our webpack & babel config and getting that changed in storybook. Trust me I know. So I know you've put a lot of effort, passion and time into this. So it feels super bad to be closing this PR :( But here's the thing... In 6.x we can't really change any of this, because whatever we do to add babel stuff or not add it, change versions... set config or not set config... it always breaks someone's setup somewhere.. So in In The upside of these changes is that we get far less version conflicts (or rather USERS get less of them) and we also make storybook lighter to install (which is a common thing we hear "storybook being bloated"). We're actively working on making storybook easier to maintain for ourselves, and slimmer to install for users, and simpler to configure for all. Less babel config is part of that. I hope you understand why I'm closing this PR. Again: thank you for the time and energy you spend on this, I'm sorry we couldn't merge it. If you feel like I'm in the wrong here, please let me know, happy to discuss this further any time (for example on discord if you prefer) |
Issue:
What I did
extend
ofcore-server/src/presets/babel-cache-preset.ts
@babel/core
as dependenciesbabel
field toStorybookConfig
How to test
If your answer is yes to any of these, please make sure to include it in your PR.