gaearon / react-hot-boilerplate

Minimal live-editing example for React
MIT License
3.91k stars 879 forks source link

Use webpack-dev-middleware? #65

Closed gaearon closed 7 years ago

gaearon commented 8 years ago

It’s got a nice syntax error overlay, and it was already fixed to work with Webpack 2. We should probably use it here as well.

ghost commented 8 years ago

My 👎 on this is that it adds more code to the boilerplate that isn't strictly needed which you might say contradicts the following snippet from the readme:

This boilerplate is purposefully simple to show the minimal configuration for React Hot Loader.

adam-beck commented 8 years ago

@danmartinez101 but don't you lose out on the "syntax error overlay" that @gaearon mentioned? It's very useful and having at least an example of using the middleware would be beneficial IMO.

ghost commented 8 years ago

The overlay is a very nice feature indeed! I skimmed over that part. Sorry for that :/ Thank you for calling me out on this :)

While my comment was wrong, the spirit of it still holds true: I think it would be best to remove as much code from this boilerplate as is possible. I (wrongly) assumed that "use webpack-dev-middleware" meant that more code would need to be added to the project.

I've since submitted a pull request that results in a net reduction in lines of code and also brings the overlay into the picture. You can check it out here: https://github.com/gaearon/react-hot-boilerplate/pull/81