Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FB] use modern entrypoint in tests #28724

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/react-dom/src/__tests__/ReactDOMRoot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('ReactDOMRoot', () => {
expect(container.textContent).toEqual('Hi');
});

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

// @gate !classic || !__DEV__
// @gate !www || !__DEV__
it('warns if you import hydrateRoot from react-dom', async () => {
expect(() => ReactDOM.hydrateRoot(container, null)).toErrorDev(
'You are importing hydrateRoot from "react-dom" which is not supported. ' +
Expand Down
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,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was missing from the modern entrypoint but is necessary for tracing tests to pass. Curious though that it doesn't fail. probably because it's a symbol and it imports in cjs as undefined

unstable_getCacheForType,
unstable_useCacheRefresh,
unstable_useMemoCache,
Expand All @@ -48,10 +49,10 @@ export {
useLayoutEffect,
useMemo,
useOptimistic,
useSyncExternalStore,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaning up the order to match react/index

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;
}
gnoff marked this conversation as resolved.
Show resolved Hide resolved
const resolvedFBEntry = resolvedEntry.replace(
'.js',
__EXPERIMENTAL__ ? '.modern.fb.js' : '.classic.fb.js'
Expand Down