File tree 5 files changed +55
-2
lines changed
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 25
25
"default" : " ./index.js"
26
26
},
27
27
"./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
+ },
29
32
"./jsx-dev-runtime" : " ./jsx-dev-runtime.js" ,
30
33
"./src/*" : " ./src/*"
31
34
},
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 = [
134
134
externals : [ 'react' , 'ReactNativeInternalFeatureFlags' ] ,
135
135
} ,
136
136
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
+
137
149
/******* React JSX DEV Runtime *******/
138
150
{
139
151
bundleTypes : [
@@ -176,7 +188,7 @@ const bundles = [
176
188
externals : [ 'react' ] ,
177
189
} ,
178
190
179
- /******* React DOM Shared Subset *******/
191
+ /******* React DOM React Server *******/
180
192
{
181
193
bundleTypes : [ NODE_DEV , NODE_PROD ] ,
182
194
moduleType : RENDERER ,
You can’t perform that action at this time.
0 commit comments