Skip to content

Commit

Permalink
Pull in upstream fix of createCacheKeyFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Nov 23, 2021
1 parent 22a2308 commit 1f3a7ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"eslint-plugin-no-function-declare-after-return": "^1.0.0",
"eslint-plugin-react": "^6.7.1",
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
"fbjs-scripts": "1.2.0",
"fbjs-scripts": "3.0.1",
"filesize": "^6.0.1",
"flow-bin": "0.97",
"glob": "^7.1.6",
Expand Down
25 changes: 9 additions & 16 deletions scripts/jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const babel = require('@babel/core');
const coffee = require('coffee-script');

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

const pathToBabel = path.join(
require.resolve('@babel/core'),
Expand Down Expand Up @@ -52,20 +52,6 @@ const babelOptions = {
retainLines: true,
};

const getCacheKeyJest26 = createCacheKeyFunctionJest26([
__filename,
pathToBabel,
pathToBabelrc,
pathToTransformInfiniteLoops,
pathToTransformTestGatePragma,
pathToErrorCodes,
]);

// TODO: Upstream fix for `options` being nullable
function getCacheKey(src, file, configString, options = {}) {
return getCacheKeyJest26(src, file, configString, options);
}

module.exports = {
process: function(src, filePath) {
if (filePath.match(/\.css$/)) {
Expand Down Expand Up @@ -110,5 +96,12 @@ module.exports = {
return src;
},

getCacheKey,
getCacheKey: createCacheKeyFunction([
__filename,
pathToBabel,
pathToBabelrc,
pathToTransformInfiniteLoops,
pathToTransformTestGatePragma,
pathToErrorCodes,
]),
};
9 changes: 4 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7571,15 +7571,14 @@ fbjs-css-vars@^1.0.0:
resolved "https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8"
integrity sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==

fbjs-scripts@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/fbjs-scripts/-/fbjs-scripts-1.2.0.tgz#069a0c0634242d10031c6460ef1fccefcdae8b27"
integrity sha512-5krZ8T0Bf8uky0abPoCLrfa7Orxd8UH4Qq8hRUF2RZYNMu+FmEOrBc7Ib3YVONmxTXTlLAvyrrdrVmksDb2OqQ==
fbjs-scripts@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/fbjs-scripts/-/fbjs-scripts-3.0.1.tgz#5265699e158700b453786e4892aa9730c0cb0f75"
integrity sha512-UHsf5lk5G33mSZIviQqulKvyV/kPIMwODH3tpkuoXbsBewFaWwT9KTfEvkoPj+WSGMGI6n+bRsc8VVdSa9Jh+w==
dependencies:
"@babel/core" "^7.0.0"
ansi-colors "^1.0.1"
babel-preset-fbjs "^3.2.0"
core-js "^2.4.1"
cross-spawn "^5.1.0"
fancy-log "^1.3.2"
object-assign "^4.0.1"
Expand Down

0 comments on commit 1f3a7ca

Please sign in to comment.