feat: enable treeshake.commonjs by default#6072
Conversation
How to use the Graphite Merge QueueAdd the label graphite: merge 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. |
✅ Deploy Preview for rolldown-rs canceled.
|
c0dd0ef to
6658ff5
Compare
crates/rolldown/tests/esbuild/importstar/export_other_common_js/artifacts.snap
Show resolved
Hide resolved
crates/rolldown/tests/esbuild/importstar/export_other_nested_common_js/artifacts.snap
Show resolved
Hide resolved
...en_esm_and_cjs/esm_import_esm_which_export_all_from_multiple_cjs_named_import/artifacts.snap
Show resolved
Hide resolved
treeshake.commonjs by defaulttreeshake.commonjs by default
|
I marked the feature as a breaking change, since it may reduce some unnecessary cjs export for a pure rolldown user. |
Benchmarks Rust |
|
This comment is stale. |
I don't think this is a breaking change. When would reducing unnecessary cjs export be a problem? |
treeshake.commonjs by defaulttreeshake.commonjs by default
I still don't have a clear definition for |
3dd1948 to
eeff439
Compare
I think it is whether the user has to do something when this change is included. In this case, this should be a transparent optimization (assuming there's no bug), so I think it's fine to not mark it as an breaking change. If there's a code that relies on the fact that the value of |
Merge activity
|
eeff439 to
2ca48b4
Compare
## [1.0.0-beta.37] - 2025-09-10 ### 🚀 Features - partial align with const inline strategy with oxc in smart mode (#6126) by @IWANABETHATGUY - dev: use PathsMut for non-debounced RecommendedWatcher (#6120) by @sapphi-red - dev: return whether the build is already scheduled from `scheduleBuildIfStale` method (#6116) by @sapphi-red - handle errors from `BundlerBuilder#build` (#6104) by @shulaoda - add debounceTickRate option for debounced watchers (#6113) by @hyf0 - support full build in `incrementalBuild` mode (#6098) by @IWANABETHATGUY - add compare_contents_for_polling option to dev watcher (#6108) by @hyf0 - dev: add `scheduleBuildIfStale` method to DevEngine (#6087) by @sapphi-red - dev: return changed files in onHmrUpdates callback (#6086) by @sapphi-red - support function config with custom CLI arguments (#6076) by @IWANABETHATGUY - improve `MISSING_EXPORT` warning to suggest `type` modifier (#6085) by @sapphi-red - crates/rolldown_watcher: introduce `PathsMut` to batch watch/unwatch behaviors (#6075) by @hyf0 - enable `treeshake.commonjs` by default (#6072) by @IWANABETHATGUY - dev: add debounce control and PollWatcher support to DevWatchOptions (#6070) by @hyf0 ### 🐛 Bug Fixes - use kqueue for file watch on mac (#6124) by @sapphi-red - use patched notify for better file change event debouncing (#6125) by @sapphi-red - support passing all js primitive value for `alias` plugin (#6123) by @IWANABETHATGUY - track spans in member expression properties for accurate sourcemaps (#6100) by @IWANABETHATGUY - correctly handle inlined CommonJS exports in member expressions (#6090) by @IWANABETHATGUY - dev: ensure patch file names to be unique (#6096) by @sapphi-red - dev: normalize slash on Windows before comparing paths (#6095) by @sapphi-red - dev/watch: debounce duration should default to 10 (#6078) by @hyf0 ### 🚜 Refactor - simplify `__export` runtime helper to create target object internally (#6114) by @IWANABETHATGUY - simplify module_namespace construction second try (#6118) by @IWANABETHATGUY - simplify module_namespace construction (#5939) by @IWANABETHATGUY - optimize member expression creation in AstSnippet (#6091) by @IWANABETHATGUY - test-dev-server: sensible watcher configuration for CI env (#6077) by @hyf0 ### 🧪 Testing - dev: apply HMR edits on Windows (#6094) by @sapphi-red ### ⚙️ Miscellaneous Tasks - Revert "chore: adjust breaking change template of cliff (#6069)" (#6130) by @IWANABETHATGUY - test-dev-server: improve hmr test configuration (#6115) by @hyf0 - deps: update dependency rolldown-plugin-dts to v0.16.2 (#6128) by @renovate[bot] - Revert "refactor: simplify module_namespace construction (#5939)" (#6117) by @IWANABETHATGUY - test-dev-server: optimize test log output (#6107) by @hyf0 - enable compare_contents_for_polling and update poll interval for CI test-dev-server (#6110) by @hyf0 - deps: update dependency vite to v7.1.5 [security] (#6111) by @renovate[bot] - fix warnings reported by `just lint` (#6105) by @shulaoda - deps: update dependency tsdown to v0.15.0 (#6102) by @renovate[bot] - use debug builds for browser tests in CI (#6092) by @hyf0 - test-dev-server: update polling interval and add retry logic for CI tests (#6088) by @hyf0 - adjust breaking change template of cliff (#6069) by @IWANABETHATGUY ###◀️ Revert - "fix: replace_plugin does not work as expected with .ts config (#5920)" (#6074) by @IWANABETHATGUY Co-authored-by: Boshen <[email protected]>

Closed #6064