-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
jest-haste-map
instead of node-haste
Summary:This is a new haste map implementation for Jest which is much more scalable than node-haste. node-haste2 isn't well designed and not scalable for short-lived services like Jest. The startup time of node-haste1 vs. node-haste2 on www is almost the same, both between 6 and 8 seconds which is not acceptable for our engineers. This implementation is attempting to accomplish a much reduced and more scalable startup time. It also has reduced scope ? the goal of this is to only build a haste map and provide a way to resolve a one-level deep dependency tree, which is all that Jest really needs from node-haste. `jest-haste-map` can serve as an ideal basis for rewriting node-haste2 (into node-haste3!). With this, the cold start time (building the entire haste map) is now about 14 seconds on www (that's acceptable) but the incremental invocation is only 2 seconds (kyldvs will love me). I haven't heavily micro-optimized the JavaScript in `packages/jest-haste-map/src/index.js` and there is a bunch of data copying Closes #896 Reviewed By: kentaromiura Differential Revision: D3206943 fb-gh-sync-id: 247c4e15ef6dc7e0b1151b7e2539d053389bd249 fbshipit-source-id: 247c4e15ef6dc7e0b1151b7e2539d053389bd249
- Loading branch information
Showing
47 changed files
with
3,661 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__mocks__/ | ||
__tests__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__mocks__/ | ||
__tests__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__mocks__/ | ||
__tests__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "jest-haste-map", | ||
"version": "11.0.2", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/facebook/jest.git" | ||
}, | ||
"license": "BSD-3-Clause", | ||
"main": "src/index.js", | ||
"dependencies": { | ||
"denodeify": "^1.2.1", | ||
"fb-watchman": "^1.9.0", | ||
"graceful-fs": "^4.1.3" | ||
}, | ||
"jest": { | ||
"testEnvironment": "node", | ||
"unmockedModulePathPatterns": [ | ||
"denodeify" | ||
] | ||
}, | ||
"scripts": { | ||
"prepublish": "npm test", | ||
"test": "node -e \"const spawn = require('child_process').spawn, path=require('path'); spawn('node', [path.resolve('../../bin/jest.js')], {stdio:'inherit'})\"" | ||
} | ||
} |
Oops, something went wrong.