ctrlplusb / react-universally

A starter kit for universal react applications.
MIT License
1.7k stars 244 forks source link

Webpack and HMR 4 #560

Closed birkir closed 6 years ago

birkir commented 6 years ago

This pull-request upgrades webpack and hot-module-reload respectively to the major version 4.

When this has been validated and merged, we can continue to add and benefit from new features in Webpack 4 that we currently don't have enabled.

oyeanuj commented 6 years ago

@birkir This is awesome, thank you for getting this started. Just a question - With the new production mode, can't we also take out a lot of the isProduction code in the configFactory, like the minimizing and uglifying the code?

And once we upgrade to Babel 7, we would be all caught up and with simplified config!

newsiberian commented 6 years ago

@birkir, hi. Are you succeed to run this? I'm gettting stuck after this:

WEBPACK: Creating a development bundle configuration for the "client"
(node:8645) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
birkir commented 6 years ago

@oyeanuj That was the plan! @newsiberian This is just a warning. Inevitable we still have to use HappyPack for multi-threaded bundling. Everything works fine.

ctrlplusb commented 6 years ago

Awesome! Thanks so much for this!

newsiberian commented 6 years ago

Hi, @birkir, @ctrlplusb, once again I want to return to this. Are you don't using react-async-component? Because I still have many errors related with it. One of them described here and here

newsiberian commented 6 years ago

Also getting this many times: MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit Catched here

birkir commented 6 years ago

I think all of your reported errors are not related to this PR. We could definitely do some work on async things, like use import() for native webpack code splitting etc. But step 1 is getting webpack 4 in, then get feedback so we can incrementally get closer.

Thanks

sergiokopplin commented 6 years ago

👏

oyeanuj commented 6 years ago

@birkir @sergiokopplin Is code splitting still working for you after this PR? If yes, could you share the config that you have for chunking?

sergiokopplin commented 6 years ago

hey @oyeanuj, i need testing first, i`m not using that yet