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

Pass default webpack config as third argument in Full Control Mode #2796

Merged
merged 2 commits into from
Jan 21, 2018

Conversation

Hypnosphi
Copy link
Member

See #2788 (comment)

When reviewing, please pay specific attention to angular and RN changes

@Hypnosphi
Copy link
Member Author

Hypnosphi commented Jan 21, 2018

@thomasbertet can we make image tests fail on CI when some screenshots are added during it (that is, if they were missing before running the test)?

@codecov
Copy link

codecov bot commented Jan 21, 2018

Codecov Report

Merging #2796 into master will increase coverage by 0.04%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2796      +/-   ##
==========================================
+ Coverage   35.83%   35.87%   +0.04%     
==========================================
  Files         427      427              
  Lines        9422     9411      -11     
  Branches      985      974      -11     
==========================================
  Hits         3376     3376              
- Misses       5363     5394      +31     
+ Partials      683      641      -42
Impacted Files Coverage Δ
...p/react-native/src/server/config/webpack.config.js 0% <ø> (ø) ⬆️
...ct-native/src/server/config/webpack.config.prod.js 0% <ø> (ø) ⬆️
...ative/src/server/config/defaults/webpack.config.js 0% <0%> (ø) ⬆️
app/react/src/server/config.js 0% <0%> (ø) ⬆️
app/angular/src/server/config.js 0% <0%> (ø) ⬆️
...react/src/server/config/defaults/webpack.config.js 0% <0%> (ø) ⬆️
app/react-native/src/server/config.js 0% <0%> (ø) ⬆️
...lymer/src/server/config/defaults/webpack.config.js 0% <0%> (ø) ⬆️
app/vue/src/server/config.js 0% <0%> (ø) ⬆️
.../core/src/server/config/defaults/webpack.config.js 0% <0%> (ø) ⬆️
... and 64 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23f6f65...85f1f7f. Read the comment docs.

@Hypnosphi Hypnosphi merged commit bb46b67 into master Jan 21, 2018
@Hypnosphi Hypnosphi deleted the pass-default-config branch January 21, 2018 16:36
```js
const path = require('path');

// load the default config generator.
const genDefaultConfig = require('@storybook/react/dist/server/config/defaults/webpack.config.js');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be mentioned in docs as a deprecated feature?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK, just have seen people leave deprecated features with some "deprecated" labels on them... But it's not critical to me 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we don't want people to do something we delete it from the docs :)

Unless it's something that we think a lot of people are already doing, in which case a deprecated note could help in some cases. But probably people who are already doing something are unlikely to come back to the docs, so really I don't think it gains much.

},
},
],
},
{
test: /\.json$/,
include: includePaths,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So these includes weren't really needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have only js files in those directories currently

@@ -1,63 +1,7 @@
import autoprefixer from 'autoprefixer';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I checked this config before, it was a bit different from the default config of the other apps. Are those differences minor? For example, is it safe to change "loaders" to "rules"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loaders field is deprecated in webpack. Technically, it's a breaking change, but I can't really imagine why would someone use a custom webpack config in RN storybook. It doesn't apply to stories themselves anyway.

Generally, the differences are there because changes to configs in react and vue weren't applied here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we need to factor our the RN manager config into @storybook/core too. Maybe given the above it is easier than you thought @igor-dv?

return customConfig(
applyAngularCliWebpackConfig(config, cliWebpackConfigOptions),
configType,
defaultConfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in case of full control mode, there is a first parameter that is extended with angular-cli's config, and the default config which is extended as well. Is this expected?

Copy link
Member Author

@Hypnosphi Hypnosphi Jan 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that you actually pick one or another, yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants