[Flight] Rename the shared entry point (#20420)
* [Flight] Rename the shared entry point * Shared
Dan Abramov committed
Dec 10, 2020 at 02:14 UTC
842ee367e620d322e67262d67e892b17712998f8
7 files changed
+14
-14
packages/react/npm/unstable-index.server.js
deleted
-7
@@ -1,7 +0,0 @@
1
-'use strict';
2
-
3
-if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./cjs/react-unstable-index.production.min.server.js');
5
-} else {
6
- module.exports = require('./cjs/react-unstable-index.development.server.js');
7
-}
packages/react/npm/unstable-shared-subset.js
new
+7
@@ -0,0 +1,7 @@
1
+'use strict';
2
+
3
+if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./cjs/react-unstable-shared-subset.production.min.js');
5
+} else {
6
+ module.exports = require('./cjs/react-unstable-shared-subset.development.js');
7
+}
packages/react/package.json
+3
-3
@@ -17,16 +17,16 @@
17
"umd/",
18
"jsx-runtime.js",
19
"jsx-dev-runtime.js",
20
- "unstable-index.server.js"
20
+ "unstable-shared-subset.js"
21
],
22
"main": "index.js",
23
"exports": {
24
".": {
25
- "react-server": "./unstable-index.server.js",
25
+ "react-server": "./unstable-shared-subset.js",
26
"default": "./index.js"
27
},
28
"./index": {
29
- "react-server": "./unstable-index.server.js",
29
+ "react-server": "./unstable-shared-subset.js",
30
"default": "./index.js"
31
},
32
"./build-info.json": "./build-info.json",
packages/react/unstable-shared-subset.experimental.js
renamed
packages/react/unstable-shared-subset.js
renamed
scripts/rollup/bundles.js
+2
-2
@@ -90,11 +90,11 @@ const bundles = [
90
externals: [],
91
},
92
93
- /******* Isomorphic Server Only *******/
93
+ /******* Isomorphic Shared Subset *******/
94
{
95
bundleTypes: [NODE_DEV, NODE_PROD],
96
moduleType: ISOMORPHIC,
97
- entry: 'react/unstable-index.server',
97
+ entry: 'react/unstable-shared-subset',
98
global: 'React',
99
externals: [],
100
},
scripts/rollup/forks.js
+2
-2
@@ -43,7 +43,7 @@ const forks = Object.freeze({
43
// happens. Other bundles just require('object-assign') anyway.
44
return null;
45
}
46
- if (entry === 'react' || entry === 'react/unstable-index.server') {
46
+ if (entry === 'react' || entry === 'react/unstable-shared-subset') {
47
// Use the forked version that uses ES modules instead of CommonJS.
48
return 'shared/forks/object-assign.inline-umd.js';
49
}
@@ -64,7 +64,7 @@ const forks = Object.freeze({
64
// Without this fork, importing `shared/ReactSharedInternals` inside
65
// the `react` package itself would not work due to a cyclical dependency.
66
'shared/ReactSharedInternals': (bundleType, entry, dependencies) => {
67
- if (entry === 'react' || entry === 'react/unstable-index.server') {
67
+ if (entry === 'react' || entry === 'react/unstable-shared-subset') {
68
return 'react/src/ReactSharedInternals.js';
69
}
70
if (!entry.startsWith('react/') && dependencies.indexOf('react') === -1) {