Skip to content

Commit

Permalink
React: Upgrade to the new JSX transform.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ellatrix committed May 31, 2024
1 parent 2303441 commit 430c8b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function wp_default_packages_vendor( $scripts ) {
$vendor_scripts = array(
'react',
'react-dom' => array( 'react' ),
'react-jsx-runtime' => array( 'react' ),
'regenerator-runtime',
'moment',
'lodash',
Expand All @@ -109,6 +110,7 @@ function wp_default_packages_vendor( $scripts ) {
$vendor_scripts_versions = array(
'react' => '18.3.1',
'react-dom' => '18.3.1',
'react-jsx-runtime' => '18.3.1',
'regenerator-runtime' => '0.14.0',
'moment' => '2.29.4',
'lodash' => '4.17.21',
Expand Down
4 changes: 0 additions & 4 deletions tools/webpack/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ module.exports = function (
'wp-polyfill-inert.js': 'wicg-inert/dist/inert.js',
'wp-polyfill-importmap.js': 'es-module-shims/dist/es-module-shims.wasm.js',
'moment.js': 'moment/moment.js',
'react.js': 'react/umd/react.development.js',
'react-dom.js': 'react-dom/umd/react-dom.development.js',
'regenerator-runtime.js': 'regenerator-runtime/runtime.js',
};

Expand All @@ -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',
};

const minifyVendors = {
Expand Down
2 changes: 2 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const developmentConfig = require( './tools/webpack/development' );
const mediaConfig = require( './tools/webpack/media' );
const packagesConfig = require( './tools/webpack/packages' );
const modulesConfig = require( './tools/webpack/modules' );
const vendorsConfig = require( './tools/webpack/vendors' );

module.exports = function( env = { environment: "production", watch: false, buildTarget: false } ) {
if ( ! env.watch ) {
Expand All @@ -19,6 +20,7 @@ module.exports = function( env = { environment: "production", watch: false, buil
mediaConfig( env ),
packagesConfig( env ),
modulesConfig( env ),
...vendorsConfig( env ),
];

return config;
Expand Down

0 comments on commit 430c8b0

Please sign in to comment.