perf: tree-shake errors and warnings in production mode#92
perf: tree-shake errors and warnings in production mode#92tomastrajan merged 1 commit intoangular-extensions:masterfrom arturovt:perf/tree-shake-errors
Conversation
Codecov Report
@@ Coverage Diff @@
## master #92 +/- ##
==========================================
- Coverage 84.13% 84.09% -0.05%
==========================================
Files 30 30
Lines 435 440 +5
Branches 57 63 +6
==========================================
+ Hits 366 370 +4
- Misses 69 70 +1
Continue to review full report at Codecov.
|
|
@arturovt is this something which is considered best practice ? eg how would it look like in prod when those cases happen ? But if its all good and expected we can ofcourse merge |
|
Well, if the user is doing something, those errors will be thrown in development mode. E.g. if I wouldn't say that tree-shaking is some best practice; this is something that all libraries are trying to achieve to decrease the final bundle size, e.g. considering how Angular tree-shakes all errors and warnings internally (since everything is wrapped with |
|
@arturovt thank you, as long as this follows what angular does it should not be too confusing for the developer experience |
Hey! I've guarded all warnings and errors with
ngDevModein the same way as Angular guards warnings and errors internally (thus they can be tree-shaken by Terser when app (not lib) is built in production mode).Before:
After: