Backport legacy context deprecation warning

This backports a deprecation warning for legacy context, even when
Strict Mode is not enabled.

I didn't bother to update all the tests because the tests are in such
a different state than what's on `main`, and on `main` we already
updated the tests accordingly. So instead I silenced the warnings in
our test config, like we've done for other warnings in the past.
This commit is contained in:
Andrew Clark
2024-04-18 11:58:29 -04:00
parent 589423270e
commit 415ee0e6ea
3 changed files with 83 additions and 0 deletions
+13
View File
@@ -23,6 +23,19 @@ module.exports = function shouldIgnoreConsoleError(format, args) {
// We haven't finished migrating our tests to use createRoot.
return true;
}
if (
format.indexOf(
'uses the legacy contextTypes API which is no longer supported and will be removed'
) !== -1 ||
format.indexOf(
'uses the legacy childContextTypes API which is no longer supported and will be removed'
) !== -1
) {
// This is a backported warning. In `main`, there's a different warning
// (and it's fully tested). Not going to bother upgrading all the tests
// on this old release branch, so let's just silence it instead.
return true;
}
}
} else {
if (