Skip to content

WPCOM: Remove obsolete React version-bump hotfix - #49391

Merged
arthur791004 merged 1 commit into
trunkfrom
remove/wpcom-react-version-hotfix
Jun 5, 2026
Merged

arthur791004 merged 1 commit into
trunkfrom
remove/wpcom-react-version-hotfix

Conversation

@arthur791004

@arthur791004 arthur791004 commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Proposed changes

Removes jetpack-mu-wpcom/src/features/wpcom-hotfixes/wpcom-hotfixes.php and the matching require_once in class-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.js contents changed while the ?ver= query string stayed at 18, so the CDN kept serving the old file. The hotfix forced ?ver=18.3.1 to 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 the ver string back to 18.3.1 is now either a no-op or, worse, misleading cache-busting metadata claiming React 18 when React 19 is actually being served.

Other information

  • Generate changelog entries for this PR (using AI).

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_scripts filter that rewrote the ?ver= query string on react/react-dom/react-jsx-runtime script handles.

Testing instructions

  • On a simple/Atomic site running this branch, load wp-admin/ and open the block editor.
  • Network panel: confirm react-dom.min.js loads cleanly. The ?ver= query string should reflect whatever WordPress/Gutenberg registered (e.g. 19.x) rather than being rewritten to 18.3.1.
  • No console errors related to React loading or version mismatch.

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.
@github-actions

github-actions Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (WordPress.com Site Helper), and enable the remove/wpcom-react-version-hotfix branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack-mu-wpcom-plugin remove/wpcom-react-version-hotfix

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jun 4, 2026
@arthur791004 arthur791004 self-assigned this Jun 4, 2026
@arthur791004 arthur791004 added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. and removed Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jun 4, 2026
@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php 29/414 (7.00%) 0.02% -1 💚

Full summary · PHP report

@simison simison left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested (I trust you have), but I have enough context to approve.

Internal ref p1780557394344949-slack-C02FMH4G8

@arthur791004

Copy link
Copy Markdown
Contributor Author

Yes, I tested on my simple sites with gutenberg/gutenberg-edge (react 18 and 19), and it works correctly.

@arthur791004
arthur791004 merged commit fcbb7e5 into trunk Jun 5, 2026
79 checks passed
@arthur791004
arthur791004 deleted the remove/wpcom-react-version-hotfix branch June 5, 2026 05:07
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Jun 5, 2026
@simison

simison commented Jun 5, 2026

Copy link
Copy Markdown
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants