-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Installing package from npm takes a long time #436
Comments
I've researched for alternative libraries, but I haven't found any perfect replacements.
I could probably fix up a PR for switching to another formatting library that is smaller, if it would be interesting. But I'd like some input on what concessions would be acceptable (if any). |
Interesting find. TIL about I see this problem (or similar?) has actually been reported to date-fns before: ...but no satisfying solution yet (I think?). My preference among the options you listed would be @paescuj do you have opinions? |
There are other causes of heavy weight : rxjs. Imho, concurrently would benefit a great performance improvement if it just distribute a tree shaken optimized with no npm dependency cli bundle. I don't see a major interest in distributing the library, but if you need to, it could be done in another package "core" which can hold the references to the heavy dependencies. |
Alternative (and a bit hacky) but could open to removing the dependency all together is abusing Intl.DateTimeFormat:
Works on node 14.20 and above (tested using runkit). The main cons with this option is it's:
Low probability this idea would be taken seriously but in case someone else stumbles on this issue wondering if Intl.DateTimeFormat can be swapped in, here ya go! |
Hey! This is now fixed in v9.0.0. |
Awesome. Thank you for your hard work <3 |
I noticed earlier today when I cloned an older project I have that running
npm install
took quite a long time. I drilled down in to why, and it turned out that installingconcurrently
was the main culprit. Or rather, thedate-fns
library it has as a dependency. I ran the installation instruction again, and supplied the--timing
flag, to get some data:Notice how the step to
reifyNode:node_modules/date-fns
(which I think is unpacking the downloaded library) took a little over 35s, of the total 37s. I've re-ran the same command several times, and the results are pretty consistent.I am not sure what is causing it to take such a long time, but I found an few old issue here talking about
date-fns
(#329) and it being imported in its fullness. Maybe that could be the problem here too, since the npm installation cannot tree shake the dependency.The text was updated successfully, but these errors were encountered: