Skip to content

Commit

Permalink
React: Upgrade to the new JSX transform
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 15, 2024
1 parent eb67023 commit f6c8ec4
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 20 deletions.
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions packages/babel-preset-default/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,10 @@ module.exports = ( api ) => {
],
plugins: [
require.resolve( '@wordpress/warning/babel-plugin' ),
[
require.resolve( '@wordpress/babel-plugin-import-jsx-pragma' ),
{
scopeVariable: 'createElement',
scopeVariableFrag: 'Fragment',
source: 'react',
isDefault: false,
},
],
[
require.resolve( '@babel/plugin-transform-react-jsx' ),
{
pragma: 'createElement',
pragmaFrag: 'Fragment',
useSpread: true,
runtime: 'automatic',
},
],
maybeGetPluginTransformRuntime(),
Expand Down
1 change: 0 additions & 1 deletion packages/babel-preset-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@babel/preset-env": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@babel/runtime": "^7.16.0",
"@wordpress/babel-plugin-import-jsx-pragma": "file:../babel-plugin-import-jsx-pragma",
"@wordpress/browserslist-config": "file:../browserslist-config",
"@wordpress/warning": "file:../warning",
"browserslist": "^4.21.10",
Expand Down
3 changes: 0 additions & 3 deletions packages/interactivity/src/directives.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* @jsx createElement */

/**
* External dependencies
*/
import { h as createElement } from 'preact';
import { useContext, useMemo, useRef } from 'preact/hooks';
import { deepSignal, peek } from 'deepsignal';

Expand Down
2 changes: 0 additions & 2 deletions packages/interactivity/src/hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* @jsx createElement */

/**
* External dependencies
*/
Expand Down

0 comments on commit f6c8ec4

Please sign in to comment.