Skip to content

Comments

fix(tsconfig)!: enable project references support in manual mode#7545

Merged
shulaoda merged 2 commits intomainfrom
12-17-fix_tsconfig_enable_project_references_support_in_manual_mode
Dec 23, 2025
Merged

fix(tsconfig)!: enable project references support in manual mode#7545
shulaoda merged 2 commits intomainfrom
12-17-fix_tsconfig_enable_project_references_support_in_manual_mode

Conversation

@shulaoda
Copy link
Member

@shulaoda shulaoda commented Dec 17, 2025

closes #7177, closes #7354

Description

This PR enables TypeScript project references support in manual tsconfig mode, aligning Rolldown's behavior with Vite's auto-discovery mechanism.

Breaking Changes

Previous behavior (aligned with esbuild)

  • Project references were disabled in manual mode
  • include/exclude patterns were ignored
  • All files used the same tsconfig configuration

New behavior

If the tsconfig has references and certain conditions are met (the file extension is allowed and the tsconfig's include/exclude patterns don't match the file), then the referenced tsconfigs will be searched for a match. If no match is found, it falls back to the original tsconfig.

Copy link
Member Author

shulaoda commented Dec 17, 2025


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 Dec 17, 2025

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 42459f2
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/694a4631f16fb50008f23064
😎 Deploy Preview https://deploy-preview-7545--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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

Benchmarks Rust

  • target: main(f415e29)
  • pr: 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode(42459f2)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     58.7±1.67ms        ? ?/sec    1.11     64.9±1.70ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     64.2±1.08ms        ? ?/sec    1.06     67.9±1.90ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    100.5±1.45ms        ? ?/sec    1.05    105.1±2.96ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    114.1±2.48ms        ? ?/sec    1.02    116.3±1.40ms        ? ?/sec
bundle/bundle@threejs                                        1.00     39.3±2.23ms        ? ?/sec    1.01     39.8±1.27ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     42.2±0.63ms        ? ?/sec    1.02     43.2±0.63ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    377.9±3.08ms        ? ?/sec    1.02    385.7±6.30ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    446.0±4.14ms        ? ?/sec    1.01    450.4±3.60ms        ? ?/sec
scan/scan@rome_ts                                            1.03     81.1±2.14ms        ? ?/sec    1.00     78.9±1.07ms        ? ?/sec
scan/scan@threejs                                            1.00     26.8±0.37ms        ? ?/sec    1.01     27.1±0.32ms        ? ?/sec
scan/scan@threejs10x                                         1.02    283.4±6.31ms        ? ?/sec    1.00    278.7±2.87ms        ? ?/sec

@shulaoda shulaoda force-pushed the 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode branch 2 times, most recently from c4caea3 to 3ea8135 Compare December 18, 2025 20:14
@shulaoda shulaoda marked this pull request as ready for review December 18, 2025 20: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.

Pull request overview

This PR enables TypeScript project references support when using manual tsconfig mode. Previously, project references were disabled in manual mode, causing all files to use the same tsconfig settings. Now, when a manually specified tsconfig contains project references, each file will resolve its nearest appropriate tsconfig, allowing different files to have different configurations based on the project structure.

Key changes:

  • Enables automatic resolution of TypeScript project references in manual tsconfig mode
  • Adjusts the transform options creation logic to use Raw mode (per-file tsconfig resolution) when project references are detected
  • Updates test assertions to verify that different files use their respective tsconfig settings (different JSX factories)

Reviewed changes

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

File Description
packages/rolldown/tests/fixtures/tsconfig/manual/assert.mjs Updates test assertions to expect different behavior for bar and foo modules based on their respective tsconfig settings
crates/rolldown_resolver/src/resolver_config.rs Changes tsconfig references from Disabled to Auto for Manual mode to enable project references resolution
crates/rolldown_common/src/inner_bundler_options/types/transform_options.rs Adds TsConfig parameter to RawTransformOptions::new() and configures the resolver to handle project references in both Auto and Manual modes
crates/rolldown/src/utils/prepare_build_context.rs Implements conditional logic to use Raw mode transform options when a manual tsconfig has project references, otherwise uses Normal mode for better performance

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

@shulaoda shulaoda force-pushed the 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode branch from 3ea8135 to 50d8c62 Compare December 18, 2025 21:08
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.

@sapphi-red
Copy link
Member

I think we should clarify in the description of this PR what the breaking change is.

@hyf0 hyf0 assigned sapphi-red and unassigned shulaoda Dec 19, 2025
Copilot AI review requested due to automatic review settings December 23, 2025 07:09
@shulaoda shulaoda force-pushed the 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode branch from e6f9af5 to 9eaf5e5 Compare December 23, 2025 07:09
@shulaoda shulaoda force-pushed the 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode branch from 9eaf5e5 to 190f923 Compare December 23, 2025 07:12
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 5 out of 5 changed files in this pull request and generated 1 comment.


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

Co-authored-by: 翠 <[email protected]>
Signed-off-by: dalaoshu <[email protected]>
@shulaoda shulaoda force-pushed the 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode branch from 190f923 to 42459f2 Compare December 23, 2025 07:15
@shulaoda shulaoda requested a review from sapphi-red December 23, 2025 07:23
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 23, 2025

Merge activity

graphite-app bot pushed a commit that referenced this pull request Dec 23, 2025
closes #7177, closes #7354

### Description

This PR enables TypeScript project references support in manual tsconfig mode, aligning Rolldown's behavior with Vite's auto-discovery mechanism.

### Breaking Changes

#### Previous behavior (aligned with `esbuild`)
- Project `references` were disabled in manual mode
- `include`/`exclude` patterns were ignored
- All files used the same tsconfig configuration

#### New behavior
If the tsconfig has `references` and certain conditions are met (the file extension is allowed and the tsconfig's `include`/`exclude` patterns don't match the file), then the referenced tsconfigs will be searched for a match. If no match is found, it falls back to the original tsconfig.
@graphite-app graphite-app bot force-pushed the 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode branch from 42459f2 to 51d777d Compare December 23, 2025 07:32
@shulaoda shulaoda force-pushed the 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode branch from 51d777d to 42459f2 Compare December 23, 2025 07:33
graphite-app bot pushed a commit that referenced this pull request Dec 23, 2025
closes #7177, closes #7354

### Description

This PR enables TypeScript project references support in manual tsconfig mode, aligning Rolldown's behavior with Vite's auto-discovery mechanism.

### Breaking Changes

#### Previous behavior (aligned with `esbuild`)
- Project `references` were disabled in manual mode
- `include`/`exclude` patterns were ignored
- All files used the same tsconfig configuration

#### New behavior
If the tsconfig has `references` and certain conditions are met (the file extension is allowed and the tsconfig's `include`/`exclude` patterns don't match the file), then the referenced tsconfigs will be searched for a match. If no match is found, it falls back to the original tsconfig.
@graphite-app graphite-app bot force-pushed the 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode branch from 42459f2 to 1906252 Compare December 23, 2025 07:34
@shulaoda shulaoda force-pushed the 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode branch from 1906252 to 42459f2 Compare December 23, 2025 07:35
@shulaoda shulaoda merged commit fed98c2 into main Dec 23, 2025
73 of 86 checks passed
@shulaoda shulaoda deleted the 12-17-fix_tsconfig_enable_project_references_support_in_manual_mode branch December 23, 2025 07:42
This was referenced Dec 24, 2025
shulaoda added a commit that referenced this pull request Dec 24, 2025
## [1.0.0-beta.57] - 2025-12-24

✨ TypeScript Project References Support
- Rolldown now supports TypeScript project references when manually specifying a `tsconfig`
- See more details: https://rolldown.rs/options/tsconfig

💥 Rename `__export` to `__exportAll`
- Update `rolldown-plugin-dts` to the latest version for compatibility

### 💥 BREAKING CHANGES

- tsconfig: enable project references support in manual mode (#7545) by @shulaoda

### 🚀 Features

- add `CANNOT_CALL_NAMESPACE` warning (#7636) by @sapphi-red
- add import path for unresolved import diagnostics (#7625) by @sapphi-red
- optimize dynamic entry facade chunks by merging with common chunks when they are captured by common chunks (#7486) by @IWANABETHATGUY

### 🐛 Bug Fixes

- rename `__export` to `__exportAll` to be compatible with `cjs-module-lexer` (#7640) by @IWANABETHATGUY
- strip UTF-8 BOM when using text loader (#7635) by @sapphi-red
- rolldown_plugin_replace: avoid crashing with invalid delimiters (#7621) by @sapphi-red

### 🚜 Refactor

- export all filter functions (#7622) by @sxzz
- allow multiple help messages in diagnostics (#7624) by @sapphi-red

### 📚 Documentation

- add README.md to packages/rolldown (#7556) by @Copilot

### ⚡ Performance

- use fsevents on macOS for file watching (#7596) by @sapphi-red

### 🧪 Testing

- handle re-exports of external modules in CJS format (#7641) by @IWANABETHATGUY
- update integration to use vite's rolldown-canary branch (#7633) by @shulaoda

### ⚙️ Miscellaneous Tasks

- docs: fix Netlify ignore condition to detect docs changes across all PR commits (#7637) by @Copilot
- deps: update rollup submodule for tests to v4.54.0 (#7630) by @sapphi-red
- skip benchmarks for PRs with 'graphite: merge-when-ready' label (#7631) by @Boshen
- deps: update esbuild for tests to 0.27.2 (#7629) by @sapphi-red
- fix "update-test-dependencies" workflow (#7628) by @sapphi-red
- deps: update test262 submodule for tests (#7626) by @sapphi-red
- deps: update dependency oxlint to v1.35.0 (#7623) 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.

Improve the documentation for tsconfig options Path alias not resolved

2 participants