Skip to content

Commit

Permalink
[FB] disable legacy mode in modern build
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gnoff committed Apr 3, 2024
1 parent 8f55a6a commit f40827b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion packages/react-dom/index.modern.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

export {default as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED} from './src/ReactDOMSharedInternals';
export {
createRoot,
hydrateRoot,
createPortal,
flushSync,
unstable_batchedUpdates,
Expand All @@ -25,4 +27,4 @@ export {
version,
} from './src/client/ReactDOM';

export {createRoot, hydrateRoot} from './src/client/ReactDOMRootFB';
// export {createRoot, hydrateRoot} from './src/client/ReactDOMRootFB';
3 changes: 2 additions & 1 deletion packages/react/index.modern.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export {
unstable_Activity,
unstable_Scope,
unstable_SuspenseList,
unstable_TracingMarker,
unstable_getCacheForType,
unstable_useCacheRefresh,
unstable_useMemoCache,
Expand All @@ -48,10 +49,10 @@ export {
useLayoutEffect,
useMemo,
useOptimistic,
useSyncExternalStore,
useReducer,
useRef,
useState,
useSyncExternalStore,
useTransition,
useActionState,
version,
Expand Down
5 changes: 0 additions & 5 deletions scripts/jest/setupHostConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ function resolveEntryFork(resolvedEntry, isFBBundle) {
// .js

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

0 comments on commit f40827b

Please sign in to comment.