-
-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Labels
enhancementEnhancement to current features/ behaviorsEnhancement to current features/ behaviorsfeature requestRequest a new featureRequest a new feature
Description
What & Why
- Now,
jest-previewhasn't implemented getCacheKey forcss,fileandfileCRAtransformer.
jest-preview/src/preconfigTransform/css.ts
Lines 1 to 8 in 6ce35ca
'use strict'; import { processCss } from '../transform'; function process(src: string, filename: string) { return processCss(src, filename); } export default { process }; - 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.
How
- We can find
@swc/jestimplementedgetCacheKey. Let's see how they do that.
https://github.com/swc-project/jest/blob/17cf883b46c050a485975d8ce96a05277cf6032f/index.ts#L37-L52 - There are some related PRs as well Implement
getCacheKeyswc-project/jest#32 feat: add support for async transform swc-project/jest#76 - We need to benchmark to see how much users' time
getCacheKeysaves.
Metadata
Metadata
Assignees
Labels
enhancementEnhancement to current features/ behaviorsEnhancement to current features/ behaviorsfeature requestRequest a new featureRequest a new feature