Earlier quoted context omitted.
it depends on who will be downloading the bundle. if it's a group of consistent users primarily using desktop browsers, it may not be worth worrying about since they'll probably download it once at a fast speed and reuse from the cache repeatedly afterwards. if you have lots of new users on mobile using slow cellular connections, big libraries like moment.js add up and can really hurt load times and make for a poor u…
I think mobile phones have browser cache too.
You Don't Need Moment.js
51–60 of 91 posts
Re: You Don't Need Moment.js
#52Re: You Don't Need Moment.js
#53I really don't understand this... while yes, I might at some point be interested in reducing my bundle size, for 99% of developers out there, a difference in 300kb is just completely irrelevant. I choose my JS libraries because they are actively maintained, have well designed APIs (easy to use), are common enough to where newly hired developers already know them, and just generally make my life easier. This doesn't a…
From users point of view, it's irrelevant what you use inside but how snappy things are.
Re: You Don't Need Moment.js
#54But react-dates has moment as dependency, so…
A devDependency is not the same as a dependency.
Re: You Don't Need Moment.js
#55Earlier quoted context omitted.
After gzipping none of the variants are that large, and let's be real: the 3rd party ads and analytics and cat pictures are gonna strictly dominate the load time.
Cat pictures don't interfere with my ability to interact with the web page. The 2MB+ of bloated, unoptimised JS that you ship with your page that I need to parse and render before I'm allowed to see the 20kb of actual content _does_ interfere with my ability to use the page.
Re: You Don't Need Moment.js
#56Earlier quoted context omitted.
Cat pictures don't interfere with my ability to interact with the web page. The 2MB+ of bloated, unoptimised JS that you ship with your page that I need to parse and render before I'm allowed to see the 20kb of actual content _does_ interfere with my ability to use the page.
The library in question is nowhere near 2MB. You're tilting at windmmills.
Re: You Don't Need Moment.js
#57Whenever a "you might not need this heavy, popular lib" gets posted to HN, the responses are always pretty divided. I always try and write my own functions and import things like lodash, underscore, jQuery, and moment as a last resort. Bundle size may not be that important to the people working on prototypes and side projects, but it certainly is to many other people. If a library is heavy, it is in their interest to…
I’m probably a little old fashioned, but I didn’t even know moment existed and I’ve been fooling around quite a bit with JS dates recently. It didn’t take a long time to write the .ToString(dd-MM-yyyy) module, that was the only thing I really needed aside from the standard library, but I guess it would’ve been faster to import moment.js.
Re: You Don't Need Moment.js
#58But react-dates has moment as dependency, so…
https://github.com/airbnb/react-dates/blob/master/package.js... A devDependency is not the same as a dependency.
Re: You Don't Need Moment.js
#59I really don't understand this... while yes, I might at some point be interested in reducing my bundle size, for 99% of developers out there, a difference in 300kb is just completely irrelevant. I choose my JS libraries because they are actively maintained, have well designed APIs (easy to use), are common enough to where newly hired developers already know them, and just generally make my life easier. This doesn't a…
Re: You Don't Need Moment.js
#60Whenever a "you might not need this heavy, popular lib" gets posted to HN, the responses are always pretty divided. I always try and write my own functions and import things like lodash, underscore, jQuery, and moment as a last resort. Bundle size may not be that important to the people working on prototypes and side projects, but it certainly is to many other people. If a library is heavy, it is in their interest to…
I’ve picked up node and js more seriously recently, coming from .Net and C# and I’ve been wondering why people in my learning material are relying so much on third party libraries for very basic things. I’m probably a little old fashioned, but I didn’t even know moment existed and I’ve been fooling around quite a bit with JS dates recently. It didn’t take a long time to write the .ToString(dd-MM-yyyy) module, that wa…