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

Remove public export for unstable-shared-subset.js #23261

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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: 7 additions & 0 deletions packages/react/npm/react.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.shared-subset.production.min.js');
} else {
module.exports = require('./cjs/react.shared-subset.development.js');
}
7 changes: 0 additions & 7 deletions packages/react/npm/unstable-shared-subset.js

This file was deleted.

7 changes: 3 additions & 4 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@
"umd/",
"jsx-runtime.js",
"jsx-dev-runtime.js",
"unstable-shared-subset.js"
"react.shared-subset.js"
],
"main": "index.js",
"exports": {
".": {
"react-server": "./unstable-shared-subset.js",
"react-server": "./react.shared-subset.js",
"default": "./index.js"
},
"./package.json": "./package.json",
"./jsx-runtime": "./jsx-runtime.js",
"./jsx-dev-runtime": "./jsx-dev-runtime.js",
"./unstable-shared-subset": "./unstable-shared-subset.js"

"./src/*": "./src/*"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ export {
useMutableSource as unstable_useMutableSource,
useTransition,
version,
} from './src/React';
} from './React';
3 changes: 2 additions & 1 deletion scripts/rollup/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ const bundles = [
{
bundleTypes: [NODE_DEV, NODE_PROD],
moduleType: ISOMORPHIC,
entry: 'react/unstable-shared-subset',
entry: 'react/src/ReactSharedSubset.js',
name: 'react.shared-subset',
global: 'React',
minifyWithProdErrorCodes: true,
wrapWithModuleBoundaries: false,
Expand Down
4 changes: 2 additions & 2 deletions scripts/rollup/forks.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const forks = Object.freeze({
// happens. Other bundles just require('object-assign') anyway.
return null;
}
if (entry === 'react' || entry === 'react/unstable-shared-subset') {
if (entry === 'react' || entry === 'react/src/ReactSharedSubset.js') {
// Use the forked version that uses ES modules instead of CommonJS.
return './packages/shared/forks/object-assign.inline-umd.js';
}
Expand All @@ -82,7 +82,7 @@ const forks = Object.freeze({
entry,
dependencies
) => {
if (entry === 'react' || entry === 'react/unstable-shared-subset') {
if (entry === 'react' || entry === 'react/src/ReactSharedSubset.js') {
return './packages/react/src/ReactSharedInternals.js';
}
if (!entry.startsWith('react/') && dependencies.indexOf('react') === -1) {
Expand Down