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(hot): enable hot option as default #2546
fix(hot): enable hot option as default #2546
Conversation
Codecov Report
@@ Coverage Diff @@
## feature/upgrade-deps #2546 +/- ##
=====================================================
Coverage 93.40% 93.40%
=====================================================
Files 34 34
Lines 1334 1335 +1
Branches 380 381 +1
=====================================================
+ Hits 1246 1247 +1
Misses 85 85
Partials 3 3
Continue to review full report at Codecov.
|
1da4986
to
8860742
Compare
8860742
to
6f89bb6
Compare
lib/Server.js
Outdated
|
||
if (this.hot) { | ||
this.options.hot = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do not use this.options.hot
only (avoid using this.hot
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addEntries checks this.options.hot so we need to add true when this.hot is true. So you want to delete hotOnly(or this.hot) or hotOnly should be added true as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rewrite code on using this.options.hot
only. What do you think about - this.options.hot: boolean | "only"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, understood. so we need to rewrite this line(
webpack-dev-server/lib/Server.js
Line 734 in 89ffb86
if (this.hot) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally - avoid using this.[propertyFromOptions]
in favor this.options.[property]
in all code, but we can do it in the separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll work on this on Next branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this.hot
in this PR in favor this.options.hot
@@ -86,7 +97,6 @@ class Server { | |||
this.contentBaseWatchers = []; | |||
|
|||
// TODO this.<property> is deprecated (remove them in next major release.) in favor this.options.<property> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? this task hasn't been completed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes, let's keep it
I've deleted hotOnly option but CI will fail because e2e/client.js is broking now. I need to investigate it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! One note, but we can keep it as is to avoid misleading
client-src/default/index.js
Outdated
@@ -15,7 +15,7 @@ const status = { | |||
currentHash: '', | |||
}; | |||
const options = { | |||
hot: false, | |||
hot: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not change it, because it breaks hot: false
logic, we run .hot()
when hot enabled, but if we use hot: false
we doesn't run .hot()
and default value now is true
, so it can break logic for hot: false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I fixed it. The CI's error was because of this.
d313992
to
5bf0372
Compare
5bf0372
to
d627b88
Compare
test/e2e/TransportMode.test.js
Outdated
const swap = res[0]; | ||
res[0] = res[1]; | ||
res[1] = swap; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was deleted. just for my debugging to resolve the CI issue. The reason is #2546 (comment).
TransportMode.test.js is really flaky. The order of snapshot often is not fine between v5 and v4. Understood this thing. This error has already existed before. In this time, we had changed the default value from false to true so we were able to notice it. |
754d081
to
ba99d38
Compare
ba99d38
to
1ce649c
Compare
@@ -14,18 +14,21 @@ describe('transportMode client', () => { | |||
{ | |||
title: 'sockjs', | |||
options: { | |||
hot: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test has been set the value as false
from before.(currently, we set the default value as true so we need to add this option to here)
@evilebottnawi CI is green, please review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, thanks!
Oh, we merge it into |
* chore(deps): upgrade deps * style: run prettier * test: update * ci: remove Node@8 * test(cli): add windows support * chore(deps): downgrade puppeteer * chore(deps): downgrade some deps * fix(hot): enable hot option as default (#2546) BREAKING CHANGE: the `hot` option is `true` by default, the `hotOnly` option was removed in favor `{ hot: 'only' }` * fix: remove lazy and filename options (#2544) BREAKING CHANGE: `lazy` and `filename` options was removed
* chore(deps): upgrade deps * style: run prettier * test: update * ci: remove Node@8 * test(cli): add windows support * chore(deps): downgrade puppeteer * chore(deps): downgrade some deps * fix(hot): enable hot option as default (#2546) BREAKING CHANGE: the `hot` option is `true` by default, the `hotOnly` option was removed in favor `{ hot: 'only' }` * fix: remove lazy and filename options (#2544) BREAKING CHANGE: `lazy` and `filename` options was removed
For Bugs and Features; did you add new tests?
Updated.
Motivation / Use-Case
The hot option is as default from now on.
Breaking Changes
yes
Additional Info