Skip to content

Commit

Permalink
perf: reuse jest file system cache for isolatedModules: false (#2189)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ahnpnl committed Dec 10, 2020
1 parent 3c18b32 commit 68f446b
Show file tree
Hide file tree
Showing 10 changed files with 12,465 additions and 149 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -21,13 +21,13 @@ It supports all features of TypeScript including type-checking. [Read more about
| 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 |
|---|

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

[<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)
[<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)

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

[<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)
[<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)

---

Expand Down
12 changes: 0 additions & 12 deletions e2e/__tests__/__snapshots__/logger.test.ts.snap
Expand Up @@ -22,16 +22,12 @@ Array [
"[level:20] file caching disabled",
"[level:20] created language service",
"[level:20] computing cache key for <cwd>/Hello.spec.ts",
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.spec.ts",
"[level:20] updateMemoryCache: update memory cache for language service",
"[level:20] processing <cwd>/Hello.spec.ts",
"[level:20] getCompiledOutput(): compiling using language service",
"[level:20] updateMemoryCache: update memory cache for language service",
"[level:20] visitSourceFileNode(): hoisting",
"[level:20] getCompiledOutput(): computing diagnostics using language service",
"[level:20] computing cache key for <cwd>/Hello.ts",
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.ts",
"[level:20] updateMemoryCache: update memory cache for language service",
"[level:20] processing <cwd>/Hello.ts",
"[level:20] getCompiledOutput(): compiling using language service",
"[level:20] updateMemoryCache: update memory cache for language service",
Expand Down Expand Up @@ -66,17 +62,13 @@ Array [
"[level:20] file caching disabled",
"[level:20] created language service",
"[level:20] computing cache key for <cwd>/Hello.spec.ts",
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.spec.ts",
"[level:20] updateMemoryCache: update memory cache for language service",
"[level:20] processing <cwd>/Hello.spec.ts",
"[level:20] getCompiledOutput(): compiling using language service",
"[level:20] updateMemoryCache: update memory cache for language service",
"[level:20] visitSourceFileNode(): hoisting",
"[level:20] getCompiledOutput(): computing diagnostics using language service",
"[level:20] calling babel-jest processor",
"[level:20] computing cache key for <cwd>/Hello.ts",
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.ts",
"[level:20] updateMemoryCache: update memory cache for language service",
"[level:20] processing <cwd>/Hello.ts",
"[level:20] getCompiledOutput(): compiling using language service",
"[level:20] updateMemoryCache: update memory cache for language service",
Expand Down Expand Up @@ -113,17 +105,13 @@ Array [
"[level:20] file caching disabled",
"[level:20] created language service",
"[level:20] computing cache key for <cwd>/Hello.spec.ts",
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.spec.ts",
"[level:20] updateMemoryCache: update memory cache for language service",
"[level:20] processing <cwd>/Hello.spec.ts",
"[level:20] getCompiledOutput(): compiling using language service",
"[level:20] updateMemoryCache: update memory cache for language service",
"[level:20] visitSourceFileNode(): hoisting",
"[level:20] getCompiledOutput(): computing diagnostics using language service",
"[level:20] calling babel-jest processor",
"[level:20] computing cache key for <cwd>/Hello.ts",
"[level:20] getting resolved modules from TypeScript API for <cwd>/Hello.ts",
"[level:20] updateMemoryCache: update memory cache for language service",
"[level:20] processing <cwd>/Hello.ts",
"[level:20] getCompiledOutput(): compiling using language service",
"[level:20] updateMemoryCache: update memory cache for language service",
Expand Down

0 comments on commit 68f446b

Please sign in to comment.