-
Notifications
You must be signed in to change notification settings - Fork 47k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add RSC entrypoint for jsx-runtime (#28217)
Adds a new entrypoint for the production jsx-runtime when using react-server condition. Currently the entrypoints are the same but in the future we will potentially change the implementation of the runtime in ways that can only be optimized for react-server constraints and we want to have the entrypoint already separated so environments using it will be pulling in the right version
- Loading branch information
Showing
5 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* 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. | ||
* | ||
* @flow | ||
*/ | ||
export {Fragment, jsx, jsxs} from './src/jsx/ReactJSXServer'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-jsx-runtime.react-server.production.min.js'); | ||
} else { | ||
module.exports = require('./cjs/react-jsx-runtime.react-server.development.js'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* 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. | ||
* | ||
* @flow | ||
*/ | ||
|
||
// These are implementations of the jsx APIs for React Server runtimes. | ||
import {REACT_FRAGMENT_TYPE} from 'shared/ReactSymbols'; | ||
import { | ||
jsxWithValidationStatic, | ||
jsxWithValidationDynamic, | ||
} from './ReactJSXElementValidator'; | ||
import {jsx as jsxProd} from './ReactJSXElement'; | ||
const jsx: any = __DEV__ ? jsxWithValidationDynamic : jsxProd; | ||
// we may want to special case jsxs internally to take advantage of static children. | ||
// for now we can ship identical prod functions | ||
const jsxs: any = __DEV__ ? jsxWithValidationStatic : jsxProd; | ||
|
||
export {REACT_FRAGMENT_TYPE as Fragment, jsx, jsxs}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters