This repository has been archived by the owner on Jul 13, 2021. It is now read-only.
fix(socket-server): send stats
to new connections
#102
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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"
ok
event. Should fix #92 and #93.This worked fine with
3.0.0
because 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
ok
event 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