Use modern JSX runtime in Flight fixture (#35677)

This commit is contained in:
Sebastian "Sebbie" Silbermann
2026-02-03 12:05:24 +01:00
committed by GitHub
parent d4a325df4d
commit 748ee74e22
9 changed files with 3 additions and 26 deletions

View File

@@ -76,19 +76,6 @@ const cssModuleRegex = /\.module\.css$/;
const sassRegex = /\.(scss|sass)$/;
const sassModuleRegex = /\.module\.(scss|sass)$/;
const hasJsxRuntime = (() => {
if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
return false;
}
try {
require.resolve('react/jsx-runtime');
return true;
} catch (e) {
return false;
}
})();
// This is the production and development configuration.
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
module.exports = function (webpackEnv) {
@@ -425,7 +412,7 @@ module.exports = function (webpackEnv) {
[
require.resolve('babel-preset-react-app'),
{
runtime: hasJsxRuntime ? 'automatic' : 'classic',
runtime: 'automatic',
},
],
],

View File

@@ -5,7 +5,7 @@ const babelOptions = {
ignore: [/\/(build|node_modules)\//],
plugins: [
'@babel/plugin-syntax-import-meta',
'@babel/plugin-transform-react-jsx',
['@babel/plugin-transform-react-jsx', {runtime: 'automatic'}],
],
};

View File

@@ -14,7 +14,7 @@ const babelOptions = {
ignore: [/\/(build|node_modules)\//],
plugins: [
'@babel/plugin-syntax-import-meta',
'@babel/plugin-transform-react-jsx',
['@babel/plugin-transform-react-jsx', {runtime: 'automatic'}],
],
sourceMaps: process.env.NODE_ENV === 'development' ? 'inline' : false,
};

View File

@@ -1,6 +1,5 @@
'use client';
import * as React from 'react';
import {useFormStatus} from 'react-dom';
import ErrorBoundary from './ErrorBoundary.js';

View File

@@ -1,5 +1,3 @@
import * as React from 'react';
export default function Container({children}) {
return <div>{children}</div>;
}

View File

@@ -1,7 +1,5 @@
'use client';
import * as React from 'react';
export function Dynamic() {
return (
<div>

View File

@@ -1,5 +1,3 @@
import * as React from 'react';
import {createCanvas} from 'canvas';
export async function GenerateImage({message}) {

View File

@@ -1,5 +1,3 @@
import * as React from 'react';
export default async function LargeContent() {
return (
<div>

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import {use, Suspense, useState, startTransition, Profiler} from 'react';
import ReactDOM from 'react-dom/client';
import {createFromFetch, encodeReply} from 'react-server-dom-webpack/client';