refactor: unify tsconfig discovery to share resolver cache#8413
Closed
Brooooooklyn wants to merge 1 commit intomainfrom
Closed
refactor: unify tsconfig discovery to share resolver cache#8413Brooooooklyn wants to merge 1 commit intomainfrom
Brooooooklyn wants to merge 1 commit intomainfrom
Conversation
Member
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label graphite: merge-when-ready to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Benchmarks Rust
|
hyf0
reviewed
Feb 22, 2026
crates/rolldown_common/src/inner_bundler_options/types/transform_options.rs
Show resolved
Hide resolved
Contributor
hyf0
approved these changes
Feb 22, 2026
c3238dd to
154a924
Compare
Member
Merge activity
|
Replace RawTransformOptions' private oxc_resolver::Resolver with a TsconfigFinder trait object backed by the main bundler resolver. This eliminates a redundant resolver instance and shares the find_tsconfig cache between module resolution and transformation, avoiding duplicate directory walks when auto-discovering tsconfig.json. The performance benefit depends on the project having tsconfig.json files with auto-discovery enabled (the default). Projects without tsconfig.json or using explicit tsconfig paths see no measurable difference. Verified against in-repo criterion benchmarks (threejs, threejs10x) and external rolldown-benchmark/apps/10000: no statistically significant change detected (criterion p > 0.3, hyperfine within noise). These benchmarks either lack tsconfig.json files or use explicit manual tsconfig paths, so the shared cache is not exercised. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches tsconfig discovery/caching and how per-file transform options are derived, which can subtly affect builds in projects with multiple/edge-case `tsconfig.json` layouts. The change is mostly a refactor with the same discovery API, but it alters cache ownership and object lifetimes. > > **Overview** > Refactors transform-phase tsconfig discovery to reuse the main bundler resolver’s cached `find_tsconfig` results instead of constructing a separate `oxc_resolver::Resolver` inside `RawTransformOptions`. > > Introduces a `TsconfigFinder` trait (exported via `rolldown_common`) implemented by `rolldown_resolver::Resolver`, updates `RawTransformOptions` to hold an `Arc<dyn TsconfigFinder>`, and wires `prepare_build_context` to pass the shared resolver into `TransformOptions::new_raw` for `TsConfig::Auto` and referenced `TsConfig::Manual` cases. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 154a924. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
50910e2 to
26d804e
Compare
154a924 to
b0b004f
Compare
Base automatically changed from
perf/use-flag-based-convergence-detection
to
main
February 22, 2026 05:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Replace RawTransformOptions' private oxc_resolver::Resolver with a
TsconfigFinder trait object backed by the main bundler resolver.
This eliminates a redundant resolver instance and shares the
find_tsconfig cache between module resolution and transformation,
avoiding duplicate directory walks when auto-discovering tsconfig.json.
The performance benefit depends on the project having tsconfig.json
files with auto-discovery enabled (the default). Projects without
tsconfig.json or using explicit tsconfig paths see no measurable
difference.
Verified against in-repo criterion benchmarks (threejs, threejs10x)
and external rolldown-benchmark/apps/10000: no statistically
significant change detected (criterion p > 0.3, hyperfine within
noise). These benchmarks either lack tsconfig.json files or use
explicit manual tsconfig paths, so the shared cache is not exercised.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Medium Risk
Touches tsconfig discovery/caching and how per-file transform options are derived, which can subtly affect builds in projects with multiple/edge-case
tsconfig.jsonlayouts. The change is mostly a refactor with the same discovery API, but it alters cache ownership and object lifetimes.Overview
Refactors transform-phase tsconfig discovery to reuse the main bundler resolver’s cached
find_tsconfigresults instead of constructing a separateoxc_resolver::ResolverinsideRawTransformOptions.Introduces a
TsconfigFindertrait (exported viarolldown_common) implemented byrolldown_resolver::Resolver, updatesRawTransformOptionsto hold anArc<dyn TsconfigFinder>, and wiresprepare_build_contextto pass the shared resolver intoTransformOptions::new_rawforTsConfig::Autoand referencedTsConfig::Manualcases.Written by Cursor Bugbot for commit 154a924. This will update automatically on new commits. Configure here.