oxc-project
oxc
BlogDocsChangelog

fix(traverse): `ChildScopeCollector` visit all scopes

#10292Merged
Comparing
04-05-fix_traverse_childscopecollector_visit_all_scopes
(
1e683f9
) with
main
(
521de23
)
CodSpeed Performance Gauge
0%
Untouched
36

Benchmarks

Passed

formatter[typescript.js]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
+2%
7.6 ms7.4 ms
formatter[antd.js]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
0%
7.6 ms7.6 ms
transformer[cal.com.tsx]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
0%
33.8 ms33.7 ms
codegen_sourcemap[checker.ts]
tasks/benchmark/benches/codegen.rs::codegen::bench_codegen
CodSpeed Performance Gauge
0%
65.1 ms65.1 ms
semantic[cal.com.tsx]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
26.1 ms26.1 ms
transformer[pdf.mjs]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
0%
10.6 ms10.6 ms
semantic[antd.js]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
104.4 ms104.3 ms
transformer[antd.js]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
0%
52.4 ms52.3 ms
minifier[react.development.js]
tasks/benchmark/benches/minifier.rs::minifier::bench_minifier
CodSpeed Performance Gauge
0%
1.8 ms1.8 ms
mangler[typescript.js]
tasks/benchmark/benches/minifier.rs::minifier::bench_mangler
CodSpeed Performance Gauge
0%
39.4 ms39.4 ms
parser[antd.js]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
0%
113.5 ms113.5 ms
parser[pdf.mjs]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
0%
18.3 ms18.3 ms
parser[checker.ts]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
0%
56.7 ms56.7 ms
lexer[cal.com.tsx]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
5.9 ms5.9 ms
semantic[checker.ts]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
64.2 ms64.2 ms
lexer[checker.ts]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
14.8 ms14.8 ms
lexer[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
21.4 µs21.4 µs
parser[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
0%
92.4 µs92.4 µs
minifier[antd.js]
tasks/benchmark/benches/minifier.rs::minifier::bench_minifier
CodSpeed Performance Gauge
0%
165.3 ms165.3 ms
minifier[typescript.js]
tasks/benchmark/benches/minifier.rs::minifier::bench_minifier
CodSpeed Performance Gauge
0%
291.3 ms291.3 ms
linter[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
2.7 ms2.7 ms
transformer[checker.ts]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
0%
23.3 ms23.3 ms
lexer[antd.js]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
24.8 ms24.8 ms
estree[checker.ts]
tasks/benchmark/benches/parser.rs::parser::bench_estree
CodSpeed Performance Gauge
0%
96.9 ms96.9 ms
linter[cal.com.tsx]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
1.2 s1.2 s
lexer[pdf.mjs]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
3.9 ms3.9 ms
semantic[pdf.mjs]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
17 ms17 ms
linter[checker.ts]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
3 s3 s
isolated-declarations[vue-id.ts]
tasks/benchmark/benches/isolated_declarations.rs::transformer::bench_isolated_declarations
CodSpeed Performance Gauge
0%
58.4 ms58.4 ms
mangler[antd.js]
tasks/benchmark/benches/minifier.rs::minifier::bench_mangler
CodSpeed Performance Gauge
0%
15.9 ms15.9 ms
parser[cal.com.tsx]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
0%
30.1 ms30.1 ms
codegen[checker.ts]
tasks/benchmark/benches/codegen.rs::codegen::bench_codegen
CodSpeed Performance Gauge
0%
22.1 ms22.2 ms
mangler[react.development.js]
tasks/benchmark/benches/minifier.rs::minifier::bench_mangler
CodSpeed Performance Gauge
0%
293.1 µs293.5 µs
semantic[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
73.5 µs73.6 µs
formatter[react.development.js]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
0%
43.7 µs43.8 µs
transformer[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
-1%
135.4 µs136.9 µs

Commits

Click on a commit to change the comparison range
Base
main
521de23
+0.01%
fix(traverse): `ChildScopeCollector` visit all scopes (#10292) Fixes #9702. Fix `ChildScopeCollector` so it doesn't miss out scopes in some cases. Previously when a struct has its own scope, the visitor does not visit any of the struct's fields. But this is incorrect where the type's scope does not cover all of its fields (the scope starts late / ends early). If the fields outside of the scope may themselves have scopes, then those scopes are direct children of the starting point. These types are: * `Class` (`decorators` is outside `Class`'s scope). * `SwitchStatement` (`discriminant` is outside `SwitchStatement`'s scope). * `TSConditionalType` (`check_type` and `false_type` are outside `TSConditionalType`'s scope). Additionally, make the visitor more efficient by not bothering to visit any struct fields / enum variants which don't contain a scope anywhere in their dependencies.
1e683f9
8 months ago
by overlookmotel
© 2025 CodSpeed Technology
Home Terms Privacy Docs