The WordPress Factor
“A lot of the surprise about jQuery usage stats comes from living in a bubble,” Gołębiowski-Owczarek told me. “Most websites are not complex Web apps needing a sophisticated framework, [they are] mostly static sites with some dynamic behaviors — often written using WordPress. jQuery is still very popular there; it works and it’s simple, so people don’t feel the need to stop using it.”
jQuery will continue to be a part of WordPress for some time to come, if for no other reason than that it would be difficult to remove it without breaking backward compatibility. But I asked Gołębiowski-Owczarek if WordPress is likely to eventually move away from its reliance on jQuery.
“I think it’s partially already happening,” he replied. “The Gutenberg editor that WordPress created doesn’t depend on jQuery. So at least on the admin side, they have variations that are not dependent on it.”
He expects that over time WordPress will move onto newer technologies, but that it will be a gradual process.
Among the WordPress developer community, the “performance impact of using jQuery in WordPress themes” is a hot topic. There’s even a reference website called “You might not need jQuery” that offers tips on how to replace jQuery in your WordPress application. Its reasoning includes the fact that with modern browsers, “you might not need anything more than what the browser ships with.”
However, there’s another document that warns that “developers should be aware that ditching libraries, like jQuery, can easily require large amounts of research on their end to avoid bugs (even in modern browsers).” So despite the fact that “Is jQuery outdated and dead?” articles have been circulating for several years, it’s very much still alive in the WordPress ecosystem at least. Developers are being encouraged to replace it but at their own risk.
So how did jQuery come to be so embedded in today’s web? A little history is needed to answer that.
So basically, jQuery had been invented to help developers deal with the browser inadequacies of the time.
Is jQuery Outdated Now?
“Those frameworks provide abstractions for easier synchronization between the data and the view,” said Gołębiowski-Owczarek about the likes of Next.js and Angular. “So their users no longer need to modify/access the DOM directly so often and are often discouraged from doing that. In such an environment, using jQuery doesn’t make much sense. But that’s just a small part of the whole web ecosystem.”
However, Gołębiowski-Owczarek acknowledged that jQuery may have performance issues for large-scale applications.
“We’ve improved jQuery performance a lot over the years,” he said. “But there are some obstacles that are hard to deal with. One of them is that to not conflict with the browser, jQuery doesn’t modify native prototypes — as some of the other libraries did (often later causing issues with standardization of conflicting APIs) — but it instead wraps DOM nodes with jQuery wrapper objects. Each operation on such a wrapper creates a new one. In most cases, it doesn’t matter, but for very complex applications with lots of DOM manipulation this can sometimes become an issue.”
Is jQuery outdated: Final Conclusion
In any case, jQuery will be embedded in tens of millions of WordPress sites for years to come. It may even outlast React.
Feature image via Pexels.
Let’s create the next big thing together!
Coming together is a beginning. Keeping together is progress. Working together is success.