Skip to content

Commit

Permalink
Remove ReactComponentTreeHook from internals (#19032)
Browse files Browse the repository at this point in the history
We don't really support mixing minor versions anymore anyway. But seems
safe to remove in 17.
  • Loading branch information
sebmarkbage authored May 28, 2020
1 parent 43e59f2 commit 6071486
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
8 changes: 1 addition & 7 deletions packages/react/src/ReactSharedInternals.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@ const ReactSharedInternals = {
};

if (__DEV__) {
Object.assign(ReactSharedInternals, {
// These should not be included in production.
ReactDebugCurrentFrame,
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
// TODO: remove in React 17.0.
ReactComponentTreeHook: {},
});
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
}

export default ReactSharedInternals;
26 changes: 9 additions & 17 deletions packages/react/src/forks/ReactSharedInternals.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,18 @@ const ReactSharedInternals = {
ReactCurrentBatchConfig,
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
assign,

// Re-export the schedule API(s) for UMD bundles.
// This avoids introducing a dependency on a new UMD global in a minor update,
// Since that would be a breaking change (e.g. for all existing CodeSandboxes).
// This re-export is only required for UMD bundles;
// CJS bundles use the shared NPM package.
Scheduler,
SchedulerTracing,
};

if (__DEV__) {
Object.assign(ReactSharedInternals, {
// These should not be included in production.
ReactDebugCurrentFrame,
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
// TODO: remove in React 17.0.
ReactComponentTreeHook: {},
});
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
}

// Re-export the schedule API(s) for UMD bundles.
// This avoids introducing a dependency on a new UMD global in a minor update,
// Since that would be a breaking change (e.g. for all existing CodeSandboxes).
// This re-export is only required for UMD bundles;
// CJS bundles use the shared NPM package.
Object.assign(ReactSharedInternals, {
Scheduler,
SchedulerTracing,
});

export default ReactSharedInternals;

0 comments on commit 6071486

Please sign in to comment.