-
-
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
fix: infinity refresh on warnings #4006
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4006 +/- ##
==========================================
- Coverage 92.60% 92.59% -0.01%
==========================================
Files 14 14
Lines 1406 1405 -1
Branches 516 516
==========================================
- Hits 1302 1301 -1
Misses 96 96
Partials 8 8
Continue to review full report at Codecov.
|
@alexander-akait Were the ramifications of this change intentional? I upgraded an old deployment recently and this change was counter to the old behavior and also my expectation that warnings would not prevent an HMR update or full page reload. For example, the log message for an error states: Was the intent to only prevent this reload when the overlay is used? if (needShowOverlayForWarnings) {
show("warning", _warnings);
} else {
reloadApp(options, status);
} |
Yes, expected, we should not do refresh on warnings, please provide reproducible example and I will show how to fix |
@alexander-akait Ok, but what I'm saying is that this behavior (calling I think this change should be communicated somehow, or perhaps a configuration setting to allow the old behavior made accessible. |
@obsius Can you provide example of the problem? We should not add new options on every problem, if it is bug, we should fix it, there are a lot of changes over the past three years, as you can see keeping that, potentially create infinity reloads, and we can't just revert it |
@alexander-akait This PR does not contain a bug, but does present a significant change to how the webpack-dev-server client works. Anyone expecting HMR or page reloading after a compilation with warnings (the old behavior) may think their configuration is wrong or that some other plugin is in error. I haven't looked at this repo before today, but from the commit history it seems that the old behavior was stable for a very long time, so it would make sense to let developers know of this sudden change. For example, the log message for an error states: Now that a compilation with warnings does not reload, the warning log message could be updated to this: This new behavior could also be mentioned in the release notes. An example of this issue would be: Developer has turned off the overlay for warnings. Before this change:
After this change:
|
@obsius Again, please create reproducible test repo, sending warnings should not prevent reloading, if hash was changed, we should do reload |
If you send warnings without hash changes, it means nothing was changed in compilation, so no reasons to reload page |
@alexander-akait Since you agree that a reload is desired after compilation with warnings, perhaps you can help me understand how a hash change propagates into a reload in the client? The listener in the client for hash(hash) {
status.previousHash = status.currentHash;
status.currentHash = hash;
}, The only place where |
dev server connected with compilation using hooks and send ws message from server to client with hash |
@alexander-akait Here is the server log for a compilation that produces warnings: (1) What I am trying to explain to you, but for some reason is being lost in communication, is that the client is not updating after |
Please create reproducible example, if you need help ASAP, it is the best choice |
@alexander-akait I don't need help ASAP, I'm trying to explain that this PR prevents HMR and page reloads after compilations with |
@obsius Open an original issue and look at infinity loop, it was fixed here, we send hash on each compilation, no hash changes = no reloading, no blockers on client. And stop blaming me, I'm trying to figure out what the problem is and request additional information, but you ignore my request. I am a developer like you, and I spend my free time on this. I believe that we may have a problem, I do not argue and do not claim that you are wrong, all I ask is to show an example. If you have idea how to fix - PR welcome |
@alexander-akait Don't mean to blame you, and appreciate the work you are doing on this. I'm unfamiliar with this project and don't know what changes are desired, which is why I thought this was an undocumented change at first. I cross referenced an issue that may be related and has a repo linked. |
For Bugs and Features; did you add new tests?
Yes, WIP
Motivation / Use-Case
fixes #4005
Breaking Changes
No
Additional Info
No