React + ReactDOM is ~35 kB minzipped and jQuery slim is ~24 kB minzipped.
It's recommended that first load JS does not exceed about 150 kB minzipped (parsing/compiling is especially expensive on slow devices), adding a jQuery dependency is pretty annoying.
750 KB is the unminified development version of react-dom. The version users actually download is about 33 kB over the wire. It's completely disingenuous because users don't download that version on a production website. It has tons of source comments and warnings useful for development which makes it so large.
Point 1: He was being dishonest about the size of React (9x bigger? It's around 1.45x actually)
Point 2: Size-conscious devs have a hard time including a fairly large dependency that they don't directly use, it feels like a waste
Point 3: It takes up 16% of the initial payload size budget and takes up 50ms of parse/compile time on slow CPUs when it doesn't need to (all of Bootstrap's JS can be written with the plain DOM API with equal browser support, there's no need to use jQuery in 2019)
I’ve built web projects for very large video game industry companies. Library size of any sort is a huge thing. We can’t introduce anything the company isn’t already using. All of our own library tools are written in pure JS and thus are super lean because we have to consider page load on pages that millions of users will see.
If it’s a smaller site for some local company, the end size of whatever you’re delivering might not be a big deal. In the case of building a product for that many users, every bit counts. The idea of even wanting to introduce a new library can turn into a scheduled dev meeting.
Decluttering dependencies is always good. It's one's decision to choose which library/framework. The size of the library, whether its a few bytes or megabytes, its just one factor while picking a library/framework. There are a lot of other factors.
Yes, I agree, JQuery is lightweight than React. That doesn't mean I've to use JQuery.
6
u/timeshifter_ Feb 13 '19
750KB vs 86KB.
And you claim to be worried about bloat.