Sounds like somebody doesn't understand that jQuery is just a tool, a very useful tool, for doing something that you are inevitably going to be doing a lot of while using Bootstrap.
Sounds like somebody doesn’t understand that React is just a tool, a very powerful tool, for making DOM manipulation more efficient by making changes to a virtual DOM, then using a very efficient diffing algorithm to determine whether or not changes need to be made to the actual DOM. If jQuery (or vanilla or another library) is making changes to the real DOM at the same time, then the diffing algorithm is goosed.
Using jQuery on React components isn’t just shooting yourself in the foot, it’s shooting yourself in the gut and bleeding to death in agonising pain. That’s why Bootstrap has lost ground to things like Bulma and Semantic UI that are pure CSS (or pure Sass or whatever).
But it’ll be good to have Bootstrap back, like getting to work with an old friend again.
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.
Not sure why you're getting downvoted since I agree. I don't like adding extra dependencies either, particularly when it doesn't work naturally with the other libraries I'm using.
I'm wondering why there are people like this! Decluttering dependencies is always good. It's one's decision to choose which library/framework to choose
I think they mean in react you pretty much have to build your components from the ground up, need a modal? You'll need to build one (unless using a library). So including bootstrap with jQuery when using react is pointless as you'll be writing the modal as a react component anyway
8
u/timeshifter_ Feb 13 '19
Sounds like somebody doesn't understand that jQuery is just a tool, a very useful tool, for doing something that you are inevitably going to be doing a lot of while using Bootstrap.