File tree Expand file tree Collapse file tree 5 files changed +55
-2
lines changed Expand file tree Collapse file tree 5 files changed +55
-2
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ *
7+ * @flow
8+ */
9+ export { Fragment , jsx , jsxs } from './src/jsx/ReactJSXServer' ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ if ( process . env . NODE_ENV === 'production' ) {
4+ module . exports = require ( './cjs/react-jsx-runtime.react-server.production.min.js' ) ;
5+ } else {
6+ module . exports = require ( './cjs/react-jsx-runtime.react-server.development.js' ) ;
7+ }
Original file line number Diff line number Diff line change 2525 "default" : " ./index.js"
2626 },
2727 "./package.json" : " ./package.json" ,
28- "./jsx-runtime" : " ./jsx-runtime.js" ,
28+ "./jsx-runtime" : {
29+ "react-server" : " ./jsx-runtime.react-server.js" ,
30+ "default" : " ./jsx-runtime.js"
31+ },
2932 "./jsx-dev-runtime" : " ./jsx-dev-runtime.js" ,
3033 "./src/*" : " ./src/*"
3134 },
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ *
7+ * @flow
8+ */
9+
10+ // These are implementations of the jsx APIs for React Server runtimes.
11+ import { REACT_FRAGMENT_TYPE } from 'shared/ReactSymbols' ;
12+ import {
13+ jsxWithValidationStatic ,
14+ jsxWithValidationDynamic ,
15+ } from './ReactJSXElementValidator' ;
16+ import { jsx as jsxProd } from './ReactJSXElement' ;
17+ const jsx : any = __DEV__ ? jsxWithValidationDynamic : jsxProd ;
18+ // we may want to special case jsxs internally to take advantage of static children.
19+ // for now we can ship identical prod functions
20+ const jsxs : any = __DEV__ ? jsxWithValidationStatic : jsxProd ;
21+
22+ export { REACT_FRAGMENT_TYPE as Fragment , jsx , jsxs } ;
Original file line number Diff line number Diff line change @@ -134,6 +134,18 @@ const bundles = [
134134 externals : [ 'react' , 'ReactNativeInternalFeatureFlags' ] ,
135135 } ,
136136
137+ /******* React JSX Runtime React Server *******/
138+ {
139+ bundleTypes : [ NODE_DEV , NODE_PROD ] ,
140+ moduleType : ISOMORPHIC ,
141+ entry : 'react/src/jsx/ReactJSXServer.js' ,
142+ name : 'react-jsx-runtime.react-server' ,
143+ global : 'JSXRuntime' ,
144+ minifyWithProdErrorCodes : false ,
145+ wrapWithModuleBoundaries : false ,
146+ externals : [ 'react' , 'ReactNativeInternalFeatureFlags' ] ,
147+ } ,
148+
137149 /******* React JSX DEV Runtime *******/
138150 {
139151 bundleTypes : [
@@ -176,7 +188,7 @@ const bundles = [
176188 externals : [ 'react' ] ,
177189 } ,
178190
179- /******* React DOM Shared Subset *******/
191+ /******* React DOM React Server *******/
180192 {
181193 bundleTypes : [ NODE_DEV , NODE_PROD ] ,
182194 moduleType : RENDERER ,
You can’t perform that action at this time.
0 commit comments