Conversation
Contributor
|
@vzaidman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D122323827. |
meta-codesync Bot
pushed a commit
that referenced
this pull request
Sep 29, 2026
Summary: Pull Request resolved: #1995 `react-test-renderer` is deprecated in React 19. This migrates the Fast Refresh integration tests in `metro-runtime` to `testing-library/react` over `react-dom`. - `MetroFastRefreshMockRuntime` loads `react-dom/client` and `testing-library/react/pure` while the DevTools hook is aliased to the runtime's global, and exposes `render`/`screen` instead of `renderer`. Tests call `cleanupRuntimes()` in `afterEach` because the pure entry point skips auto-cleanup. - The test runs under `jsdom` (adds `jest-environment-jsdom`). The module system is created with `window` shadowed as `undefined`, so the simulated environment still has no window, like React Native. - `jest.config.js` maps `react` to metro-runtime's copy. In the xplat/js workspace, `react-dom@19.3.0` is hoisted to `xplat/js/node_modules` and would otherwise resolve `react@19.0.0`, which means two React instances and empty renders. - Replaces the `react-test-renderer` libdef with minimal `react-dom/client` and `testing-library/react/pure` declarations in `flow-typed/react-testing.js`. - Updates both lockfiles and adds the new offline-mirror tarballs. Differential Revision: D122323827
meta-codesync
Bot
force-pushed
the
export-D122323827
branch
from
September 29, 2026 14:47
6d3f511 to
f63af64
Compare
Summary: Pull Request resolved: #1995 `react-test-renderer` is deprecated in React 19. This migrates the Fast Refresh integration tests in `metro-runtime` to `testing-library/react` over `react-dom`. - `MetroFastRefreshMockRuntime` loads `react-dom/client` and `testing-library/react/pure` while the DevTools hook is aliased to the runtime's global, and exposes `render`/`screen` instead of `renderer`. Tests call `cleanupRuntimes()` in `afterEach` because the pure entry point skips auto-cleanup. - The test runs under `jsdom` (adds `jest-environment-jsdom`). The module system is created with `window` shadowed as `undefined`, so the simulated environment still has no window, like React Native. - `jest.config.js` maps `react` to metro-runtime's copy. In the xplat/js workspace, `react-dom@19.3.0` is hoisted to `xplat/js/node_modules` and would otherwise resolve `react@19.0.0`, which means two React instances and empty renders. - Replaces the `react-test-renderer` libdef with minimal `react-dom/client` and `testing-library/react/pure` declarations in `flow-typed/react-testing.js`. - Updates both lockfiles and adds the new offline-mirror tarballs. Differential Revision: D122323827
meta-codesync
Bot
force-pushed
the
export-D122323827
branch
from
September 29, 2026 20:27
f63af64 to
e5f5b22
Compare
robhogan
approved these changes
Sep 29, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
react-test-rendereris deprecated in React 19. This migrates the Fast Refresh integration tests inmetro-runtimetotesting-library/reactoverreact-dom.MetroFastRefreshMockRuntimeloadsreact-dom/clientandtesting-library/react/purewhile the DevTools hook is aliased to the runtime's global, and exposesrender/screeninstead ofrenderer. Tests callcleanupRuntimes()inafterEachbecause the pure entry point skips auto-cleanup.jsdom(addsjest-environment-jsdom). The module system is created withwindowshadowed asundefined, so the simulated environment still has no window, like React Native.jest.config.jsmapsreactto metro-runtime's copy. In the xplat/js workspace,react-dom@19.3.0is hoisted toxplat/js/node_modulesand would otherwise resolvereact@19.0.0, which means two React instances and empty renders.react-test-rendererlibdef with minimalreact-dom/clientandtesting-library/react/puredeclarations inflow-typed/react-testing.js.Differential Revision: D122323827