Bootstrap's dependence on jQuery has been a relatively large factor in my reason to stop using it in recent years. Now, with the Bootstrap 5 alpha, they're ditching jQuery in preference of using the APIs provided by modern browsers. This is a big step, but one that I feel is beneficial and necessary to encourage developers like me to use it again on future projects.
Lets Not Hate on jQuery
I would like to clarify that I don't hate jQuery.* I think that jQuery has done an incredible job over the years at making front-end web development a significantly less painful endeavour. The reality these days is that it's not as relevant and necessary anymore. Browser support is far less of an issue because they are much better at keeping up with standards and other libraries and frameworks have been developed which render jQuery less useful. Nevertheless, we can still appreciate that jQuery has served it's purpose extremely well since it was first released all the way back in 2006 and I will forever be thankful for it and all the work people put in to building and maintaining it.
Light as a Feather
So lets take a look and see what impact dropping jQuery has on Bootstrap's file size:
We can see that there's only a very small increase (1.3 mB Gzipped) in Bootstrap's file size to compensate for completely removing jQuery!** Less data down the wire means faster page loads which is great for improved SEO and user experiences.
What Else is New?
There are some other new features of Bootstrap 5 which include:
- New CSS custom properties
- Updated forms & form controls
- New utilities API
- Enhanced grid system with a new XXL tier for really large screens
I won't go into detail about any of these, but if you're interested you can head over to the Bootstrap blog to read all about the new features.
Whilst on the subject of Bootstrap I thought I should mention that they have recently released a great set of over 1,000 SVG icons which you can use on any project (you don't need to be using Bootstrap to use them). Take a look at Bootstrap Icons and see what you think!