Skip to content

feat!: settings inlineConst: { mode: 'smart', pass: 1} by default#8444

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-24-feat_enable_inlineconst_by_default
Feb 26, 2026
Merged

feat!: settings inlineConst: { mode: 'smart', pass: 1} by default#8444
graphite-app[bot] merged 1 commit intomainfrom
02-24-feat_enable_inlineconst_by_default

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Feb 24, 2026

related to #7235

Copy link
Member Author

IWANABETHATGUY commented Feb 24, 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 Feb 24, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit caa971d
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69a03a7d721efb0008686a1c

@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-24-feat_enable_inlineconst_by_default branch 3 times, most recently from 115471d to 827f497 Compare February 25, 2026 14:44
@IWANABETHATGUY IWANABETHATGUY changed the base branch from main to graphite-base/8444 February 25, 2026 14:45
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-24-feat_enable_inlineconst_by_default branch from 827f497 to 2064450 Compare February 25, 2026 14:45
@IWANABETHATGUY IWANABETHATGUY changed the base branch from graphite-base/8444 to 02-25-fix_too_aggresive_cjs_mutation_bailout February 25, 2026 14:45
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-24-feat_enable_inlineconst_by_default branch from 2064450 to fa89fa5 Compare February 25, 2026 15:37
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-24-feat_enable_inlineconst_by_default branch from fa89fa5 to 84f3f34 Compare February 25, 2026 16:27
@graphite-app graphite-app bot changed the base branch from 02-25-fix_too_aggresive_cjs_mutation_bailout to graphite-base/8444 February 26, 2026 05:47
@graphite-app graphite-app bot force-pushed the 02-24-feat_enable_inlineconst_by_default branch from 84f3f34 to d7d0bd0 Compare February 26, 2026 05:59
@graphite-app graphite-app bot force-pushed the graphite-base/8444 branch from 2697f4a to eb77bc3 Compare February 26, 2026 05:59
@graphite-app graphite-app bot changed the base branch from graphite-base/8444 to main February 26, 2026 06:00
@graphite-app graphite-app bot force-pushed the 02-24-feat_enable_inlineconst_by_default branch from d7d0bd0 to ed1a048 Compare February 26, 2026 06:00
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-24-feat_enable_inlineconst_by_default branch from ed1a048 to 1932cb3 Compare February 26, 2026 09:18
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review February 26, 2026 09:21
@IWANABETHATGUY IWANABETHATGUY requested a review from hyf0 as a code owner February 26, 2026 09:21
Copilot AI review requested due to automatic review settings February 26, 2026 09:21
Copy link
Member Author

IWANABETHATGUY commented Feb 26, 2026

Merge activity

  • Feb 26, 9:22 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 26, 12:19 PM UTC: IWANABETHATGUY added this pull request to the Graphite merge queue.
  • Feb 26, 12:31 PM UTC: Merged by the Graphite merge queue.

@IWANABETHATGUY IWANABETHATGUY changed the title feat: enable inlineConst by default feat: settings inlineConst: { mode: 'smart', pass: 1} by default Feb 26, 2026
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 the inlineConst optimization by default in rolldown, changing it from disabled by default to using smart mode with 1 pass.

Changes:

  • Enabled inlineConst optimization by default with smart mode and 1 pass
  • Updated test configurations to explicitly disable inlineConst for rollup compatibility tests
  • Updated test fixtures and snapshots to reflect constant inlining behavior

Reviewed changes

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

Show a summary per file
File Description
crates/rolldown_common/src/inner_bundler_options/types/optimization.rs Changed default behavior to enable inlineConst with smart mode and 1 pass
packages/rolldown/src/options/input-options.ts Updated JSDoc default value from false to smart mode with 1 pass
packages/rollup-tests/test/**/*.js Added explicit inlineConst: false configuration for rollup test compatibility
packages/rolldown/tests/**/*.ts Added explicit inlineConst: false to various test configs
packages/rolldown/tests/**/artifacts.snap Updated snapshots showing inlined constant values
packages/rolldown/tests//.js Updated test fixtures to use functions instead of constants to prevent inlining
crates/rolldown/tests/**/*.snap Updated snapshot files reflecting constant inlining optimization
packages/rolldown/tests/fixtures/optimization/inline_const/cross_module_boolean/** Added new test case for cross-module boolean constant inlining
Files not reviewed (1)
  • crates/rolldown/tests/rolldown/function/advanced_chunks/split_node_modules/artifacts.snap: Language not supported

@shulaoda shulaoda changed the title feat: settings inlineConst: { mode: 'smart', pass: 1} by default feat!: settings inlineConst: { mode: 'smart', pass: 1} by default Feb 26, 2026
@github-actions
Copy link
Contributor

Benchmarks Rust

  • target: main(d1f7e79)
  • pr: 02-24-feat_enable_inlineconst_by_default(1932cb3)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.04     68.5±2.82ms        ? ?/sec    1.00     65.9±1.67ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.01     70.5±1.95ms        ? ?/sec    1.00     69.4±1.16ms        ? ?/sec
bundle/bundle@rome_ts                                        1.06    102.6±2.16ms        ? ?/sec    1.00     96.7±1.80ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.04    110.8±2.79ms        ? ?/sec    1.00    107.0±1.96ms        ? ?/sec
bundle/bundle@threejs                                        1.03     37.1±1.54ms        ? ?/sec    1.00     36.1±2.03ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.07     41.2±0.73ms        ? ?/sec    1.00     38.7±1.04ms        ? ?/sec
bundle/bundle@threejs10x                                     1.01    357.3±4.92ms        ? ?/sec    1.00    352.2±5.31ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.01    407.6±3.35ms        ? ?/sec    1.00    403.7±4.43ms        ? ?/sec
scan/scan@rome_ts                                            1.00     76.4±1.42ms        ? ?/sec    1.00     76.1±1.47ms        ? ?/sec
scan/scan@threejs                                            1.00     27.1±1.52ms        ? ?/sec    1.00     27.0±1.08ms        ? ?/sec
scan/scan@threejs10x                                         1.00    262.7±3.87ms        ? ?/sec    1.00    261.9±2.83ms        ? ?/sec

@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-24-feat_enable_inlineconst_by_default branch from 1932cb3 to 0d89919 Compare February 26, 2026 12:09
@graphite-app graphite-app bot force-pushed the 02-24-feat_enable_inlineconst_by_default branch from 0d89919 to caa971d Compare February 26, 2026 12:20
@graphite-app graphite-app bot merged commit caa971d into main Feb 26, 2026
34 checks passed
@graphite-app graphite-app bot deleted the 02-24-feat_enable_inlineconst_by_default branch February 26, 2026 12:31
This was referenced Mar 4, 2026
shulaoda added a commit that referenced this pull request Mar 5, 2026
## [1.0.0-rc.7] - 2026-03-05

⚡ Smarter Code Generation Defaults
- DCE-only minification and smart constant inlining are now enabled by default
- Produces cleaner, smaller output bundles without requiring explicit configuration

💡 LLM-Friendly Bundle Analyzer Reports
- New markdown output format for the bundle analyzer plugin with bundle summaries, module graphs, dependency chains, and optimization suggestions
- Optimization suggestions now also recommend using the entriesAware option when common chunks contain modules only reachable from specific entries


### 💥 BREAKING CHANGES

- enable minify: 'dce-only' by default (#8465) by @IWANABETHATGUY
- settings `inlineConst: { mode: 'smart', pass: 1}`  by default (#8444) by @IWANABETHATGUY

### 🚀 Features

- binding: add original getter to BindingMagicString (#8533) by @IWANABETHATGUY
- native-magic-string: add `offset` property support (#8531) by @IWANABETHATGUY
- add `output.strict` option to control `"use strict"` directive emission (#8489) by @Copilot
- watch: expose `watcher.compareContentsForPolling` (#8526) by @hyf0
- watch: use new watcher to support watch mode (#8475) by @hyf0
- rust/watch: handle bulk-change (#8466) by @hyf0
- add LLM-friendly markdown output format to bundle analyzer plugin (#8242) by @IWANABETHATGUY

### 🐛 Bug Fixes

- expose `plugins` on `NormalizedInputOptions` for `buildStart` hook (#8521) by @Copilot
- only uppercase facade symbols in JSX preserve mode (#8519) by @IWANABETHATGUY
- binding: export BindingResult in generated dts header (#8537) by @minsoo-web
- pre-resolve paths option to avoid `invoke_sync` deadlock (#8518) by @IWANABETHATGUY
- remove debug-only jsx_preset and UntranspiledSyntaxError (#8511) by @IWANABETHATGUY
- apply `topLevelVar` to exported `const`/`let` declarations (#8507) by @IWANABETHATGUY
- rolldown_plugin_vite_web_worker_post: avoid replacing `new.target` (#8488) by @sapphi-red
- update copyright year to 2026 (#8486) by @maciekzygmunt

### 🚜 Refactor

- rust: use Oxc's SymbolFlags::ConstVariable instead of custom IsConst flag (#8543) by @Dunqing
- rust: remove FacadeScoping, use Scoping::create_symbol for facade symbols (#8540) by @Dunqing
- rust/watch: remove hacky `reset_closed_for_watch_mode` (#8530) by @hyf0
- binding: return &str instead of String in filename() getter (#8534) by @IWANABETHATGUY
- rust: remove old watch mode implementation (#8525) by @hyf0
- rust/watch: simply watch logic in the binding layer (#8516) by @hyf0
- rust/watch: tweak struct/function names (#8464) by @hyf0

### 📚 Documentation

- explain how external modules work in rolldown (#8457) by @sapphi-red
- add some diagrams using graphviz (#8499) by @sapphi-red
- use `vitepress-plugin-graphviz` (#8498) by @sapphi-red
- list s390x/ppc64le prebuilt binaries (#8495) by @crusty-voidzero
- fix error type for `RolldownBuild.generate` and others (#8490) by @sapphi-red

### ⚡ Performance

- string_wizard: reduce allocations and add ASCII fast paths (#8541) by @IWANABETHATGUY
- use IndexBitSet to replace IndexVec<XXXIdx, bool> for module/stmt inclusion tracking (#8503) by @IWANABETHATGUY
- plugin: use IndexBitSet to optimize skipped plugins checking (#8497) by @ShroXd
- rust/tla: skip compute_tla if there is no module use TLA (#8487) by @ShroXd

### 🧪 Testing

- node/watch: make watch tests run in concurrent and retry-able (#8512) by @hyf0
- add test case for static flag tree-shaking (#8476) by @IWANABETHATGUY
- migrate post-banner sourcemap-with-shebang to Rust (#8477) by @Copilot

### ⚙️ Miscellaneous Tasks

- vscode: `formatOnSave` for markdown files using oxc formatter (#8536) by @minsoo-web
- deps: update test262 submodule for tests (#8528) by @sapphi-red
- remove `retry` workaround from output paths test fixtures (#8520) by @Copilot
- docs: add Shuyuan Wang (h-a-n-a) and remove from acknowledgements (#8509) by @Copilot
- consolidate top_level_var test cases using configVariants (#8508) by @IWANABETHATGUY
- add s390x and ppc64le linux gnu targets (#8493) by @Brooooooklyn

### ◀️ Revert

- fix(rolldown): increase tokio blocking threads size for watch mode (#8517) by @hyf0

### ❤️ New Contributors

* @minsoo-web made their first contribution in [#8536](#8536)
* @crusty-voidzero made their first contribution in [#8495](#8495)
* @maciekzygmunt made their first contribution in [#8486](#8486)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants