Repository navigation
WPCOM: Remove obsolete React version-bump hotfix - #49391
Conversation
The hotfix in #47766 normalized the ?ver= query string on react/react-dom/react-jsx-runtime to 18.3.1 to bust a stale CDN cache introduced by Gutenberg v22.6.0. That cache issue is long resolved and WordPress.com now serves React 19, so pinning to 18.3.1 is at best a no-op and at worst misleading cache-busting metadata.
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 1 file.
|
|
Yes, I tested on my simple sites with gutenberg/gutenberg-edge (react 18 and 19), and it works correctly. |
|
Noting that this fix was made obsolete in WordPress/gutenberg#76811 (bothered me I couldn't first find where it was fixed upstream :-) ) Internal ref for original fix was p1774367306860179-slack-C02FMH4G8 |
Proposed changes
Removes
jetpack-mu-wpcom/src/features/wpcom-hotfixes/wpcom-hotfixes.phpand the matchingrequire_onceinclass-jetpack-mu-wpcom.php.The hotfix was added in #47766 to work around a stale CDN cache that Gutenberg v22.6.0 introduced —
react-dom.min.jscontents changed while the?ver=query string stayed at18, so the CDN kept serving the old file. The hotfix forced?ver=18.3.1to bust that cache.That incident is long behind us, and WordPress.com now serves React 19 (e.g. error stacks currently show
react-dom.js?...&ver=19.2.4). Pinning theverstring back to18.3.1is now either a no-op or, worse, misleading cache-busting metadata claiming React 18 when React 19 is actually being served.Other information
Changelog entry already added (patch / removed).
Does this pull request change what data or activity we track or use?
No. This only removes a
wp_default_scriptsfilter that rewrote the?ver=query string on react/react-dom/react-jsx-runtime script handles.Testing instructions
wp-admin/and open the block editor.react-dom.min.jsloads cleanly. The?ver=query string should reflect whatever WordPress/Gutenberg registered (e.g.19.x) rather than being rewritten to18.3.1.