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
Fix check for webpack/hot/log when setting HMR log level #1096
Conversation
Cc @johan-lejdung. |
Ah damn, of course it's an array.. Don't know what I was thinking :) If I could, I would approve this change! The build seems to fail, but not related to this file. There seem to be a linting error in Server.js:
|
What's even stranger is that it fails only on node 6 and 4, 8 is ok. 😄 |
Quickly looked through the changelog for node 8 and there were a lot of Array changes, maybe they allow such access now. |
That's an eslint error, so I don't see any reason why it would work differently in node 8 vs. node 4 or 6. Anyway, fixed it in #1098. |
71f7bed
to
e4943a8
Compare
Codecov Report
@@ Coverage Diff @@
## master #1096 +/- ##
=======================================
Coverage 71.92% 71.92%
=======================================
Files 5 5
Lines 463 463
Branches 148 148
=======================================
Hits 333 333
Misses 130 130 Continue to review full report at Codecov.
|
Any news on this? |
@lbogdan you're a rock star for getting these fixes in. very much appreciated! but I beg of you some additional patience please 😄 we're all human on this side, and to say the last two weeks have been personally trying would be an understatement. please note that it may take a week or so to get a patch release out. I'll be out of town and I don't like to release unless I'm around to put out any fires that pop up. |
@shellscape Thank you for your kind words, they might not necessarily reflect the reality! 😄 |
What kind of change does this PR introduce?
Bugfix.
Did you add or update the
examples/
?Not needed.
Summary
Some time ago I authored PR #926. Which, strangely enough, caused issue #1049.
The original code was
Somehow I was under the impression that
hotCtx.keys()
can only return[]
or["./log"]
, and with this assumption, the checkhotCtx.keys().length > 0
is correct. For some strange reason, as per issue #1049, it returned["../package.json", "./console", "./formatters"]
, which doesn't match the regex at all, so I don't really know what happened there. In this case, of course, the check becomes wrong.Now, this is the fix for #1049 in PR #1050
which doesn't work, because
contextKeys
is an array, socontextKeys["./log"]
will always befalse
.So the correct check would be
if (hotCtx.keys().indexOf('./log') !== -1) { ...
.Does this PR introduce a breaking change?
No.