-
-
Notifications
You must be signed in to change notification settings - Fork 30
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: improve perf #235
fix: improve perf #235
Conversation
787b748
to
8eaf104
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #235 +/- ##
==========================================
+ Coverage 95.91% 96.09% +0.18%
==========================================
Files 3 3
Lines 269 282 +13
Branches 107 111 +4
==========================================
+ Hits 258 271 +13
Misses 11 11
☔ View full report in Codecov by Sentry. |
👍 |
@@ -153,6 +151,40 @@ const { minify: minifyWorker } = require("./minify"); | |||
|
|||
const warningRegex = /\s.+:+([0-9]+):+([0-9]+)/; | |||
|
|||
/** | |||
* @template T | |||
* @param fn {(function(): any) | undefined} |
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.
shouldn't this be @param {function (): T} fn
instead ? This would allow typescript to infer T
properly. Also, the argument should not be undefined as that would break. The current signature means that type checking won't catch mistakes (the need to override the type when using the variable hides the fact that the type checker cannot trust it)
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.
@stof Good catch, feel free to send a fix
This PR contains a:
Motivation / Use-Case
Avoid loading a lot of modules on initial load + lazy loading + faster tracing source maps
Breaking Changes
No
Additional Info
No