Skip to content

Commit bf5292b

Browse files
committed
[FB] disable legacy mode in modern build
Disables legacy mode in www-modern and removes the entrypoint hack in tests since we gate legacy mode tests now Additionally disables test utils because this relies on legacy mode. Additionally gates react-test-renderer test for unstable_Scope because it seems to also rely on legacy roots.
1 parent 8f55a6a commit bf5292b

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

packages/react-dom/src/__tests__/ReactDOMRoot-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('ReactDOMRoot', () => {
4747
expect(container.textContent).toEqual('Hi');
4848
});
4949

50-
// @gate !classic || !__DEV__
50+
// @gate !www || !__DEV__
5151
it('warns if you import createRoot from react-dom', async () => {
5252
expect(() => ReactDOM.createRoot(container)).toErrorDev(
5353
'You are importing createRoot from "react-dom" which is not supported. ' +
@@ -58,7 +58,7 @@ describe('ReactDOMRoot', () => {
5858
);
5959
});
6060

61-
// @gate !classic || !__DEV__
61+
// @gate !www || !__DEV__
6262
it('warns if you import hydrateRoot from react-dom', async () => {
6363
expect(() => ReactDOM.hydrateRoot(container, null)).toErrorDev(
6464
'You are importing hydrateRoot from "react-dom" which is not supported. ' +

packages/react/index.modern.fb.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export {
3333
unstable_Activity,
3434
unstable_Scope,
3535
unstable_SuspenseList,
36+
unstable_TracingMarker,
3637
unstable_getCacheForType,
3738
unstable_useCacheRefresh,
3839
unstable_useMemoCache,
@@ -48,10 +49,10 @@ export {
4849
useLayoutEffect,
4950
useMemo,
5051
useOptimistic,
52+
useSyncExternalStore,
5153
useReducer,
5254
useRef,
5355
useState,
54-
useSyncExternalStore,
5556
useTransition,
5657
useActionState,
5758
version,

scripts/jest/setupHostConfigs.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ function resolveEntryFork(resolvedEntry, isFBBundle) {
1414
// .js
1515

1616
if (isFBBundle) {
17-
if (__EXPERIMENTAL__) {
18-
// We can't currently use the true modern entry point because too many tests fail.
19-
// TODO: Fix tests to not use ReactDOM.render or gate them. Then we can remove this.
20-
return resolvedEntry;
21-
}
2217
const resolvedFBEntry = resolvedEntry.replace(
2318
'.js',
2419
__EXPERIMENTAL__ ? '.modern.fb.js' : '.classic.fb.js'

0 commit comments

Comments
 (0)