You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason is that we are not very deeply understand the benefit of getCacheKey. The [docs]((https://jestjs.io/docs/code-transformation) itself is not very detail. But we know it boosts the performance when running Jest since we're caching the transformed files.
As I observe and guess, if we do not implement getCacheKey, Jest automatically cache using return value in the transformation.
For e.g: If our css transform a css file to
This whole file content will be used as the key for caching.
So what is the point of implementing getCacheKey? To get a shorter key? Do we need to do that?
What & Why
jest-preview
hasn't implemented getCacheKey forcss
,file
andfileCRA
transformer.jest-preview/src/preconfigTransform/css.ts
Lines 1 to 8 in 6ce35ca
getCacheKey
. The [docs]((https://jestjs.io/docs/code-transformation) itself is not very detail. But we know it boosts the performance when running Jest since we're caching the transformed files.How
@swc/jest
implementedgetCacheKey
. Let's see how they do that.https://github.com/swc-project/jest/blob/17cf883b46c050a485975d8ce96a05277cf6032f/index.ts#L37-L52
getCacheKey
swc-project/jest#32 feat: add support for async transform swc-project/jest#76getCacheKey
saves.The text was updated successfully, but these errors were encountered: