Skip to content

Add option to enable client overlay (like one that 'webpack-hot-middleware' provides). #735

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

Closed
stsiarzhanau opened this issue Jan 9, 2017 · 3 comments

Comments

@stsiarzhanau
Copy link

stsiarzhanau commented Jan 9, 2017

Do you want to request a feature or report a bug?
Request a feature.

What is the current behavior?
Error messages are shown in terminal and browser devTools console.

What is the expected behavior?
If an error occurs a semi-transparent overlay containing error message is shown in browser window (in addition to error messages in terminal and browser devTools console).

If this is a feature request, what is motivation or use case for changing the behavior?
Just a nice way to provide information about errors (sometimes it's not convenient to keep terminal window and browser devTools opened).

Please mention your webpack and Operating System version.
webpack 2.2.0-rc.3
webpack-dev-server 2.2.0-rc.0
Windows 10

@SpaceK33z
Copy link
Member

SpaceK33z commented Jan 17, 2017

This is definitely an interesting feature, and I have thought about this before. What I'm not sure about though is if webpack-dev-server should include a script like this, or if this should be handled in user-land (e.g. as a separate package or in your own bundle). webpack-dev-server already has the required hooks for this, see #481 (comment) for an example API.

Also see #481.

@stsiarzhanau
Copy link
Author

In my opinion it should be included and configured just like other options ( --overlay or overlay: true). webpack-dev-server is like an all-in-one and ready-to-use solution (it includes connect-history-api-fallback, compression and other useful stuff). Why not to add another cool feature? I think that list of devDependencies in modern projects is long enough to create separate package that will be used primarily with webpack-dev-server.

What are the cons of such solution?

OFFTOP: In webpack 2 docs there's an example. It's reccommended to include line like this 'webpack-dev-server/client?http://localhost:8080' into entries array. But I skim through WDS source code and it seems like WDS handle this automatically. So there's no need to hardcode it in webpack config. And, as WDS can find another port (if 8080 is in use), it's better to not hardcode. Am I right?

@SpaceK33z
Copy link
Member

Closing since in 2.3.0 we actually released this feature. Completely forgot about this issue.

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

No branches or pull requests

2 participants