[Flight] Rename the shared entry point (#20420)

* [Flight] Rename the shared entry point

* Shared
This commit is contained in:
Dan Abramov
2020-12-10 02:14:50 +00:00
committed by GitHub
parent dbf40ef759
commit 842ee367e6
7 changed files with 14 additions and 14 deletions

View File

@@ -1,7 +0,0 @@
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-unstable-index.production.min.server.js');
} else {
module.exports = require('./cjs/react-unstable-index.development.server.js');
}

View File

@@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-unstable-shared-subset.production.min.js');
} else {
module.exports = require('./cjs/react-unstable-shared-subset.development.js');
}

View File

@@ -17,16 +17,16 @@
"umd/",
"jsx-runtime.js",
"jsx-dev-runtime.js",
"unstable-index.server.js"
"unstable-shared-subset.js"
],
"main": "index.js",
"exports": {
".": {
"react-server": "./unstable-index.server.js",
"react-server": "./unstable-shared-subset.js",
"default": "./index.js"
},
"./index": {
"react-server": "./unstable-index.server.js",
"react-server": "./unstable-shared-subset.js",
"default": "./index.js"
},
"./build-info.json": "./build-info.json",

View File

@@ -90,11 +90,11 @@ const bundles = [
externals: [],
},
/******* Isomorphic Server Only *******/
/******* Isomorphic Shared Subset *******/
{
bundleTypes: [NODE_DEV, NODE_PROD],
moduleType: ISOMORPHIC,
entry: 'react/unstable-index.server',
entry: 'react/unstable-shared-subset',
global: 'React',
externals: [],
},

View File

@@ -43,7 +43,7 @@ const forks = Object.freeze({
// happens. Other bundles just require('object-assign') anyway.
return null;
}
if (entry === 'react' || entry === 'react/unstable-index.server') {
if (entry === 'react' || entry === 'react/unstable-shared-subset') {
// Use the forked version that uses ES modules instead of CommonJS.
return 'shared/forks/object-assign.inline-umd.js';
}
@@ -64,7 +64,7 @@ const forks = Object.freeze({
// Without this fork, importing `shared/ReactSharedInternals` inside
// the `react` package itself would not work due to a cyclical dependency.
'shared/ReactSharedInternals': (bundleType, entry, dependencies) => {
if (entry === 'react' || entry === 'react/unstable-index.server') {
if (entry === 'react' || entry === 'react/unstable-shared-subset') {
return 'react/src/ReactSharedInternals.js';
}
if (!entry.startsWith('react/') && dependencies.indexOf('react') === -1) {