Skip to content

Commit 68f446b

Browse files
authored
perf: reuse jest file system cache for isolatedModules: false (#2189)
Jest 27 passes `cacheFS` from runtime to transformer. Since TypeScript `LanguageService` performs some file reads, we should use and update that cache so that Jest won't attempt to reread those files, improves performance.
1 parent 3c18b32 commit 68f446b

10 files changed

Lines changed: 12465 additions & 149 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ It supports all features of TypeScript including type-checking. [Read more about
2121
| We are not doing semantic versioning and `23.10` is a re-write, run `npm i -D ts-jest@"<23.10.0"` to go back to the previous version |
2222
|---|
2323

24-
[<img src="./docs/assets/img/documentation.png" align="left" height="24"> View the online documentation (usage & technical)](https://kulshekhar.github.io/ts-jest)
24+
[<img src="./docs/static/img/documentation.png" align="left" height="24"> View the online documentation (usage & technical)](https://kulshekhar.github.io/ts-jest)
2525

26-
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://bit.ly/3bRHFPQ)
26+
[<img src="./docs/static/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://bit.ly/3bRHFPQ)
2727

28-
[<img src="./docs/assets/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](TROUBLESHOOTING.md)
28+
[<img src="./docs/static/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](TROUBLESHOOTING.md)
2929

30-
[<img src="./docs/assets/img/pull-request.png" align="left" height="24"> We're looking for collaborators! Want to help improve `ts-jest`?](https://github.com/kulshekhar/ts-jest/issues/223)
30+
[<img src="./docs/static/img/pull-request.png" align="left" height="24"> We're looking for collaborators! Want to help improve `ts-jest`?](https://github.com/kulshekhar/ts-jest/issues/223)
3131

3232
---
3333

e2e/__tests__/__snapshots__/logger.test.ts.snap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ Array [
2222
"[level:20] file caching disabled",
2323
"[level:20] created language service",
2424
"[level:20] computing cache key for <cwd>/Hello.spec.ts",
25-
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.spec.ts",
26-
"[level:20] updateMemoryCache: update memory cache for language service",
2725
"[level:20] processing <cwd>/Hello.spec.ts",
2826
"[level:20] getCompiledOutput(): compiling using language service",
2927
"[level:20] updateMemoryCache: update memory cache for language service",
3028
"[level:20] visitSourceFileNode(): hoisting",
3129
"[level:20] getCompiledOutput(): computing diagnostics using language service",
3230
"[level:20] computing cache key for <cwd>/Hello.ts",
33-
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.ts",
34-
"[level:20] updateMemoryCache: update memory cache for language service",
3531
"[level:20] processing <cwd>/Hello.ts",
3632
"[level:20] getCompiledOutput(): compiling using language service",
3733
"[level:20] updateMemoryCache: update memory cache for language service",
@@ -66,17 +62,13 @@ Array [
6662
"[level:20] file caching disabled",
6763
"[level:20] created language service",
6864
"[level:20] computing cache key for <cwd>/Hello.spec.ts",
69-
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.spec.ts",
70-
"[level:20] updateMemoryCache: update memory cache for language service",
7165
"[level:20] processing <cwd>/Hello.spec.ts",
7266
"[level:20] getCompiledOutput(): compiling using language service",
7367
"[level:20] updateMemoryCache: update memory cache for language service",
7468
"[level:20] visitSourceFileNode(): hoisting",
7569
"[level:20] getCompiledOutput(): computing diagnostics using language service",
7670
"[level:20] calling babel-jest processor",
7771
"[level:20] computing cache key for <cwd>/Hello.ts",
78-
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.ts",
79-
"[level:20] updateMemoryCache: update memory cache for language service",
8072
"[level:20] processing <cwd>/Hello.ts",
8173
"[level:20] getCompiledOutput(): compiling using language service",
8274
"[level:20] updateMemoryCache: update memory cache for language service",
@@ -113,17 +105,13 @@ Array [
113105
"[level:20] file caching disabled",
114106
"[level:20] created language service",
115107
"[level:20] computing cache key for <cwd>/Hello.spec.ts",
116-
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.spec.ts",
117-
"[level:20] updateMemoryCache: update memory cache for language service",
118108
"[level:20] processing <cwd>/Hello.spec.ts",
119109
"[level:20] getCompiledOutput(): compiling using language service",
120110
"[level:20] updateMemoryCache: update memory cache for language service",
121111
"[level:20] visitSourceFileNode(): hoisting",
122112
"[level:20] getCompiledOutput(): computing diagnostics using language service",
123113
"[level:20] calling babel-jest processor",
124114
"[level:20] computing cache key for <cwd>/Hello.ts",
125-
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.ts",
126-
"[level:20] updateMemoryCache: update memory cache for language service",
127115
"[level:20] processing <cwd>/Hello.ts",
128116
"[level:20] getCompiledOutput(): compiling using language service",
129117
"[level:20] updateMemoryCache: update memory cache for language service",

0 commit comments

Comments
 (0)