Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build the React JSX runtime into a new WordPress script #6678

Closed
wants to merge 1 commit into from

Conversation

youknowriad
Copy link
Contributor

Trac ticket: https://core.trac.wordpress.org/ticket/61324

Backports Gutenberg PR WordPress/gutenberg#61692

This PR adds the necessary webpack config to build the React JSX Runtime script and adds the script to WordPress. Without this, the next package update on Core will be blocked as the new packages are going to be using the new JSX Runtime.

For the moment though, you can test that the PR adds the react-jsx-runtime script to wp-includes/js/dist/vendor/react-jsx-runtime.js
Also if you load manually the react-jsx-runtime in WordPress, you'll see the ReactJSXRuntime global available in the console.

@youknowriad youknowriad requested review from gziolo and ellatrix May 30, 2024 09:53
@youknowriad youknowriad self-assigned this May 30, 2024
Copy link

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 youknowriad.

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

@@ -111,8 +109,6 @@ module.exports = function (
'objectFitPolyfill/dist/objectFitPolyfill.min.js',
'wp-polyfill-inert.min.js': 'wicg-inert/dist/inert.min.js',
'moment.min.js': 'moment/min/moment.min.js',
'react.min.js': 'react/umd/react.production.min.js',
'react-dom.min.js': 'react-dom/umd/react-dom.production.min.js',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also just like the backported PR, this moves react scripts we used in Core from the deprecated umd builds to CJS.

Copy link

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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • 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.

pento pushed a commit that referenced this pull request May 31, 2024
See WordPress/gutenberg#61692.
See #6678.

Props youknowriad.

Fixes #61324.



git-svn-id: https://develop.svn.wordpress.org/trunk@58271 602fd350-edb4-49c9-b593-d223f7449a82
@ellatrix ellatrix closed this May 31, 2024
@youknowriad youknowriad deleted the build/jsx-runtime branch May 31, 2024 19:07
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