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

Evaluate hard-source Webpack plugin #615

Closed
KyleAMathews opened this issue Sep 9, 2016 · 16 comments
Closed

Evaluate hard-source Webpack plugin #615

KyleAMathews opened this issue Sep 9, 2016 · 16 comments

Comments

@KyleAMathews
Copy link
Contributor

https://github.com/mzgoddard/hard-source-webpack-plugin

Still early but very promising. Caches intermediate build steps. Can dramatically speed up incremental builds both for dev and prod.

@thangngoc89
Copy link
Contributor

Phenomic implemented it here MoOx/phenomic#646

@zhaoshengjun
Copy link

Just curious: What's the difference between hard-source-plugin and DllPlugin?

ps: here's some articles related to DLLPlugin in case you don't know:

https://robertknight.github.io/posts/webpack-dll-plugins/
https://medium.com/@soederpop/webpack-plugins-been-we-been-keepin-on-the-dll-cdfdd6cb8cd7#.d1g27iray
http://engineering.invisionapp.com/post/optimizing-webpack/

@KyleAMathews
Copy link
Contributor Author

@zhaoshengjun the DLLPlugin speeds up Webpack by making it do less work as you tell it to not pay attention to a list of modules. hard-source-plugin speeds up Webpack by caching incremental work so again Webpack does less but this time by avoiding repeating work that's already been done.

@gaearon
Copy link
Contributor

gaearon commented Sep 26, 2016

How do we know when/if it becomes stable? I don’t understand how to evaluate it.

@KyleAMathews
Copy link
Contributor Author

KyleAMathews commented Sep 26, 2016

I haven't tried it yet myself so can't comment on its stability but the first thing to do I'd think is try adding it to a create-react-app and see the performance difference to see if that's significant enough to worry about making the change.

I'll be trying it in Gatsby soon. From @thangngoc89 and @MoOx's experiments in Phenomic, it seems quite usable.

@MoOx
Copy link
Contributor

MoOx commented Sep 28, 2016

Fun you mention us, we just released yesterday a new Phenomic release, which makes available the new "cache" option based on this plugin, that works for both webpack 1 & 2.

Here are some number in a picture

@gaearon
Copy link
Contributor

gaearon commented Sep 30, 2016

@MoOx Would you like to submit a PR to CRA enabling it?

@gaearon gaearon modified the milestone: 0.7.0 Sep 30, 2016
@gaearon
Copy link
Contributor

gaearon commented Sep 30, 2016

Hmm, I don’t think it’s mature enough. We shouldn’t leave people with issues like mzgoddard/hard-source-webpack-plugin#31 after ejecting. Let’s wait more.

@MoOx
Copy link
Contributor

MoOx commented Sep 30, 2016

I was about to tell you this :)

I opened mzgoddard/hard-source-webpack-plugin#40 so we can track "maturity" :)

@gaearon
Copy link
Contributor

gaearon commented Sep 30, 2016

To be fair, regardless of the version number, I won’t feel good using this until major issues are solved. We are also conservative about updates and lock package versions so that CRA itself is less fragile when possible.

@MoOx
Copy link
Contributor

MoOx commented Sep 30, 2016

I totally understand and I don't think "just bumping" will magically make this "mature".
I think changing the version number won't be done until current major issues are solved, even if I didn't explicitly talk about that ^^.

@shrynx
Copy link
Contributor

shrynx commented Jan 3, 2017

Consider using happypack as an alternate?
it has caching and does threading too. I have implemented both happy loader(for build process) and webpack hard source(for dev process) in my fork. the speed gains are really good.

@wtgtybhertgeghgtwtg
Copy link
Contributor

happypack doesn't work with webpack@2.0.0 and has issues with Windows.

@gaearon
Copy link
Contributor

gaearon commented Feb 11, 2017

Closing, as both suggestions appear to be flaky for some users.
I don't think this is a promising direction unless Webpack core officially embraces it.
(I do think, however, that aggressive caching is essential, and Webpack could do better there.)

cc @sokra @TheLarkInn

@gaearon gaearon closed this as completed Feb 11, 2017
@sokra
Copy link

sokra commented Feb 12, 2017

Sure vote for it: https://webpack.js.org/vote/

@thangngoc89
Copy link
Contributor

@sokra spent 30 influences for it

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants