Skip to content

Copy React vendor scripts from Gutenberg, update version number#11359

Open
jsnajdr wants to merge 1 commit intoWordPress:trunkfrom
jsnajdr:update/copy-react-from-gutenberg
Open

Copy React vendor scripts from Gutenberg, update version number#11359
jsnajdr wants to merge 1 commit intoWordPress:trunkfrom
jsnajdr:update/copy-react-from-gutenberg

Conversation

@jsnajdr
Copy link
Copy Markdown
Member

@jsnajdr jsnajdr commented Mar 26, 2026

Gutenberg started building its own bundles for the react, react-dom and react-jsx-runtime vendor scripts. Previously we've been copying React's own UMD bundles shipped as part of their NPM packages, but React 19 is going to remove these UMD bundles, and we are preparing for the migration by abandoning the UMD bundles in advance.

Instead of copying the UMD files, we copy them from the Gutenberg build.

We also update the version strings of the packages by appending a -wp suffix, so that we can differentiate them from previous versions. Even though it's still the same React 18.3.1, the build method has changed.

Trac ticket: https://core.trac.wordpress.org/ticket/64958
Backports Gutenberg PR: WordPress/gutenberg#74343 and WordPress/gutenberg#76811

Use of AI Tools

Autocomplete with Cursor and Opus 4.6.

@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jsnajdr.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copy link
Copy Markdown
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

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

Thanks for prepping this @jsnajdr 🙇🏻

This builds locally for me without complaint, the vendor dist files have the right param.

Image

Might need a rebase before we can commit.


/*
* Append '.1' to the version number for React and ReactDOM.
* Append '-wp' to the version number for React and ReactDOM.
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.

And react-jsx-runtime?

* This can be removed in the next update to the packages.
* This can be removed in the next update to the packages (to React 19).
*
* See https://core.trac.wordpress.org/ticket/62422
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.

Worth also adding https://core.trac.wordpress.org/ticket/64958 for context?

If I'm reading it correctly, the previous ticket refers to switching to UMD builds, and this PR is switching away.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants