[noop] Typecheck react-noop-renderer against host config and renderer API#35944
Merged
eps1lon merged 3 commits intofacebook:mainfrom Mar 4, 2026
Conversation
|
Comparing: ee4699f...6c5daaf Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
6af11f2 to
807c8de
Compare
eps1lon
commented
Mar 2, 2026
Comment on lines
+252
to
+256
| if (global.__PERSISTENT__) { | ||
| jest.mock('react-noop-renderer', () => | ||
| jest.requireActual('react-noop-renderer/persistent') | ||
| ); | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
setupHostConfigs runs after setupTests.*. Now that we have an inlined host config for react-noop-renderer, we mock it's entrypoint which overrides the mock from setupTests.* i.e. imports to react-noop-renderer with --persistent no longer got the persistent renderer.
I moved the mocking from the setupTests.* file into this module to have mocking of the entrypoints affected by host configs in a single module which makes ordering conflicts more obvious.
unstubbable
approved these changes
Mar 4, 2026
...like for the other renderers
8915922 to
6c5daaf
Compare
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.
The
react-noop-rendererwas not actually typechecked against the host config and renderer API. This missed a bunch of bugs due to wrong argument or missing host config.Not implementing certain host configs should be done explicitly (e.g. throwing) instead of just omission. This makes it clearer why certain tests can't be written against the noop renderer.
This PR only sets up typechecking by adding a new inlined host config for the
react-noop-rendererpackage. No runtime behavior should be changed. In follow-ups, I'll adjust the runtime to fix the type issues.With types, setting up test infra for new features is easier (e.g. writing
ViewTransitiontests against the noop renderer).Test plan