Skip to content

Commit 1ca4777

Browse files
committed
Pull in jsx-dev-runtime for react-server
Source: facebook/react#28921
1 parent d233905 commit 1ca4777

8 files changed

+2738
-2
lines changed

packages/next/src/compiled/react-experimental/cjs/react-jsx-dev-runtime.react-server.development.js

Lines changed: 1318 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* @license React
3+
* react-jsx-dev-runtime.react-server.production.js
4+
*
5+
* Copyright (c) Meta Platforms, Inc. and affiliates.
6+
*
7+
* This source code is licensed under the MIT license found in the
8+
* LICENSE file in the root directory of this source tree.
9+
*/
10+
11+
"use strict";
12+
var React = require("next/dist/compiled/react"),
13+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
14+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
15+
if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)
16+
throw Error(
17+
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
18+
);
19+
function jsxProd(type, config, maybeKey) {
20+
var key = null;
21+
void 0 !== maybeKey && (key = "" + maybeKey);
22+
void 0 !== config.key && (key = "" + config.key);
23+
if ("key" in config) {
24+
maybeKey = {};
25+
for (var propName in config)
26+
"key" !== propName && (maybeKey[propName] = config[propName]);
27+
} else maybeKey = config;
28+
config = maybeKey.ref;
29+
return {
30+
$$typeof: REACT_ELEMENT_TYPE,
31+
type: type,
32+
key: key,
33+
ref: void 0 !== config ? config : null,
34+
props: maybeKey
35+
};
36+
}
37+
exports.Fragment = REACT_FRAGMENT_TYPE;
38+
exports.jsx = jsxProd;
39+
exports.jsxDEV = void 0;
40+
exports.jsxs = jsxProd;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
if (process.env.NODE_ENV === 'production') {
4+
module.exports = require('./cjs/react-jsx-dev-runtime.react-server.production.js');
5+
} else {
6+
module.exports = require('./cjs/react-jsx-dev-runtime.react-server.development.js');
7+
}

packages/next/src/compiled/react-experimental/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
"react-server": "./jsx-runtime.react-server.js",
1212
"default": "./jsx-runtime.js"
1313
},
14-
"./jsx-dev-runtime": "./jsx-dev-runtime.js"
14+
"./jsx-dev-runtime": {
15+
"react-server": "./jsx-dev-runtime.react-server.js",
16+
"default": "./jsx-dev-runtime.js"
17+
}
1518
}
1619
}

0 commit comments

Comments
 (0)