Skip to content

refactor: deduplicate cross-file helpers, drop stale lint allows#1269

Merged
Boshen merged 1 commit into
mainfrom
refactor/dedupe-cross-file-helpers
Jul 2, 2026
Merged

refactor: deduplicate cross-file helpers, drop stale lint allows#1269
Boshen merged 1 commit into
mainfrom
refactor/dedupe-cross-file-helpers

Conversation

@Boshen

@Boshen Boshen commented Jul 2, 2026

Copy link
Copy Markdown
Member

Two cross-file dedups plus stale-allow removal:

  • push_normalized_component existed twice — path.rs and cache/cached_path.rs — identical except the cached-path copy trims the trailing \0 that uvwasi appends to directory entries on wasm (nodejs/uvwasi#262). This keeps one pub wasm-aware version in path.rs. Note this means path.rs callers (tsconfig path joins) now also get the \0-trim on wasm; on native targets the generated code is unchanged, and the helper stays #[inline] so the hot normalize_with path keeps its codegen.
  • manual_tsconfig(): the "manually configured tsconfig, deliberately skipping Auto discovery" match block was duplicated verbatim in lib.rs (resolve) and dts_resolver.rs (dts_resolve_tsconfig_paths). One helper in tsconfig_resolver.rs now owns it, and find_tsconfig_manual drops its pub(crate).
  • Stale allows: clippy::cognitive_complexity on extend_tsconfig and clippy::too_many_lines on dts_try_extensions' neighbor no longer suppress anything (verified by removing them and running the CI clippy command); extend_tsconfig keeps too_many_lines (139/100).

Part of a second cleanup pass; follows #1264#1268.

- Share one wasm-aware `push_normalized_component` from `path.rs`
  instead of maintaining a near-identical copy in `cached_path.rs`.
  The shared version keeps the uvwasi \0-trim, which `path.rs` callers
  previously lacked on wasm; on native targets the code is identical.
- Add `manual_tsconfig()` for the identical "manually configured
  tsconfig, skipping Auto discovery" match duplicated in `lib.rs` and
  `dts_resolver.rs`; `find_tsconfig_manual` becomes private.
- Drop lint allows that no longer suppress anything:
  `clippy::cognitive_complexity` on `extend_tsconfig` and
  `clippy::too_many_lines` on the dts resolver (the function shrank
  below the threshold).
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.04%. Comparing base (0fbd4a3) to head (e9b5f18).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1269   +/-   ##
=======================================
  Coverage   94.03%   94.04%           
=======================================
  Files          21       21           
  Lines        4277     4267   -10     
=======================================
- Hits         4022     4013    -9     
+ Misses        255      254    -1     

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

@Boshen
Boshen merged commit 3e88f90 into main Jul 2, 2026
17 checks passed
@Boshen
Boshen deleted the refactor/dedupe-cross-file-helpers branch July 2, 2026 07:59
@oxc-guard oxc-guard Bot mentioned this pull request Jul 2, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 2, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 4.6%

⚠️ 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

❌ 3 regressed benchmarks
✅ 18 untouched benchmarks
⏩ 5 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
pm/pnpm-isolated 1 ms 1.1 ms -5.6%
pm/bun-isolated 1.1 ms 1.1 ms -4.89%
pm/bun-flat 942.1 µs 974.4 µs -3.31%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing refactor/dedupe-cross-file-helpers (e9b5f18) with main (0fbd4a3)

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