Skip to content

Comments

fix: jsx.preserve should also considering tsconfig json preserve#8324

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-13-fix_preset_should_also_considering_tsconfig_json_preserve
Feb 20, 2026
Merged

fix: jsx.preserve should also considering tsconfig json preserve#8324
graphite-app[bot] merged 1 commit intomainfrom
02-13-fix_preset_should_also_considering_tsconfig_json_preserve

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Feb 13, 2026

Previously, FlatOptions::JsxPreserve was determined once from the static bundler configuration (transform_options.is_jsx_preserve()). This didn't account for per-module tsconfig discovery — when a module's local tsconfig.json specifies "jsx": "preserve", the static flag wouldn't reflect it.

This PR determines preserve_jsx per-module during transformation by checking the resolved transform_options.jsx.jsx_plugin after tsconfig discovery, then updates FlatOptions::JsxPreserve on the module's context accordingly.

closed #8377

Copy link
Member Author

IWANABETHATGUY commented Feb 13, 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.

@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-13-fix_preset_should_also_considering_tsconfig_json_preserve branch from fba0584 to 0a8e0d9 Compare February 13, 2026 16:47
@graphite-app graphite-app bot changed the base branch from 02-13-fix_8318 to graphite-base/8324 February 14, 2026 01:53
@graphite-app graphite-app bot force-pushed the graphite-base/8324 branch from 50fe22f to efd34f0 Compare February 14, 2026 02:08
@graphite-app graphite-app bot force-pushed the 02-13-fix_preset_should_also_considering_tsconfig_json_preserve branch from 0a8e0d9 to 75c3e8f Compare February 14, 2026 02:08
@graphite-app graphite-app bot changed the base branch from graphite-base/8324 to main February 14, 2026 02:08
@graphite-app graphite-app bot force-pushed the 02-13-fix_preset_should_also_considering_tsconfig_json_preserve branch from 75c3e8f to 53e21e5 Compare February 14, 2026 02:09
@netlify
Copy link

netlify bot commented Feb 14, 2026

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 62fe92f
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6997bf22b0083f0008a60b4d
😎 Deploy Preview https://deploy-preview-8324--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.

@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-13-fix_preset_should_also_considering_tsconfig_json_preserve branch 6 times, most recently from 18e9fb3 to 4fa5faf Compare February 19, 2026 13:34
@IWANABETHATGUY IWANABETHATGUY changed the title fix: preset should also considering tsconfig json preserve fix: jsx.preserve should also considering tsconfig json preserve Feb 19, 2026
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-13-fix_preset_should_also_considering_tsconfig_json_preserve branch from 4fa5faf to ba580de Compare February 19, 2026 13:47
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review February 19, 2026 14:11
Copilot AI review requested due to automatic review settings February 19, 2026 14:11
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 fixes JSX preservation to respect per-module tsconfig.json settings rather than only using the global bundler configuration. Previously, modules with local tsconfig.json specifying "jsx": "preserve" would not have JSX preserved because the system only checked the static bundler config. Now, the JSX preserve flag is determined during module transformation by checking the resolved transform_options.jsx.jsx_plugin after tsconfig discovery.

Changes:

  • Determine JSX preservation per-module based on resolved tsconfig during transformation
  • Rename SymbolRefDb.is_jsx_preserve to has_module_preserve_jsx to reflect it's a fast-path optimization flag
  • Remove initialization of FlatOptions::JsxPreserve from global options; now set per-module in module view factory
  • Add integration test parser support for JSX syntax in output validation

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/rolldown/src/utils/pre_process_ecma_ast.rs Check resolved transform_options.jsx.jsx_plugin to determine preserve_jsx per-module
crates/rolldown/src/utils/parse_to_ecma_ast.rs Add preserve_jsx field to ParseToEcmaAstResult struct with documentation
crates/rolldown/src/ecmascript/ecma_module_view_factory.rs Set FlatOptions::JsxPreserve per-module in context based on resolved config
crates/rolldown_common/src/module_loader/task_result.rs Add preserve_jsx field to EcmaRelated struct
crates/rolldown_common/src/types/symbol_ref_db.rs Rename field and add getter/setter for has_module_preserve_jsx optimization flag
crates/rolldown_common/src/types/flat_options.rs Remove global initialization of JsxPreserve, add documentation explaining per-module determination
crates/rolldown/src/utils/renamer.rs Update to use renamed has_module_preserve_jsx() method
crates/rolldown/src/module_loader/module_loader.rs Remove parameter from SymbolRefDb::new(), track preserve_jsx from modules
crates/rolldown/src/stages/link_stage/reference_needed_symbols.rs Preserve has_module_preserve_jsx flag across parallel processing
crates/rolldown_testing/src/integration_test.rs Enable JSX parsing in output validation to handle preserved JSX
crates/rolldown/tests/rolldown/issues/8377/* New test case for JSX preservation via local tsconfig.json
crates/rolldown/tests/rolldown/issues/8216/* Updated test case now expects success instead of error
crates/rolldown/tests/snapshots/integration_rolldown__filename_with_hash.snap Snapshot updates for new test cases

@github-actions
Copy link
Contributor

Benchmarks Rust

  • target: main(af97066)
  • pr: 02-13-fix_preset_should_also_considering_tsconfig_json_preserve(ba580de)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.02     75.7±3.46ms        ? ?/sec    1.00     74.4±1.66ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     80.3±1.65ms        ? ?/sec    1.01     80.7±2.38ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    105.3±2.98ms        ? ?/sec    1.00    104.8±2.31ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    116.3±1.89ms        ? ?/sec    1.01    118.0±2.23ms        ? ?/sec
bundle/bundle@threejs                                        1.03     38.9±2.30ms        ? ?/sec    1.00     37.6±1.70ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.02     42.7±0.78ms        ? ?/sec    1.00     42.0±0.87ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    379.1±5.40ms        ? ?/sec    1.00    380.4±4.38ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    436.2±4.96ms        ? ?/sec    1.00    436.5±5.76ms        ? ?/sec
scan/scan@rome_ts                                            1.04     84.6±2.23ms        ? ?/sec    1.00     81.5±1.74ms        ? ?/sec
scan/scan@threejs                                            1.03     29.4±1.77ms        ? ?/sec    1.00     28.6±0.63ms        ? ?/sec
scan/scan@threejs10x                                         1.00    280.8±4.06ms        ? ?/sec    1.00    280.1±3.45ms        ? ?/sec

Copy link
Member Author

IWANABETHATGUY commented Feb 20, 2026

Merge activity

  • Feb 20, 1:55 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 20, 1:55 AM UTC: IWANABETHATGUY added this pull request to the Graphite merge queue.
  • Feb 20, 2:06 AM UTC: Merged by the Graphite merge queue.

…8324)

Previously, `FlatOptions::JsxPreserve` was determined once from the static bundler configuration (`transform_options.is_jsx_preserve()`). This didn't account for per-module tsconfig discovery — when a module's local `tsconfig.json` specifies `"jsx": "preserve"`, the static flag wouldn't reflect it.

This PR determines `preserve_jsx` per-module during transformation by checking the resolved `transform_options.jsx.jsx_plugin` after tsconfig discovery, then updates `FlatOptions::JsxPreserve` on the module's context accordingly.

closed #8377
@graphite-app graphite-app bot force-pushed the 02-13-fix_preset_should_also_considering_tsconfig_json_preserve branch from ba580de to 62fe92f Compare February 20, 2026 01:55
@graphite-app graphite-app bot merged commit 62fe92f into main Feb 20, 2026
34 checks passed
@graphite-app graphite-app bot deleted the 02-13-fix_preset_should_also_considering_tsconfig_json_preserve branch February 20, 2026 02:06
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.

[Bug]: UNTRANSPILED_SYNTAX happens for "jsx": "preserve" in tsconfig.json

2 participants