add liveReload option to enable/disable refreshing the page#1812
add liveReload option to enable/disable refreshing the page#1812EslamHiko wants to merge 16 commits into
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1812 +/- ##
==========================================
- Coverage 88.34% 88.26% -0.08%
==========================================
Files 14 14
Lines 815 818 +3
Branches 258 260 +2
==========================================
+ Hits 720 722 +2
- Misses 82 83 +1
Partials 13 13
Continue to review full report at Codecov.
|
alexander-akait
left a comment
There was a problem hiding this comment.
Need tests, thanks for PR, looks good
|
@evilebottnawi I couldn't find any way to test the actual code except using the browser and testing it manually, so I had to create a simple simulation it does exactly like what the actual code does. if you have any idea or examples to write a test to check if the page reloads or not it'll be very helpful to write a better test. |
|
@evilebottnawi AppVeyor has a connection problem |
|
@EladBezalel We dropped travis and appveyor. Could you rebase? |
4d7afe0 to
0285f1d
Compare
|
@hiroppy I did a mistake in rebasing, can you please tell me the right way to rebase? and is everything ok or should I fix something? |
|
The rebasing seems to be successful. However, CI fails. Please update test/options.test.js |
| "after": { | ||
| "instanceof": "Function" | ||
| }, | ||
| "serveIndex": { |
There was a problem hiding this comment.
Please delete here(master has already had serverIndex)
| "liveReload": { | ||
| "type": "boolean" | ||
| }, | ||
| "hot": { |
There was a problem hiding this comment.
Please delete here(master has already had hot)
alexander-akait
left a comment
There was a problem hiding this comment.
Good job, small fixes
| this.headers = this.options.headers; | ||
| this.progress = this.options.progress; | ||
| this.hot = options.hot || options.hotOnly; | ||
| this.liveReload = options.liveReload; |
There was a problem hiding this comment.
Don't use this.liveReload (this variables will be removed in next major release), please use this.options.liveReload in code
| this.sockWrite([connection], 'progress', this.progress); | ||
| } | ||
|
|
||
| if (this.liveReload !== false) { |
There was a problem hiding this comment.
this.options.liveReload
| this.sockWrite(this.sockets, 'content-changed'); | ||
| }); | ||
| // disabling refreshing on changing the content | ||
| if (this.liveReload !== false) { |
There was a problem hiding this comment.
this.options.liveReload
| // TODO this.<property> is deprecated (remove them in next major release.) in favor this.options.<property> | ||
| this.hot = options.hot || options.hotOnly; | ||
| this.liveReload = options.liveReload; | ||
| this.options.liveReload = options.liveReload; |
There was a problem hiding this comment.
No need this line after refactor, we already have this.options.liveReload
alexander-akait
left a comment
There was a problem hiding this comment.
Good, let's wait CI green
|
@evilebottnawi coverage tests didn't pass so I did a small fix maybe using |
|
@evilebottnawi anything i can modify or fix to pass the tests ? |
alexander-akait
left a comment
There was a problem hiding this comment.
Need add test for https://github.com/webpack/webpack-dev-server/blob/master/test/CreateConfig.test.js, becase use should support --no-live-reload using CLI (no need tests for CLI)
|
|
||
| if (!options.liveReload) { | ||
| options.liveReload = argv.liveReload; | ||
| } |
There was a problem hiding this comment.
webpack-dev-server/lib/utils/createConfig.js
Line 114 in 9a86d02
--no-live-reload because be default liveReload should be true
alexander-akait
left a comment
There was a problem hiding this comment.
Looks good, due we don't have CLI tests, can you manually testing?
|
@evilebottnawi I tested it and it's working with me. |
|
Awesome thanks! |
|
@evilebottnawi what went wrong? I think I missed to add a test to test |
|
@EslamHiko Awesome === Great/Good |
|
Need update snapshot to fix CI problem |
|
@evilebottnawi I updated my snapshot. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
46b1f70 to
cadee8b
Compare
|
@EslamHiko I did the following things
thanks |
|
yay, CI is green 🍏 |
|
@hiroppy 🎉 🎉 i hope everything is fine now 😄 |
alexander-akait
left a comment
There was a problem hiding this comment.
/cc @hiroppy approve?
|
/cc @EslamHiko need rebase again, sorry |
5245bcc to
92cddd7
Compare
|
Close in favor #1889 |
For Bugs and Features; did you add new tests?
I'm not sure how i would test this feature except using the browser
Motivation / Use-Case
fixes #1744
Breaking Changes
No
Additional Info
live reloading is enabled by default