Skip to content

Commit d81ced5

Browse files
committed
[Flight] Rename the shared entry point
1 parent dbf40ef commit d81ced5

File tree

7 files changed

+15
-16
lines changed

7 files changed

+15
-16
lines changed

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

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines 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-shared-subset.production.min.js');
5+
} else {
6+
module.exports = require('./cjs/react-unstable-shared-subset.development.js');
7+
}

packages/react/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
"umd/",
1818
"jsx-runtime.js",
1919
"jsx-dev-runtime.js",
20-
"unstable-index.server.js"
20+
"unstable-shared-subset.js"
2121
],
2222
"main": "index.js",
2323
"exports": {
2424
".": {
25-
"react-server": "./unstable-index.server.js",
25+
"react-server": "./unstable-shared-subset.js",
2626
"default": "./index.js"
2727
},
2828
"./index": {
29-
"react-server": "./unstable-index.server.js",
29+
"react-server": "./unstable-shared-subset.js",
3030
"default": "./index.js"
3131
},
3232
"./build-info.json": "./build-info.json",
File renamed without changes.

scripts/rollup/bundles.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ const {
6969
} = moduleTypes;
7070

7171
const bundles = [
72-
/******* Isomorphic *******/
7372
{
7473
bundleTypes: [
7574
UMD_DEV,
@@ -90,11 +89,11 @@ const bundles = [
9089
externals: [],
9190
},
9291

93-
/******* Isomorphic Server Only *******/
92+
/******* Isomorphic Shared Subset *******/
9493
{
9594
bundleTypes: [NODE_DEV, NODE_PROD],
9695
moduleType: ISOMORPHIC,
97-
entry: 'react/unstable-index.server',
96+
entry: 'react/unstable-shared-subset',
9897
global: 'React',
9998
externals: [],
10099
},

scripts/rollup/forks.js

Lines 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' || entry === 'react/unstable-index.server') {
46+
if (entry === 'react' || entry.startsWith('react/')) {
4747
// Use the forked version that uses ES modules instead of CommonJS.
4848
return 'shared/forks/object-assign.inline-umd.js';
4949
}
@@ -64,10 +64,10 @@ 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' || entry === 'react/unstable-index.server') {
67+
if (entry === 'react' || entry.startsWith('react/')) {
6868
return 'react/src/ReactSharedInternals.js';
6969
}
70-
if (!entry.startsWith('react/') && dependencies.indexOf('react') === -1) {
70+
if (dependencies.indexOf('react') === -1) {
7171
// React internals are unavailable if we can't reference the package.
7272
// We return an error because we only want to throw if this module gets used.
7373
return new Error(

0 commit comments

Comments
 (0)