Skip to content

Commit 2ccfa65

Browse files
potetokassens
andauthored
Fork ReactDOMSharedInternals for www (#25791)
This isn't the right way to do this, but internally we have some restrictions so we need to add an indirection. Let's land this now so we can catch up our sync and then fix forward from there. Co-authored-by: Jan Kassens <jkassens@meta.com>
1 parent cd23e40 commit 2ccfa65

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @flow
8+
*/
9+
10+
// $FlowIgnore[cannot-resolve-module] provided by www
11+
const ReactDOM = require('ReactDOMComet');
12+
13+
const ReactDOMSharedInternals =
14+
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
15+
16+
export default ReactDOMSharedInternals;

scripts/rollup/forks.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ const forks = Object.freeze({
7070
if (entry === 'react-dom' || entry === 'react-dom/server-rendering-stub') {
7171
return './packages/react-dom/src/ReactDOMSharedInternals.js';
7272
}
73+
switch (bundleType) {
74+
case FB_WWW_DEV:
75+
case FB_WWW_PROD:
76+
case FB_WWW_PROFILING:
77+
return './packages/shared/forks/ReactDOMSharedInternals.www.js';
78+
default:
79+
break;
80+
}
7381
if (
7482
!entry.startsWith('react-dom/') &&
7583
dependencies.indexOf('react-dom') === -1

0 commit comments

Comments
 (0)