Skip to content

Commit 1ffd1e9

Browse files
feat(walking): support for partial walks, early exits, faster diffs
(cherry picked from commit e47262abc1c5671673afe3ff4dccf7044c9f612c)
1 parent f45808f commit 1ffd1e9

File tree

12 files changed

+208
-248
lines changed

12 files changed

+208
-248
lines changed

index.js

+194-242
Large diffs are not rendered by default.

test/bench.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@ const path = require('path')
33
const graph = require('../')
44

55
const cwd = path.join(__dirname, '/fixture')
6-
const w = graph({ cwd, alias: { '@': cwd } })
76

7+
console.time('bench')
8+
9+
const w = graph({ cwd, alias: { '@': cwd } })
810
w.add([path.join(__dirname, '/fixture/index.js')])
11+
console.log('modules', w.ids.length)
12+
w.close()
913

10-
console.log(w.ids.length)
14+
console.timeEnd('bench')
15+
process.exit()
1116

12-
w.on('change', ids => {
13-
console.log(w.ids.length)
14-
})
17+
// w.on('change', ids => {
18+
// console.log('change', w.ids.length, w.tree)
19+
// })
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/bench/esmodules/b.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import b_a from './b_a'
2+
3+
export default 'b'

test/bench/esmodules/b_a.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default 'b_a'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/fixture/esmodules/b.js

-1
This file was deleted.

0 commit comments

Comments
 (0)