-
-
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: overlay with warnings #3215
Conversation
sendStats(sockets, stats, force) { | ||
const shouldEmit = | ||
!force && | ||
stats && | ||
(!stats.errors || stats.errors.length === 0) && | ||
(!stats.warnings || stats.warnings.length === 0) && |
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.
Here we fix bug, when if we have previously warning and run invalidate without change code (for example using API
to invalidate), overlay with warnings hide and did not show again
useErrorOverlay: false, | ||
useProgress: false, | ||
progress: false, | ||
overlay: 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.
Better keep options here as is,in future we can improve this and allow to using this http://192.168.0.5?overlay&no-progress
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.
Let's update snapshot
This is a breaking change, by the way. It doesn't really matter what |
@jordanbtucker no problems, docs will be updated together with stable release |
Codecov Report
@@ Coverage Diff @@
## master #3215 +/- ##
==========================================
+ Coverage 95.18% 95.29% +0.11%
==========================================
Files 37 34 -3
Lines 1247 1234 -13
Branches 351 350 -1
==========================================
- Hits 1187 1176 -11
+ Misses 54 52 -2
Partials 6 6
Continue to review full report at Codecov.
|
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.
LGTM
to get the old behaviour (show only errors in overlay): am I understanding correctly that the new convention is supposed to be: overlay: {
warnings: false,
errors: true
} from this PR, it looks like this object-style syntax is supposed to be supported. but it's rejected in schema validation:
I've also tried As a result, my application is covered with a full-screen overlay warning me of my bundle size. this is not something I can trivially fix — I would rather hide the overlay, but don't know how. I'm using |
ah, I see; it's: client: {
overlay: {
warnings: false,
errors: true
}
} |
@Birch-san Yes, we will update docs in future, anyway why you disable warnings? What is the problem? |
@alexander-akait correct solution is to serve via HTTP/2 (so we can have as many chunks as we like), but requires us to get SSL certificates, so there's a few things we'd need to get right. we've accepted for now that it's easier to keep the big chunks. out of interest: how bad is it to have big chunks? what kind of problems happen? |
You can disable/change/filter this warning using https://webpack.js.org/configuration/performance/#performancehints
Big chunk is always not good, but splitting them is not simple story for some projects, need look at code |
thanks; I'm still happy to see the warning in the webpack CLI. only wanted it excluded from the full-screen overlay.
can't show code. will describe broad approach… we currently chunk based on how long they're likely to live in the browser's cache (or whether they're conditionally-used features):
I think those categories are good (are they? 🤔 ), but if we used more chunks… probably I'd use the same categories, but split each category into 250kB chunks? it looks like maybe it wouldn't be impossible for us to enable HTTP/2 and use small chunks… are there any problems that can happen when you have loads of small chunks? or is this the recommended way to do chunking? |
With http2 I will say it is recommend to split on small chunks, without http2 just don't create a l lot requests in the same time (most of browsers support only 5/10 parallel requests with http1.1) You can lazy load part of your code when it will be used, for example you don't need logic for checkout while user on other page |
thanks — then, might be worth an investigation. would be nice to get down to zero warnings! 🙂 |
For Bugs and Features; did you add new tests?
bug, existing
Motivation / Use-Case
When we set
overlay: true
we meanoverlay: { warnings: true, errors: true }
, but current logic is not show warnings in overlay by defualt, also we have bug when we show warning and invalidate code warnings just hideBreaking Changes
In theory no, because
overlay: true
should show warnings and errorsAdditional Info
No