-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: add client.reconnect
option
#3912
Conversation
client.reconnect
optionclient.reconnect
option
@@ -1627,6 +1638,10 @@ class Server { | |||
this.sendMessage([client], "progress", this.options.client.progress); | |||
} | |||
|
|||
if (this.options.client && this.options.client.reconnect) { | |||
this.sendMessage([client], "reconnect", this.options.client.reconnect); | |||
} |
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.
We need handler in our client for this like for progress
/etc, so developers can change value using web socket API
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.
Looks good, one note above, and let's add tests
Codecov Report
@@ Coverage Diff @@
## master #3912 +/- ##
==========================================
- Coverage 92.94% 92.58% -0.36%
==========================================
Files 14 14
Lines 1346 1362 +16
Branches 467 474 +7
==========================================
+ Hits 1251 1261 +10
- Misses 88 93 +5
- Partials 7 8 +1
Continue to review full report at Codecov.
|
b0e9c36
to
a19587b
Compare
Looks good, let's fix the tests |
6f91e81
to
360cdb8
Compare
360cdb8
to
2c00428
Compare
client.reconnect
optionclient.reconnect
option
Thanks |
@snitin315 I have another good task for you, we should implement the
options will be passed to https://github.com/webpack/webpack-dev-server/blob/master/lib/Server.js#L1565, https://github.com/webpack/webpack-dev-server/blob/master/lib/Server.js#L1577, https://github.com/webpack/webpack-dev-server/blob/master/lib/Server.js#L1582 So it allows developer setup many options for server, regarding to webpack --server-type http
webpack --server-type https --server-options-key ./path/to/key
webpack --server-type http2 --server-options-key ./path/to/key But now we will keep them to avoid breaking change, but the // Pseudo code
const serverOptions = {
...this.options.https,
...this.options.server.options
}; Ideally we should do this normalization in |
@alexander-akait sounds good, I will implement 👍 |
For Bugs and Features; did you add new tests?
WIP on tests.
Motivation / Use-Case
New option
client.reconnect: boolean | number
: allows to enable/disable/count of auto connect when client is disconnectedBreaking Changes
None
Additional Info
No