Skip to content

feat: support tsconfig loading & inputMap for transform#8180

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-02-feat_support_tsconfig_loading_inputmap_for_transform_
Feb 5, 2026
Merged

feat: support tsconfig loading & inputMap for transform#8180
graphite-app[bot] merged 1 commit intomainfrom
02-02-feat_support_tsconfig_loading_inputmap_for_transform_

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Feb 3, 2026

Improved transform & transformSync to receive tsconfig?: boolean | TsconfigRawOptions and inputMap?: SourceMap and tsconfigCache?: TSConfigCache.

This allows plugins to run the same transformation that is done internally by Rolldown so that you can use plugins that doesn't support TS & JSX internally (#4004).

Copy link
Member Author


How to use the Graphite Merge Queue

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

@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit d07abd0
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6984984b8a9f5500082df67f
😎 Deploy Preview https://deploy-preview-8180--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 3, 2026

Open in StackBlitz

@rolldown/browser

npm i https://pkg.pr.new/@rolldown/browser@8180

@rolldown/debug

npm i https://pkg.pr.new/@rolldown/debug@8180

@rolldown/pluginutils

npm i https://pkg.pr.new/@rolldown/pluginutils@8180

rolldown

npm i https://pkg.pr.new/rolldown@8180

@rolldown/binding-android-arm64

npm i https://pkg.pr.new/@rolldown/binding-android-arm64@8180

@rolldown/binding-darwin-arm64

npm i https://pkg.pr.new/@rolldown/binding-darwin-arm64@8180

@rolldown/binding-darwin-x64

npm i https://pkg.pr.new/@rolldown/binding-darwin-x64@8180

@rolldown/binding-freebsd-x64

npm i https://pkg.pr.new/@rolldown/binding-freebsd-x64@8180

@rolldown/binding-linux-arm-gnueabihf

npm i https://pkg.pr.new/@rolldown/binding-linux-arm-gnueabihf@8180

@rolldown/binding-linux-arm64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-gnu@8180

@rolldown/binding-linux-arm64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-musl@8180

@rolldown/binding-linux-x64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-gnu@8180

@rolldown/binding-linux-x64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-musl@8180

@rolldown/binding-openharmony-arm64

npm i https://pkg.pr.new/@rolldown/binding-openharmony-arm64@8180

@rolldown/binding-wasm32-wasi

npm i https://pkg.pr.new/@rolldown/binding-wasm32-wasi@8180

@rolldown/binding-win32-arm64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-arm64-msvc@8180

@rolldown/binding-win32-x64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-x64-msvc@8180

commit: bbff37b

@sapphi-red sapphi-red force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from e333a5a to 6682c9c Compare February 3, 2026 07:08
@sapphi-red sapphi-red force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from 6682c9c to 8bd5462 Compare February 3, 2026 07:54
@sapphi-red sapphi-red force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from 8bd5462 to 806d5fa Compare February 3, 2026 08:32
@sapphi-red sapphi-red force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from 806d5fa to 9c3041f Compare February 3, 2026 09:24
@sapphi-red sapphi-red force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from 9c3041f to e094474 Compare February 3, 2026 09:57
@sapphi-red sapphi-red force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from e094474 to cfa1306 Compare February 3, 2026 10:42
@sapphi-red sapphi-red marked this pull request as ready for review February 3, 2026 10:51
Copilot AI review requested due to automatic review settings February 3, 2026 10:51
@sapphi-red sapphi-red marked this pull request as draft February 3, 2026 10:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the transform and transformSync APIs to support tsconfig loading and input source maps, enabling plugins to use the same transformation logic as Rolldown's internal bundler. The implementation adds auto-discovery of tsconfig files, inline tsconfig options, and a caching mechanism for improved performance.

Changes:

  • Added enhanced transform APIs with tsconfig loading support (auto-discovery or inline configuration)
  • Introduced TsconfigCache class to optimize repeated tsconfig resolution across multiple transformations
  • Extended transform options to include inputMap, helpers, and improved TypeScript configuration support

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
packages/rolldown/tests/utils/transform.test.ts Comprehensive test suite covering basic transformation, tsconfig options, cache usage, and helper modes
packages/rolldown/tests/utils/fixtures/tsconfig.json Test fixture for tsconfig auto-discovery tests
packages/rolldown/tests/utils/fixtures/test1.ts Test fixture file with TypeScript code
packages/rolldown/src/utils/transform.ts TypeScript wrapper for enhanced transform APIs with error normalization
packages/rolldown/src/utils/error.ts Exported normalizeBindingError for use in transform utilities
packages/rolldown/src/experimental-index.ts Updated exports to use new enhanced transform API instead of old oxc_transform_napi exports
packages/rolldown/src/rolldown-binding.wasi.cjs Added TsconfigCache and enhanced transform function exports for WASI
packages/rolldown/src/rolldown-binding.wasi-browser.js Added TsconfigCache and enhanced transform function exports for WASI browser
packages/rolldown/src/binding.d.cts TypeScript type definitions for TsconfigCache, enhanced transform options and results
packages/rolldown/src/binding.cjs Added exports for TsconfigCache and enhanced transform functions
crates/rolldown_common/src/utils/mod.rs Module declaration for enhanced_transform
crates/rolldown_common/src/utils/enhanced_transform.rs Core transformation logic with tsconfig merging, AST parsing, and code generation
crates/rolldown_common/src/lib.rs Exported enhanced transform types and functions in bundler_options module
crates/rolldown_common/src/inner_bundler_options/types/transform_option/mod.rs Added helpers field and conversion implementations between TransformOptions and EnhancedTransformOptions
crates/rolldown_binding/src/utils/normalize_binding_transform_options.rs Added helpers option normalization from binding types
crates/rolldown_binding/src/types/binding_sourcemap.rs Added Clone derives for BindingSourcemap types
crates/rolldown_binding/src/transform_cache.rs TsconfigCache implementation with resolver and cache management
crates/rolldown_binding/src/transform.rs Enhanced transform functions (async and sync) with cache integration
crates/rolldown_binding/src/options/mod.rs Added binding_transform_options module export
crates/rolldown_binding/src/options/binding_transform_options.rs Binding types for enhanced transform options, results, and tsconfig configuration
crates/rolldown_binding/src/lib.rs Added transform and transform_cache module declarations
crates/rolldown_binding/Cargo.toml Added oxc_resolver and oxc_sourcemap dependencies
Cargo.lock Updated dependency lock file

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Benchmarks Rust

  • target: main(aba2dbb)
  • pr: 02-02-feat_support_tsconfig_loading_inputmap_for_transform_(600dbe6)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.01     74.8±1.47ms        ? ?/sec    1.00     74.2±2.53ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     81.3±1.82ms        ? ?/sec    1.01     82.3±2.01ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    107.5±4.81ms        ? ?/sec    1.01    108.4±2.32ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    117.7±2.13ms        ? ?/sec    1.02    119.8±1.81ms        ? ?/sec
bundle/bundle@threejs                                        1.00     38.5±2.18ms        ? ?/sec    1.00     38.4±2.13ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.01     43.0±0.64ms        ? ?/sec    1.00     42.5±0.64ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    383.1±3.15ms        ? ?/sec    1.01    386.3±3.93ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    441.0±3.92ms        ? ?/sec    1.01    446.6±5.41ms        ? ?/sec
scan/scan@rome_ts                                            1.03     86.3±1.88ms        ? ?/sec    1.00     83.8±2.13ms        ? ?/sec
scan/scan@threejs                                            1.03     29.6±1.61ms        ? ?/sec    1.00     28.6±0.37ms        ? ?/sec
scan/scan@threejs10x                                         1.01    295.6±4.75ms        ? ?/sec    1.00    293.5±3.53ms        ? ?/sec

@sapphi-red sapphi-red force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from cfa1306 to 2f0d785 Compare February 4, 2026 04:14
Copilot AI review requested due to automatic review settings February 4, 2026 06:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 8 comments.

@sapphi-red sapphi-red force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from 087af0f to 4473ebf Compare February 4, 2026 07:37
@socket-security
Copy link

socket-security bot commented Feb 4, 2026

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

Copilot AI review requested due to automatic review settings February 4, 2026 07:50
@sapphi-red sapphi-red force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from 4473ebf to 28ccfe0 Compare February 4, 2026 07:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 3 comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 4 comments.

@sapphi-red sapphi-red force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from 202653a to 600dbe6 Compare February 4, 2026 09:57
Copy link
Member

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sapphi-red Should we support it within oxc transform? It's also postive for migrating to oxc transform from esbuild.transfrm?

@sapphi-red
Copy link
Member Author

Personally I think this should live in Rolldown because it loads tsconfig and collapses sourcemaps. But not opposed to move the feature to oxc transform side. /cc @Boshen if you have any opinions

Copy link
Member

hyf0 commented Feb 5, 2026

Merge activity

Improved `transform` & `transformSync` to receive `tsconfig?: boolean | TsconfigRawOptions` and `inputMap?: SourceMap` and `tsconfigCache?: TSConfigCache`.

This allows plugins to run the same transformation that is done internally by Rolldown so that you can use plugins that doesn't support TS & JSX internally (#4004).
Copilot AI review requested due to automatic review settings February 5, 2026 13:16
@graphite-app graphite-app bot force-pushed the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch from 600dbe6 to d07abd0 Compare February 5, 2026 13:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@graphite-app graphite-app bot merged commit d07abd0 into main Feb 5, 2026
35 checks passed
@graphite-app graphite-app bot deleted the 02-02-feat_support_tsconfig_loading_inputmap_for_transform_ branch February 5, 2026 13:26
This was referenced Feb 11, 2026
shulaoda added a commit that referenced this pull request Feb 11, 2026
## [1.0.0-rc.4] - 2026-02-11

💡 Granular `comments` Option
- New `output.comments` option provides fine-grained control over comment preservation
- The `output.legalComments` option is now deprecated and use `comments.legal` instead

### 🚀 Features

- rename error name to `RolldownError` from `RollupError` (#8262) by @sapphi-red
- add hidden `resolve_tsconfig` function for Vite (#8257) by @sapphi-red
- rust: introduce `rolldown_watcher` (#8161) by @hyf0
- unify `comments` and `legalComments` into a single granular `comments` option (#8229) by @IWANABETHATGUY
- add builtin plugin for visualizing chunk graph (#8162) by @IWANABETHATGUY
- show import declaration location in AssignToImport errors (#8222) by @Copilot
- show import declaration span in CannotCallNamespace error (#8223) by @Copilot
- emit error when plugin accidentally removes runtime module symbols (#8203) by @IWANABETHATGUY
- support tsconfig loading & inputMap for `transform` (#8180) by @sapphi-red
- rolldown_plugin_vite_reporter: update warning message to link to Rolldown docs (#8205) by @sapphi-red

### 🐛 Bug Fixes

- avoid panic on untranspiled JSX syntax by reporting a diagnostic error (#8226) by @IWANABETHATGUY
- rolldown_plugin_vite_import_glob: relax absolute path check and improve invalid glob warning (#8219) by @shulaoda
- merge chunks after detect circular reference (#8154) by @IWANABETHATGUY
- rust: detect runtime module side effects based on its content (#8209) by @hyf0

### 🚜 Refactor

- rename `other` to `jsdoc` in comments options (#8256) by @IWANABETHATGUY
- rename chunk-visualize plugin with bundle-analyzer plugin (#8255) by @IWANABETHATGUY
- remove EXPORT_UNDEFINED_VARIABLE error (#8228) by @Copilot
- consolidate missing runtime symbol errors into a single diagnostic (#8220) by @IWANABETHATGUY
- stabilize `parse` and `parseSync` (#8215) by @sapphi-red
- return errors instead of panicking on builtin plugin conversion failure (#8217) by @shulaoda
- expose `parse` / `minify` / `transform` from `rolldown/utils` (#8214) by @sapphi-red
- prepare defer chunk merging (#8153) by @IWANABETHATGUY

### 📚 Documentation

- remove `<script>` escape behavior difference note from `platform` option (#8253) by @sapphi-red
- TypeScript & JSX support by plugins (#8183) by @sapphi-red

### 🧪 Testing

- ensure runtime module is preserved even if it's not used but has side effects (#8213) by @hyf0

### ⚙️ Miscellaneous Tasks

- deps: update oxc to v0.113.0 (#8267) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.12.0 (#8272) by @renovate[bot]
- deps: update oxc apps (#8269) by @renovate[bot]
- deps: update test262 submodule for tests (#8261) by @sapphi-red
- deps: update crate-ci/typos action to v1.43.4 (#8260) by @renovate[bot]
- deps: update dependency esbuild to v0.27.3 (#8250) by @renovate[bot]
- deps: update rust crates (#8244) by @renovate[bot]
- deps: update dependency semver to v7.7.4 (#8247) by @renovate[bot]
- deps: update github-actions (#8243) by @renovate[bot]
- deps: update npm packages (#8245) by @renovate[bot]
- deps: update oxc resolver to v11.17.1 (#8240) by @renovate[bot]
- deps: update rust crate oxc_sourcemap to v6.0.2 (#8241) by @renovate[bot]
- rust: handle ignored `RUSTSEC-2025-0141` cargo check error (#8235) by @hyf0
- deps: update dependency oxlint-tsgolint to v0.11.5 (#8233) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to ^0.22.0 (#8232) by @renovate[bot]
- deps: update crate-ci/typos action to v1.43.3 (#8225) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.9 (#8224) by @renovate[bot]
- deps: update crate-ci/typos action to v1.43.2 (#8212) by @renovate[bot]
- remove rolldown_plugin_vite_wasm_helper (#8207) by @shulaoda
- build docs for production (#8206) by @sapphi-red

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants