Skip to content

Commit

Permalink
[Flight] Rename the shared entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Dec 10, 2020
1 parent dbf40ef commit 0a1431d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
7 changes: 0 additions & 7 deletions packages/react/npm/unstable-index.server.js

This file was deleted.

7 changes: 7 additions & 0 deletions packages/react/npm/unstable-shared-subset.js
Original file line number Diff line number Diff line change
@@ -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');
}
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/rollup/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
},
Expand Down
4 changes: 2 additions & 2 deletions scripts/rollup/forks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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-common-subset') {
// Use the forked version that uses ES modules instead of CommonJS.
return 'shared/forks/object-assign.inline-umd.js';
}
Expand All @@ -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-common-subset') {
return 'react/src/ReactSharedInternals.js';
}
if (!entry.startsWith('react/') && dependencies.indexOf('react') === -1) {
Expand Down

0 comments on commit 0a1431d

Please sign in to comment.