Skip to content
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

Proper Server HMR #423

Open
tizmagik opened this issue Feb 28, 2017 · 2 comments
Open

Proper Server HMR #423

tizmagik opened this issue Feb 28, 2017 · 2 comments
Labels

Comments

@tizmagik
Copy link
Contributor

Bug or Feature?

Feature

Current Behavior

Currently, changes to code restarts the entire server (it is not hot-reloaded). In many cases, this results in a race condition where the client-side HMR benefit is lost because the server was restarting while the client-side code is being hot-reloaded, requiring the developer to do a manual reload. It also means the edit code => save => see changes feedback loop is significantly slower because of the server restarting. A workaround for this is if server reloading could be disabled ( #99 ).

Desired Behavior

It would be nice if the server actually could hot-reload as well. There is a great post on Hackernoon detailing how this can be done: https://hackernoon.com/hot-reload-all-the-things-ec0fed8ab0#.scaryhftd

@janhoogeveen
Copy link
Contributor

Agree on this, the server probably doesn't need to reload unless a file in the src/routes or src/server folders changes.

@staylor
Copy link
Contributor

staylor commented Mar 16, 2021

we have since moved from react-hot-loader to webpack/hot/poll and the WebpackHotDevClient a la Razzle and create-react-app which uses SockJS to "fix" the race condition by triggering the client reload.

Next step might be using the experimental @pmmmwh/react-refresh-webpack-plugin:
https://github.com/jaredpalmer/razzle/blob/4a104e8ecb8de4d2cf4b677b1e3a5a7d09de39c2/packages/razzle/config/createConfigAsync.js#L14

@woodb woodb added the stale label Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants