Skip to content

Commit fb33355

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 fb33355

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
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 !disableLegacyMode
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 !disableLegacyMode
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. ' +

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)