Skip to content

Commit

Permalink
Pull in jsx-dev-runtime for react-server
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Apr 26, 2024
1 parent 7dde5da commit ddd6b73
Show file tree
Hide file tree
Showing 8 changed files with 2,738 additions and 2 deletions.

Large diffs are not rendered by default.

@@ -0,0 +1,40 @@
/**
* @license React
* react-jsx-dev-runtime.react-server.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

"use strict";
var React = require("next/dist/compiled/react"),
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)
throw Error(
'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.'
);
function jsxProd(type, config, maybeKey) {
var key = null;
void 0 !== maybeKey && (key = "" + maybeKey);
void 0 !== config.key && (key = "" + config.key);
if ("key" in config) {
maybeKey = {};
for (var propName in config)
"key" !== propName && (maybeKey[propName] = config[propName]);
} else maybeKey = config;
config = maybeKey.ref;
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
ref: void 0 !== config ? config : null,
props: maybeKey
};
}
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.jsx = jsxProd;
exports.jsxDEV = void 0;
exports.jsxs = jsxProd;
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-jsx-dev-runtime.react-server.production.js');
} else {
module.exports = require('./cjs/react-jsx-dev-runtime.react-server.development.js');
}
5 changes: 4 additions & 1 deletion packages/next/src/compiled/react-experimental/package.json
Expand Up @@ -11,6 +11,9 @@
"react-server": "./jsx-runtime.react-server.js",
"default": "./jsx-runtime.js"
},
"./jsx-dev-runtime": "./jsx-dev-runtime.js"
"./jsx-dev-runtime": {
"react-server": "./jsx-dev-runtime.react-server.js",
"default": "./jsx-dev-runtime.js"
}
}
}

0 comments on commit ddd6b73

Please sign in to comment.