refactor(dts): deduplicate package entry selection and remove dead code#1266
Conversation
- Factor the byte-identical typings/types/main entry-selection block (duplicated in `dts_resolve_as_directory`) into `dts_package_entry`, and collapse the resulting nested `if let` into a let-chain. - Remove the never-used `impl BitOr for Extensions`; all unions go through `.union()`. - Drop the unused `_cached_path` parameter from `dts_resolve_tsconfig_paths`.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1266 +/- ##
==========================================
+ Coverage 93.85% 94.04% +0.19%
==========================================
Files 21 21
Lines 4313 4301 -12
==========================================
- Hits 4048 4045 -3
+ Misses 265 256 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 3.24%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | pm/bun-flat |
902.6 µs | 978.8 µs | -7.78% |
| ❌ | pm/bun-isolated |
1 ms | 1.1 ms | -6.26% |
| ❌ | resolver_real[multi-thread] |
249.5 µs | 261.2 µs | -4.49% |
| ❌ | resolver_memory[multi-thread] |
250.6 µs | 261.9 µs | -4.29% |
| ❌ | pm/yarn-isolated |
1 ms | 1.1 ms | -4.22% |
| ⚡ | pm/yarn-flat |
929.6 µs | 857.4 µs | +8.42% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing refactor/dts-cleanup (e67af2c) with main (4837a2e)
Footnotes
-
5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
## 🤖 New release * `oxc_resolver`: 11.22.0 -> 11.23.0 * `oxc_resolver_napi`: 11.22.0 -> 11.23.0 <details><summary><i><b>Changelog</b></i></summary><p> ## `oxc_resolver` <blockquote> ## [11.23.0](v11.22.0...v11.23.0) - 2026-07-02 ### <!-- 0 -->🚀 Features - *(tsconfig)* expose outDir, declarationDir, resolveJsonModule, checkJs ([#1257](#1257)) (by @Boshen) ### <!-- 1 -->🐛 Bug Fixes - *(exports)* propagate the last error in array target resolution ([#1267](#1267)) (by @Boshen) ### <!-- 2 -->🚜 Refactor - deduplicate cross-file helpers, drop stale lint allows ([#1269](#1269)) (by @Boshen) - *(dts)* deduplicate package entry selection and remove dead code ([#1266](#1266)) (by @Boshen) - *(tsconfig)* skip TsConfig deep clone for non-root configs ([#1265](#1265)) (by @Boshen) - *(alias)* compile fallback aliases once at construction ([#1264](#1264)) (by @Boshen) ### <!-- 4 -->⚡ Performance - *(alias)* scan a packed first-byte array instead of striding over alias entries ([#1260](#1260)) (by @Boshen) ### Contributors * @Boshen </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: oxc-guard[bot] <276638029+oxc-guard[bot]@users.noreply.github.com>
typings/types/mainentry-selection block, which appeared twice indts_resolve_as_directory(once in thetypesVersionsbranch, once in the types/typings/main branch), into adts_package_entryhelper, and collapse the resulting nestedif letinto a let-chain.impl BitOr for Extensions: the|operator is never invoked on this private type — every union goes through.union()(BitAndis used and stays)._cached_pathparameter fromdts_resolve_tsconfig_paths(private method, single caller).Split out of #1263.