File tree Expand file tree Collapse file tree 7 files changed +84
-4
lines changed Expand file tree Collapse file tree 7 files changed +84
-4
lines changed Original file line number Diff line number Diff line change 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"
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-unstable-index.server.production.min.js' ) ;
5+ } else {
6+ module . exports = require ( './cjs/react-unstable-index.server.development.js' ) ;
7+ }
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 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' ;
Original file line number Diff line number Diff line change 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+ ) ;
Original file line number Diff line number Diff 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 : [
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments