-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Speed up calling elm-format
by not using npx
#49
Conversation
@@ -79,6 +79,7 @@ | |||
"got": "^10.7.0", | |||
"minimist": "^1.2.0", | |||
"ora": "^5.4.0", | |||
"path-key": "^3.1.1", |
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.
cross-spawn
already depends on this module at the same version, so this is only making a sub-dependency a “real” dependency.
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 looks very good! I tried it on Ubuntu and it's working very well 👍
In my testing, the average time went from ~1550ms to ~1250ms (sometimes even less) for a single spawn of elm-format
, so I'm thinking your underplayed the 200ms delay 😅
Did you mark this as draft because you haven't tested it on Windows yet? Do you have a Windows available?
Yes, I marked as draft since I wanted to test more first. I have Windows available, but I’m too tired to test tonight. |
I’ve tested on Windows now. Seems to work perfectly! |
Awesome, thanks a lot for this! |
npx elm-format
is used to call elm-format.npx
takes about 200 ms to boot.This PR removes the use of
npx
for elm-format, speeding things up. This is an implementation of #46 (comment) (only the elm-format bits), but done in a backwards compatible way. As a bonus, this gets rid of the command injection issue reported in #46 (but not the one inelm-review new-package
).I’ve tested manually on macOS and Windows, and it seems to work just like intended. Jeroen has tested on Linux.