Skip to content

merge fb main#1

Merged
alexandrutasica merged 4 commits intoalexandrutasica:mainfrom
facebook:main
May 24, 2022
Merged

merge fb main#1
alexandrutasica merged 4 commits intoalexandrutasica:mainfrom
facebook:main

Conversation

@alexandrutasica
Copy link
Copy Markdown
Owner

Summary

How did you test this change?

eps1lon and others added 4 commits May 20, 2022 18:10
* Log unexpected warnings when testing with ReactDOMServerIntegrationTestUtils

* Add test

Following #9230 (comment) except that `foo={true}` renders an empty string.
See #9230 (comment) for rationale.

* Match Preact behavior for boolean props on custom elements

* Poke CircleCI
Some older React versions have different module import names and are missing certain features. This PR mocks modules that don't exist and maps modules in older versions to the ones that are required in tests. Specifically:

* In React v16.5, scheduler is named schedule
* In pre concurrent React, there is no act
* Prior to React v18.0, react-dom/client doesn't exist
* In DevTools, we expect to use scheduler/tracing-profiling instead of scheduler/tracing
This PR adds a script that downloads the specified react version from NPM (ie. react-dom, react, and react-test-renderer) and replaces the corresponding files in the build folder with the downloaded react files.

The scheduler package, unlike react-dom, react, and react-test-renderer, is versioned differently, so we also need to specifically account for that in the script.
We need the regression config moduleNameMapper to come before the current moduleNameMapper so when it tries to map "/^react-dom\/([^/]+)$/ it doesn't get confused. The reason is because order in which the mappings are defined matters. Patterns are checked one by one until one fits, and the most specific rule should be listed first.
@alexandrutasica alexandrutasica merged commit 223c569 into alexandrutasica:main May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants