Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flight] Rename the shared entry point #20420

Merged
merged 2 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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') {
gaearon marked this conversation as resolved.
Show resolved Hide resolved
// 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') {
gaearon marked this conversation as resolved.
Show resolved Hide resolved
return 'react/src/ReactSharedInternals.js';
}
if (!entry.startsWith('react/') && dependencies.indexOf('react') === -1) {
Expand Down