Why WordPress’ use of polyfill.min.js is irresponsible.

WordPress has been my go-to CMS for, like, ever (if I can use my teenage voice.)

There was a time when the platform was dedicated to evolving the web, not just being the most popular CMS out there, but actually making the web better. One could say that it became the best CMS precisely because of this. It was fairly easy to use, open-source and really extendible.

However, in recent years, WP has chosen to force this whole visual editor thing on us. That’s fine. I understand it. I don’t love it, but compared to website death sentences like Elementor and Divi, it’s not half-bad. In order to get it to work properly, though, WordPress has to add CSS and Javascript files to the front end of our sites.

Hashtag lame, yo.

The modern web is about performance. Making a website easy to build, only to make that build difficult for people to consume, is not making the web better. Thus, WordPress can be said to now be making the web worse.

screenshot showing poor Lighthouse scores - namely a 69 in performance - using the latest default WordPress theme
WordPress’ TwentyTwentyFour theme’s Google Lighthouse scores, out of the box.

But these things can be somewhat easily overcome. It’s theoretically possible, though a lot more work than in the Classic Editor days, to rewrite, trim down and otherwise just optimize the CSS part. So problem solved, eh?

Until you get to the inclusion of polyfill.min.js. Woocommerce seems to love including this file as well, but Woocommerce loves to include every file it possibly can. It must be some type of challenge over there these days.

All of that said, the concept that the team at WP would use polyfill.js because modern browsers need it is just a lie.

They’re using it because it’s easier. They’re creating a new Netscape vs. Internet Explorer battle, which doesn’t exist, and then running with it. Even the folks behind WP don’t know exactly what polyfill.min.js is doing. That’s scary.

It’s hard to comment too much on this without knowing what exactly lurks inside wp-polyfill; I can’t seem to find an authoritative list of what it includes, nor any sort of readable, adequately commented source. source

That’s a bit harsh, yeah, but the problem here is that what they’re doing is trying to fix some browsers that can’t do A or do B differently than Browser C, instead of just writing code that is universally supported by our amazing browser situation here in 2024. In my opinion, we should be aiming to move away from jQuery, to “Vanilla Javascript” websites, not try and polyfill our way into a new React future.

I was around in 2001, so trust me, the current browser situation is awesome. Please WordPress, don’t ruin it by making an entire new generation of developers think this polyfill idea is acceptable.

Up Next: How to Embed a Spotify Playlist