GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add flight specific entry point for react package (#20304) · react/react@d93b58a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • fixtures/flight
    • package.json
  • packages/react
    • npm
      • unstable-index.server.js
    • package.json
    • unstable-index.server.experimental.js
    • unstable-index.server.js
  • scripts/rollup
    • bundles.js
    • forks.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎fixtures/flight/package.json‎

Copy file name to clipboardExpand all lines: fixtures/flight/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"prebuild": "cp -r ../../build/node_modules/* ./node_modules/",
6868
"start": "concurrently \"npm run start:server\" \"npm run start:client\"",
6969
"start:client": "node scripts/start.js",
70-
"start:server": "NODE_ENV=development node --experimental-loader ./loader/index.js server",
70+
"start:server": "NODE_ENV=development node --experimental-loader ./loader/index.js --conditions=react-server server",
7171
"start:prod": "node scripts/build.js && NODE_ENV=production node server",
7272
"build": "node scripts/build.js",
7373
"test": "node scripts/test.js --env=jsdom"
Collapse file

‎packages/react/npm/unstable-index.server.js‎

Copy file name to clipboard
+7Lines 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-unstable-index.server.production.min.js');
5+
} else {
6+
module.exports = require('./cjs/react-unstable-index.server.development.js');
7+
}
Collapse file

‎packages/react/package.json‎

Copy file name to clipboardExpand all lines: packages/react/package.json
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,24 @@
1717
"umd/",
1818
"jsx-runtime.js",
1919
"jsx-dev-runtime.js",
20+
"unstable-index.server.js",
2021
"unstable-cache.js"
2122
],
2223
"main": "index.js",
24+
"exports": {
25+
".": {
26+
"react-server": "./unstable-index.server.js",
27+
"default": "./index.js"
28+
},
29+
"./index": {
30+
"react-server": "./unstable-index.server.js",
31+
"default": "./index.js"
32+
},
33+
"./build-info.json": "./build-info.json",
34+
"./jsx-runtime": "./jsx-runtime.js",
35+
"./jsx-dev-runtime": "./jsx-dev-runtime.js",
36+
"./": "./"
37+
},
2338
"repository": {
2439
"type": "git",
2540
"url": "https://github.com/facebook/react.git",
Collapse file

‎packages/react/unstable-index.server.experimental.js‎

Copy file name to clipboard
+37Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its 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+
export {
11+
Children,
12+
createRef,
13+
forwardRef,
14+
lazy,
15+
memo,
16+
useCallback,
17+
useContext,
18+
useDebugValue,
19+
useMemo,
20+
useMutableSource as unstable_useMutableSource,
21+
createMutableSource as unstable_createMutableSource,
22+
Fragment,
23+
Profiler,
24+
StrictMode,
25+
Suspense,
26+
createElement,
27+
cloneElement,
28+
isValidElement,
29+
version,
30+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
31+
// exposeConcurrentModeAPIs
32+
useDeferredValue as unstable_useDeferredValue,
33+
SuspenseList as unstable_SuspenseList,
34+
unstable_useOpaqueIdentifier,
35+
// enableDebugTracing
36+
unstable_DebugTracingMode,
37+
} from './src/React';
Collapse file

‎packages/react/unstable-index.server.js‎

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its 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+
throw new Error(
11+
'This entry point is not yet supported outside of experimental channels',
12+
);
Collapse file

‎scripts/rollup/bundles.js‎

Copy file name to clipboardExpand all lines: scripts/rollup/bundles.js
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ const bundles = [
9090
externals: [],
9191
},
9292

93+
/******* Isomorphic Server Only *******/
94+
{
95+
bundleTypes: [NODE_DEV, NODE_PROD],
96+
moduleType: ISOMORPHIC,
97+
entry: 'react/unstable-index.server',
98+
global: 'React',
99+
externals: [],
100+
},
101+
93102
/******* React JSX Runtime *******/
94103
{
95104
bundleTypes: [
Collapse file

‎scripts/rollup/forks.js‎

Copy file name to clipboardExpand all lines: scripts/rollup/forks.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const forks = Object.freeze({
4343
// happens. Other bundles just require('object-assign') anyway.
4444
return null;
4545
}
46-
if (entry === 'react') {
46+
if (entry === 'react' || entry === 'react/unstable-index.server') {
4747
// Use the forked version that uses ES modules instead of CommonJS.
4848
return 'shared/forks/object-assign.inline-umd.js';
4949
}
@@ -64,8 +64,8 @@ const forks = Object.freeze({
6464
// Without this fork, importing `shared/ReactSharedInternals` inside
6565
// the `react` package itself would not work due to a cyclical dependency.
6666
'shared/ReactSharedInternals': (bundleType, entry, dependencies) => {
67-
if (entry === 'react') {
68-
return 'react/src/ReactSharedInternals';
67+
if (entry === 'react' || entry === 'react/unstable-index.server') {
68+
return 'react/src/ReactSharedInternals.js';
6969
}
7070
if (!entry.startsWith('react/') && dependencies.indexOf('react') === -1) {
7171
// React internals are unavailable if we can't reference the package.

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.