Saber Commerce is an example of how jQuery can be used to create sophisticated, modern apps that look and feel like the latest React or Vue apps that we commonly see in SAAS applications. All of the different WP Admin sections in Saber Commerce have zero refreshes, and they feature a loading pattern that is inspired by React… yet they use jQuery. It is jQuery posts that pull down the data the populates our admin editors, enabling users to create timesheets, invoices and view payments, all without ever seeing a page refresh (except when navigating the main sections in the WP Admin).
Here are 5 reasons why jQuery still rocks. Let us know in the comments below if you agree or agree to disagree!
- It works. Let’s not forget the importance of things working.
- It’s fast enough for most purposes. There is no question React and it’s virtual DOM has a significant speed advantage over jQuery and for some apps this matters, but for many apps the difference is not noticeable at all. You can do a lot of React-style app loading and regeneration of the UX without any slow-down using jQuery.
- It’s built-in with WP. It still makes sense to use jQuery in many situations in WP because developers are familiar with it and it’s already loaded. The move to React is happening, and perhaps in the future WP will offer a firm choice between using one or the other, but this is a long ways off because right now jQuery is still very much required in most WP plugins and themes.
- It’s versatile. Using React has some obvious advantages, but React also has downsides. When you use React it forces you to also use a workflow that includes NPM or another package manager, and it makes you reliant on the React-approach. Whereas jQuery is just available when you need it and doesn’t really dictate how your application works. This also means you’re on your own for state management which is something better addressed in React or VueJS.