Skip to content

Comments

feat(tsconfig)!: enable auto-discovery by default#7817

Merged
shulaoda merged 1 commit intomainfrom
01-09-refactor_tsconfig_enable_auto-discovery_by_default
Jan 9, 2026
Merged

feat(tsconfig)!: enable auto-discovery by default#7817
shulaoda merged 1 commit intomainfrom
01-09-refactor_tsconfig_enable_auto-discovery_by_default

Conversation

@shulaoda
Copy link
Member

@shulaoda shulaoda commented Jan 9, 2026

This PR enables tsconfig auto-discovery by default, more details see https://rolldown.rs/options/tsconfig.

Breaking Changes

  • Default behavior changed: tsconfig now defaults to true (auto-discovery enabled)
  • Type signature changed: true | string → boolean | string
    • true: Enable auto-discovery (find nearest tsconfig.json per module)
    • false: Disable tsconfig resolution entirely
    • string: Explicit path to tsconfig

Migration Guide

If your project relies on the previous behavior (no tsconfig resolution):

// Before: implicit no tsconfig
export default {
  // tsconfig was undefined
}

// After: explicitly disable
export default {
  tsconfig: false
}

Warning

In monorepo projects, if a sub-package does not have its own tsconfig.json, auto-discovery may unexpectedly match the root tsconfig.json.

Copy link
Member Author

shulaoda commented Jan 9, 2026


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 Jan 9, 2026

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit fbd4cfc
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6960e5c25c5fa60007fba656
😎 Deploy Preview https://deploy-preview-7817--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.

@shulaoda shulaoda requested a review from sapphi-red January 9, 2026 09:46
@shulaoda shulaoda marked this pull request as ready for review January 9, 2026 09:46
Copilot AI review requested due to automatic review settings January 9, 2026 09:46
@shulaoda shulaoda force-pushed the 01-09-refactor_tsconfig_enable_auto-discovery_by_default branch from 50b73cf to 7262e82 Compare January 9, 2026 09:49
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 refactors the tsconfig option to enable auto-discovery by default, aligning with esbuild's behavior. The main change is converting the TsConfig enum from a unit variant Auto to a boolean variant Auto(bool), allowing users to explicitly enable (true), disable (false), or provide a path to a specific tsconfig file.

Key changes:

  • Changed TsConfig::Auto from a unit variant to Auto(bool) to support both enabling and disabling auto-discovery
  • Added Default implementation for TsConfig returning Auto(true) to enable auto-discovery by default
  • Updated type signatures from true | string to boolean | string in TypeScript and validation schemas
  • Fixed test configurations to either explicitly disable tsconfig (false) or specify custom tsconfig paths
  • Added empty tsconfig.json files to test directories to ensure consistent auto-discovery behavior

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/rolldown_common/src/inner_bundler_options/types/tsconfig.rs Refactored TsConfig enum from Auto unit variant to Auto(bool), removed custom serde deserialization, added Default implementation
crates/rolldown_resolver/src/resolver_config.rs Updated parameter type from Option<&TsConfig> to &TsConfig and adjusted matching logic to handle Auto(bool)
crates/rolldown_resolver/src/resolver.rs Updated parameter type from Option<&TsConfig> to &TsConfig
crates/rolldown_common/src/inner_bundler_options/types/transform_options.rs Updated matching logic to handle Auto(bool) variant
crates/rolldown_binding/src/utils/normalize_binding_options.rs Updated normalization to convert Either<bool, String> to TsConfig::Auto(bool) or TsConfig::Manual
crates/rolldown/src/utils/prepare_build_context.rs Added .unwrap_or_default() to apply default value when tsconfig is None, updated matching logic for Auto(bool)
packages/rolldown/src/options/input-options.ts Changed type from true | string to boolean | string and default from undefined to true
packages/rolldown/src/utils/validator.ts Updated validation schema from v.literal(true) to v.boolean()
docs/options/tsconfig.md Updated documentation to reflect new default value true and type boolean | string
crates/rolldown_testing/_config.schema.json Updated JSON schema to accept boolean instead of const: true
Test configuration files Added explicit tsconfig: false or custom tsconfig paths to tests that need specific behavior
Test tsconfig.json files Added tsconfig.json files to control useDefineForClassFields and provide fallback for auto-discovery
Snapshot files Updated snapshots to reflect changed compilation behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shulaoda shulaoda force-pushed the 01-09-refactor_tsconfig_enable_auto-discovery_by_default branch from 7262e82 to eab0747 Compare January 9, 2026 09:57
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.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 9, 2026

Merging this PR will degrade performance by 3.44%

Summary

❌ 2 regressed benchmarks
✅ 6 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
bundle@multi-duplicated-top-level-symbol-sourcemap 296.9 ms 306.2 ms -3.02%
bundle@multi-duplicated-top-level-symbol 265 ms 274.5 ms -3.44%

Comparing 01-09-refactor_tsconfig_enable_auto-discovery_by_default (fbd4cfc) with main (f4f0f5b)

Open in CodSpeed

@shulaoda shulaoda force-pushed the 01-09-refactor_tsconfig_enable_auto-discovery_by_default branch from eab0747 to 6efeb69 Compare January 9, 2026 10:11
@shulaoda shulaoda force-pushed the 01-09-refactor_tsconfig_enable_auto-discovery_by_default branch from 6efeb69 to e71d140 Compare January 9, 2026 10:13
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Benchmarks Rust

  • target: main(f4f0f5b)
  • pr: 01-09-refactor_tsconfig_enable_auto-discovery_by_default(fbd4cfc)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.12     74.1±1.59ms        ? ?/sec    1.00     65.9±2.13ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.15     80.6±3.00ms        ? ?/sec    1.00     70.0±1.73ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    105.7±2.60ms        ? ?/sec    1.00    105.7±1.79ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    118.4±2.12ms        ? ?/sec    1.00    118.1±1.80ms        ? ?/sec
bundle/bundle@threejs                                        1.04     39.0±2.55ms        ? ?/sec    1.00     37.4±0.62ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.01     43.0±0.64ms        ? ?/sec    1.00     42.7±0.71ms        ? ?/sec
bundle/bundle@threejs10x                                     1.02    389.2±5.45ms        ? ?/sec    1.00    382.1±8.26ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.03    452.6±5.31ms        ? ?/sec    1.00    441.4±3.94ms        ? ?/sec
scan/scan@rome_ts                                            1.00     83.0±1.83ms        ? ?/sec    1.00     83.3±1.49ms        ? ?/sec
scan/scan@threejs                                            1.03     28.7±0.45ms        ? ?/sec    1.00     27.8±0.36ms        ? ?/sec
scan/scan@threejs10x                                         1.04    298.9±4.91ms        ? ?/sec    1.00    287.3±3.82ms        ? ?/sec

Copilot AI review requested due to automatic review settings January 9, 2026 10:32
@shulaoda shulaoda force-pushed the 01-09-refactor_tsconfig_enable_auto-discovery_by_default branch from e71d140 to 5f0e44c Compare January 9, 2026 10:32
@shulaoda shulaoda requested a review from sapphi-red January 9, 2026 10: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 37 out of 37 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sapphi-red sapphi-red changed the title refactor(tsconfig)!: enable auto-discovery by default feat(tsconfig)!: enable auto-discovery by default Jan 9, 2026
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

The diff looks good to me. The CI is failing.
Would you update the PR description so that the users can understand what has changed?

@shulaoda shulaoda force-pushed the 01-09-refactor_tsconfig_enable_auto-discovery_by_default branch from 5f0e44c to fbd4cfc Compare January 9, 2026 11:25
@shulaoda shulaoda merged commit f750da2 into main Jan 9, 2026
36 checks passed
@shulaoda shulaoda deleted the 01-09-refactor_tsconfig_enable_auto-discovery_by_default branch January 9, 2026 11:38
This was referenced Jan 14, 2026
shulaoda added a commit that referenced this pull request Jan 14, 2026
## [1.0.0-beta.60] - 2026-01-14

### 💥 BREAKING CHANGES

- tsconfig: enable auto-discovery by default (#7817) by @shulaoda

### 🚀 Features

- distinguish transformer diagnostics from parse errors (#7872) by @shulaoda
- emit transformer warnings instead of ignoring them (#7850) by @shulaoda
- node: add `output.codeSplitting` option and deprecate `output.advancedChunks` (#7855) by @hyf0
- nativeMagicString reset (#7828) by @IWANABETHATGUY
- nativeMagicString lastChar (#7819) by @IWANABETHATGUY
- dev/lazy: inject lazy compilation runtime automatically (#7816) by @hyf0
- nativeMagicString snip (#7818) by @IWANABETHATGUY
- nativeMagicString construct with options (#7814) by @IWANABETHATGUY
- nativeMagicString clone (#7813) by @IWANABETHATGUY
- nativeMagicString `insert` (#7812) by @IWANABETHATGUY
- nativeMagicString `slice` (#7807) by @IWANABETHATGUY
- nativeMagicString trim methods (#7800) by @IWANABETHATGUY
- make closeBundle hook receive the last error (#7278) by @Copilot

### 🐛 Bug Fixes

- when package only contains export default, cjsDefault didn't resolve correctly (#7873) by @IWANABETHATGUY
- inline __name calls for default exports  (#7862) by @IWANABETHATGUY
- improve variable renaming to avoid unnecessary shadowing in nested scopes (#7859) by @IWANABETHATGUY
- use correct index when inserting keepNames statements during export default transformation (#7853) by @IWANABETHATGUY
- transform non-static dynamic imports when `dynamicImportInCjs` is `false` (#7823) by @shulaoda
- dev/lazy: should include imported and non-executed modules in the patch (#7815) by @hyf0
- set ExportsKind to Esm when json is none object literal  (#7808) by @IWANABETHATGUY
- nativeMagicString move api (#7796) by @IWANABETHATGUY
- remove unnecessary exports after merging into commong and user defined entry (#7789) by @IWANABETHATGUY
- use output.name instead of chunk.name in mixed export warning (#7788) by @Copilot

### 🚜 Refactor

- generalize ParseError to OxcError with dynamic EventKind (#7868) by @shulaoda
- rust: rename `advanced_chunks` to `manual_code_splitting` (#7856) by @hyf0
- string_wizard error hanlding (#7830) by @IWANABETHATGUY
- remove `experimental.disableLiveBindings` option (#7820) by @sapphi-red
- node/test: run fixture tests in concurrent (#7790) by @hyf0
- move ConfigExport and RolldownOptionsFunction types to define-config (#7799) by @shulaoda
- cli: validate config after resolving and improve error message (#7798) by @shulaoda

### 📚 Documentation

- rebrand (#7670) by @yyx990803
- fix incorrect default value for propertyReadSideEffects (#7847) by @Copilot
- remove options pages and redirect to reference pages (#7834) by @sapphi-red
- options: inline types to option property pages (#7831) by @sapphi-red
- options: port checks.pluginTimings content from options page to reference page (#7832) by @sapphi-red
- options: use `@linkcode` where possible (#7824) by @sapphi-red
- options: port content from options page to reference page (#7822) by @sapphi-red
- options: add descriptions for output options (#7821) by @sapphi-red
- options: add description for input options (#7802) by @sapphi-red
- options: add description for `checks.*` (#7801) by @sapphi-red
- apis: add hook graph (#7671) by @sapphi-red

### 🧪 Testing

- add all valid combination of chunk exports related test (#7851) by @IWANABETHATGUY
- enable MagicString test after api return type alignment (#7797) by @IWANABETHATGUY
- init magic-string test (#7794) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- vite-tests: configure git user for rebase operation (#7875) by @shulaoda
- rolldown_binding: remove v3 native plugins (#7837) by @shulaoda
- rolldown_binding: allow crate-type as lib (#7866) by @Brooooooklyn
- README.md: adjust position and size of rolldown logo (#7861) by @hyf0
- deps: update test262 submodule for tests (#7857) by @sapphi-red
- deps: update oxc to v0.108.0 (#7845) by @renovate[bot]
- deps: update dependency oxlint to v1.39.0 (#7849) by @renovate[bot]
- deps: update dependency oxfmt to ^0.24.0 (#7844) by @renovate[bot]
- deps: update npm packages (#7841) by @renovate[bot]
- deps: update rust crates (#7839) by @renovate[bot]
- deps: update github-actions (#7840) by @renovate[bot]
- use workspace edition for all crates (#7829) by @IWANABETHATGUY
- deps: update dependency oxlint-tsgolint to v0.11.0 (#7827) by @renovate[bot]
- deps: update napi to v3.8.2 (#7810) by @renovate[bot]
- remove outdated snapshot files (#7806) by @shulaoda
- deps: update crate-ci/typos action to v1.42.0 (#7792) by @renovate[bot]

Co-authored-by: shulaoda <[email protected]>
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.

2 participants