Skip to content

Commit 1f3a7ca

Browse files
committed
Pull in upstream fix of createCacheKeyFunction
1 parent 22a2308 commit 1f3a7ca

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"eslint-plugin-no-function-declare-after-return": "^1.0.0",
6262
"eslint-plugin-react": "^6.7.1",
6363
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
64-
"fbjs-scripts": "1.2.0",
64+
"fbjs-scripts": "3.0.1",
6565
"filesize": "^6.0.1",
6666
"flow-bin": "0.97",
6767
"glob": "^7.1.6",

scripts/jest/preprocessor.js

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const babel = require('@babel/core');
66
const coffee = require('coffee-script');
77

88
const tsPreprocessor = require('./typescript/preprocessor');
9-
const createCacheKeyFunctionJest26 = require('fbjs-scripts/jest/createCacheKeyFunction');
9+
const createCacheKeyFunction = require('fbjs-scripts/jest/createCacheKeyFunction');
1010

1111
const pathToBabel = path.join(
1212
require.resolve('@babel/core'),
@@ -52,20 +52,6 @@ const babelOptions = {
5252
retainLines: true,
5353
};
5454

55-
const getCacheKeyJest26 = createCacheKeyFunctionJest26([
56-
__filename,
57-
pathToBabel,
58-
pathToBabelrc,
59-
pathToTransformInfiniteLoops,
60-
pathToTransformTestGatePragma,
61-
pathToErrorCodes,
62-
]);
63-
64-
// TODO: Upstream fix for `options` being nullable
65-
function getCacheKey(src, file, configString, options = {}) {
66-
return getCacheKeyJest26(src, file, configString, options);
67-
}
68-
6955
module.exports = {
7056
process: function(src, filePath) {
7157
if (filePath.match(/\.css$/)) {
@@ -110,5 +96,12 @@ module.exports = {
11096
return src;
11197
},
11298

113-
getCacheKey,
99+
getCacheKey: createCacheKeyFunction([
100+
__filename,
101+
pathToBabel,
102+
pathToBabelrc,
103+
pathToTransformInfiniteLoops,
104+
pathToTransformTestGatePragma,
105+
pathToErrorCodes,
106+
]),
114107
};

yarn.lock

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7571,15 +7571,14 @@ fbjs-css-vars@^1.0.0:
75717571
resolved "https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8"
75727572
integrity sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==
75737573

7574-
fbjs-scripts@1.2.0:
7575-
version "1.2.0"
7576-
resolved "https://registry.yarnpkg.com/fbjs-scripts/-/fbjs-scripts-1.2.0.tgz#069a0c0634242d10031c6460ef1fccefcdae8b27"
7577-
integrity sha512-5krZ8T0Bf8uky0abPoCLrfa7Orxd8UH4Qq8hRUF2RZYNMu+FmEOrBc7Ib3YVONmxTXTlLAvyrrdrVmksDb2OqQ==
7574+
fbjs-scripts@3.0.1:
7575+
version "3.0.1"
7576+
resolved "https://registry.yarnpkg.com/fbjs-scripts/-/fbjs-scripts-3.0.1.tgz#5265699e158700b453786e4892aa9730c0cb0f75"
7577+
integrity sha512-UHsf5lk5G33mSZIviQqulKvyV/kPIMwODH3tpkuoXbsBewFaWwT9KTfEvkoPj+WSGMGI6n+bRsc8VVdSa9Jh+w==
75787578
dependencies:
75797579
"@babel/core" "^7.0.0"
75807580
ansi-colors "^1.0.1"
75817581
babel-preset-fbjs "^3.2.0"
7582-
core-js "^2.4.1"
75837582
cross-spawn "^5.1.0"
75847583
fancy-log "^1.3.2"
75857584
object-assign "^4.0.1"

0 commit comments

Comments
 (0)