-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
HMR loading indicator #826
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
Comments
Idea: That could be done as plugin, which adds some code to the webpack entry-point through If we wanted to get fancy, we could send back a ping to the dev server (, i.e. to a path like |
I'm not a webpack guru by any means, but when perusing the DevServer documentation I figured out that you can go to http://localhost:8080/webpack-dev-server/ which has a little hot loader bar at the top that shows the HMR status |
@LinusBorg The problem with native notifications though is that they could easily get annoying (if they play a sound, or don't disappear fast enough), and they might not show up on the same screen as you have the browser. Here's a demo of my script btw: https://codesandbox.io/s/94rz54rv6o Clearing the console after reload is a pretty nice behavior btw. Then you know that any errors/messages in the console are always from the latest version. |
Nice litte script. could very well be done as a cli plugin. |
@LinusBorg I might try that out 🙂 |
What problem does this feature solve?
Unless I'm monitoring the terminal, I often find myself wondering wether my latest changes have gone to the browser yet. Since you're now showing error messages in the browser view, I think it'd be nice to take the opportunity to also add an indicator which shows you when the HMR process is done.
What does the proposed API look like?
I see two alternatives:
If it's possible to send a message to the browser before compilation starts, you could display a "Reloading module..." message, which disappears when the process is done.
If the browser only recieves notice after compilation is done, you could display a "Module reloaded" message, which immediately starts fading away. I've already made a component like this myself actually, using the
module.hot.addStatusHander
hook.The text was updated successfully, but these errors were encountered: