-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
⚡ Use dynamic imports instead of static imports #1126
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #1126 +/- ##
=======================================
Coverage 91.90% 91.90%
=======================================
Files 28 28
Lines 284 284
Branches 69 69
=======================================
Hits 261 261
Misses 22 22
Partials 1 1 ☔ View full report in Codecov by Sentry. |
|
@@ -59,14 +58,20 @@ const cli = meow( | |||
) | |||
|
|||
export const options = { |
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.
This is great! It improves startup time, but I'm wondering how much it affects the overall execution time of the command? So we can understand the trade-offs of the solution 👀
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.
It shouldn't affect anything. It defers loading to when it's needed instead of pulling everything in memory from the get go. Code execution following the dynamic import proceeds like usual. It just gets to executing a lot faster since it doesn't have to load in all the other commands and their dependencies.
Only downside of dynamic importing AFAIK is the fact that tree shaking won't be available for the commands and their dependencies.
Description
This PR updates the imports from static imports to dynamic imports which should result in some easy speed improvements.
Changed
Issues