Uh oh!
There was an error while loading. Please reload this page.
[noop] Typecheck react-noop-renderer against host config and renderer API - #35944
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
807c8deCompare| if (global.__PERSISTENT__) { | ||
| jest.mock('react-noop-renderer', () => | ||
| jest.requireActual('react-noop-renderer/persistent') | ||
| ); | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
...like for the other renderers
8915922 to
6c5daafCompareUh oh!
There was an error while loading. Please reload this page.
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