Version 6.3.0 is ready and available for you to download or update through the WordPress admin. This version was all about improving the JavaScript bundle to give you a faster, more stable user experience.
All changes were behind the scenes which makes this release article a bit nerdy, but rest assured that even non-nerds will appreciate the improvements with how the plugin functions.
New WordPress Version Requirement
To pave the way for new and more native features, we bumped the minimum WordPress core version to 5.2.0
for both the basic and PRO versions of this plugin.
While this plugin won’t necessarily break on older versions of WordPress quite yet, we are no longer testing against WordPress core prior to 5.2.0
and could at any moment release a feature that breaks older versions of WordPress core.
New Tooling
To provide the most stable JavaScript possible we adopted Yarn PNP for all of this plugin’s resources.
If you’re not familiar with Yarn PNP, no worries. The gist is this plugin gets bundled independent of any external package manager which guarantees the JavaScript to compile exactly the same no matter which developer is working on it.
External React
Prior to version 5.0 of WordPress Core, any plugin which used React was required to include their own version of React. As of version 5.0, WordPress core started including React and ReactDOM as internal libraries.
We had a lot of internal discussion on how to approach using React with the modern version of WordPress core. Ultimately we opted to use React’s official CDN to include an external version of React that we could lock our package manager to.
With plugin stability being our top priority, here were our conclusions for our approach:
- WordPress core changes its version of React every couple of releases so if we used the included version we can’t guarantee forward compatibility with older versions of our plugins.
- Bundling React within our packages does not allow for browser caching between bundle versions.
- Using the official CDN adds a high probability of the library already existing in a user’s browser cache and requires no downloading.
- We maintain the ability to update our version of React anytime we need to without concern of conflict with WordPress core.
This one change reduced our plugin’s JavaScript size by roughly 30% and application load time by roughly 15%.
Debug Endpoint Improvements
To go along with the new WordPress version requirement, we added information about the WordPress version to the response to the debug endpoint. This will assist us when troubleshooting a user’s site.