Skip to content

refactor(dts): deduplicate package entry selection and remove dead code#1266

Merged
Boshen merged 1 commit into
mainfrom
refactor/dts-cleanup
Jul 2, 2026
Merged

refactor(dts): deduplicate package entry selection and remove dead code#1266
Boshen merged 1 commit into
mainfrom
refactor/dts-cleanup

Conversation

@Boshen

@Boshen Boshen commented Jul 2, 2026

Copy link
Copy Markdown
Member
  • Factor the byte-identical 14-line typings/types/main entry-selection block, which appeared twice in dts_resolve_as_directory (once in the typesVersions branch, once in the types/typings/main branch), into a dts_package_entry helper, and collapse the resulting nested if let into a let-chain.
  • Remove impl BitOr for Extensions: the | operator is never invoked on this private type — every union goes through .union() (BitAnd is used and stays).
  • Drop the unused _cached_path parameter from dts_resolve_tsconfig_paths (private method, single caller).

Split out of #1263.

- 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

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.04%. Comparing base (4837a2e) to head (e67af2c).

Files with missing lines Patch % Lines
src/dts_resolver.rs 93.33% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Jul 2, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 3.24%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 5 regressed benchmarks
✅ 15 untouched benchmarks
⏩ 5 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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)

Open in CodSpeed

Footnotes

  1. 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.

@Boshen
Boshen merged commit 9763d7b into main Jul 2, 2026
18 checks passed
@Boshen
Boshen deleted the refactor/dts-cleanup branch July 2, 2026 07:30
@oxc-guard oxc-guard Bot mentioned this pull request Jul 2, 2026
Boshen pushed a commit that referenced this pull request Jul 2, 2026
## 🤖 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant