webpack-hot-middleware icon indicating copy to clipboard operation
webpack-hot-middleware copied to clipboard

Adopt/Share overlay implementation with create-react-app?

Open kennetpostigo opened this issue 8 years ago • 4 comments
trafficstars

I'm using webpack-hot-middleware for a project and I noticed the overlay(which is quite good) and recently found out about this which is amazing and wondering if maybe we could replicate the effort on the overlay that this middleware already provides. Since both are build on webpack could it be possible to copy paste the overlay they created? @timer may know more about this and if it's possible.

kennetpostigo avatar Mar 04 '17 03:03 kennetpostigo

Integrating the error overlay should be as simple as adding it as an entrypoint to webpack (or just requiring it somewhere -- it has a global side-effect). If interest is this high for it, it's probably worth releasing as a separate package but I think we want to keep it contained in react-dev-utils for now. I guess once it's merged (any day now), you could require it via react-dev-utils/failFast (or react-dev-utils/errorOverlay).

Timer avatar Mar 04 '17 03:03 Timer

I agree I'd like to have it standalone and pull it in.

It would be nicer to be outside dev-utils but I don't think that's a huge issue as this is a dev-only package anyway.

glenjamin avatar Mar 04 '17 07:03 glenjamin

Could someone clarify the goal for this issue? From what I have read, I would assume you all want to replace the existing overlay with react-error-overlay, no?

Getting the overlay to work in webpack-hot-middleware (whm) is as simple as this now that it is standalone.

Alternatively if you just want it to work alongside whm you can add react-error-overlay as an entry before your main. Then just use react-error-overlay/middleware after whm in your server like app.use(errorOverlayMiddleware()).

vinnymac avatar Jun 13 '17 13:06 vinnymac

With react-error-overlay v2 integration a bit more complex. For example see integration with webpack dev server: webpackHotDevClient

frenzzy avatar Oct 03 '17 15:10 frenzzy