fix(socket-server): send stats to new connections#102
fix(socket-server): send stats to new connections#102ryanclark wants to merge 2 commits intowebpack-contrib:masterfrom
stats to new connections#102Conversation
directly send stats to new connections instead of only broadcasting them globally when there is one client connected
|
Also, if we remove these lines of code - webpack-hot-client/lib/client/index.js Lines 7 to 9 in 276d950 This will also fix #95 - thoughts on including that? I've ran a test against the code in #61 as well as the same code but without the iframe (both entries in |
stats to new connections
|
@rynclark Would you like to include the fix mentioned in #102 (comment) in this PR or open or would you like to open a separate PR for it as a follow up? |
|
@michael-ciniawsky could you merge it, please? :) |
|
|
|
Thanks for the info 👍 it's new for me that |
Ouch. Please merge the fix and republish under new name? :) (https://www.npmjs.com/package/webpack-hot is available) I'd hate to see this amazing package go away. |
|
so when this will be merged? |
|
I've forked this repository at https://github.com/hedgepigdaniel/webpack-hmr-client and merged this, along with some other fixes. Its available on NPM as |
This sends the compilation stats directly to new connections, instead of broadcasting them globally when there is only one client connected. This fixes the issue where pages would not hot reload until a file was saved twice, as it ensures every new client receives the "initial"
okevent. Should fix #92 and #93.This worked fine with
3.0.0because of a bug - it used to checkconnections.length, but because it's aSet, this was alwaysundefined, meaning the check always passed.By broadcasting to new connections only, this should fix #61 (as the parent window will not receive an
okevent when the child connects, forcing the page to refresh). In turn, it addresses the concerns that #96 was made to fix.Update:
I've created a bare bones setup based off of #61 and tested it on these changes. No page refreshing and both the parent window and iframe reload correctly when their respective entry files are changed.
Type
Issues
SemVer