Fix emotion cache output garbage in unit tests

Summary:
emotion/cache started generating nonsense warnings about SSR again when running unit tests. This is because atm emotion/cache is 3(!) times in our dep tree, and the wrong one got patched. Tried to dedupe that, but it seems inevitable:

- emotion/react requires v. 11.6.0 of it
- emotion/css requires v. 11.5.0 because a newer version of that package hasn't been released
- console-feed still uses emotion 10.

So instead, just added an other patch

Reviewed By: passy

Differential Revision: D32557413

fbshipit-source-id: 8a61a8065d21123453b3345b25ff87a9865094ed
This commit is contained in:
Michel Weststrate
2021-11-19 03:59:55 -08:00
committed by Facebook GitHub Bot
parent 3e9cf79dff
commit 35c482ac92
3 changed files with 22 additions and 4 deletions

View File

@@ -12,8 +12,8 @@
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@emotion/css": "^11.5.0",
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@emotion/react": "^11.6.0",
"@emotion/styled": "^11.6.0",
"@iarna/toml": "^2.2.5",
"@tanishiking/aho-corasick": "^0.0.1",
"@types/archiver": "^5.1.1",

View File

@@ -0,0 +1,18 @@
diff --git a/node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js b/node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js
index b1ad6ac..e577f28 100644
--- a/node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js
+++ b/node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js
@@ -158,9 +158,10 @@ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
return;
}
- unsafePseudoClasses.forEach(function (unsafePseudoClass) {
- console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
- });
+ // messes up unit tests, and we don't do SSR!
+ // unsafePseudoClasses.forEach(function (unsafePseudoClass) {
+ // console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
+ // });
}
};
};

View File

@@ -1667,7 +1667,7 @@
resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.5.tgz#2c40f81449a4e554e9fc6396910ed4843ec2be50"
integrity sha512-igX9a37DR2ZPGYtV6suZ6whr8pTFtyHL3K/oLUotxpSVO2ASaprmAe2Dkq7tBo7CRY7MMDrAa9nuQP9/YG8FxQ==
"@emotion/react@^11.5.0", "@emotion/react@^11.6.0":
"@emotion/react@^11.6.0":
version "11.6.0"
resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.6.0.tgz#61fcb95c1e01255734c2c721cb9beabcf521eb0f"
integrity sha512-23MnRZFBN9+D1lHXC5pD6z4X9yhPxxtHr6f+iTGz6Fv6Rda0GdefPrsHL7otsEf+//7uqCdT5QtHeRxHCERzuw==
@@ -1735,7 +1735,7 @@
"@emotion/styled-base" "^10.0.27"
babel-plugin-emotion "^10.0.27"
"@emotion/styled@^11.3.0":
"@emotion/styled@^11.6.0":
version "11.6.0"
resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.6.0.tgz#9230d1a7bcb2ebf83c6a579f4c80e0664132d81d"
integrity sha512-mxVtVyIOTmCAkFbwIp+nCjTXJNgcz4VWkOYQro87jE2QBTydnkiYusMrRGFtzuruiGK4dDaNORk4gH049iiQuw==