-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Move more things to core #2788
Move more things to core #2788
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2788 +/- ##
==========================================
+ Coverage 35.51% 35.83% +0.31%
==========================================
Files 434 427 -7
Lines 9501 9422 -79
Branches 987 970 -17
==========================================
+ Hits 3374 3376 +2
+ Misses 5481 5403 -78
+ Partials 646 643 -3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for taking care of this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Only one very very minor comment, feel free to ignore.
lib/core/client.js
Outdated
const client = require('./dist/client').default; | ||
|
||
module.exports = client; | ||
module.exports.pathToManager = require.resolve('./dist/client/manager'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have called this managerPath
@@ -1,73 +1,5 @@ | |||
// import webpack from 'webpack'; | |||
import autoprefixer from 'autoprefixer'; | |||
import { createDefaultWebpackConfig } from '@storybook/core/server'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving the webpack configs into a separate package?
So this becomes much easier:
https://storybook.js.org/configurations/custom-webpack-config/#full-control-mode--default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? Will it be something like @storybook/configs
? TBH, I think we need to make some progress in core extraction because this copypasta across all the apps makes me crazy 😷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@storybook/webpack-config
sounds good to me. We only need to publish the default one, because it's the only one that should be imported from outside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But maybe it would be an even better solution just to pass genDefaultConfig as third argument to custom webpack config function, so that users could write full control + defaults like this, without any extra imports:
module.exports = (baseConfig, env, genDefaultConfig) => {
const config = genDefaultConfig(baseConfig, env);
// Extend it as you need.
};
Or maybe even like this:
module.exports = (baseConfig, env, defaultConfig) => {
// Extend `defaultConfig` as you need.
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. It's way much simpler than publishing one more package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean from the user's point of view =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not create yet another package. @Hypnosphi the proposals above seem pretty reasonable--are they backwards compatible or breaking changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shilman We should deprecate the old way using utils-deprecate
for now, and then remove it in next major
So the answer is yes, it can be backwards-compatible
My bad @igor-dv you're right you've made sure this is backwards compatible ✅ |
Merge when ready |
Issue: #2636
What I did
(Didn't touch RN)