fix: invert __exportAll parameter logic to reduce default output size#8036
Merged
sapphi-red merged 5 commits intomainfrom Jan 24, 2026
Merged
fix: invert __exportAll parameter logic to reduce default output size#8036sapphi-red merged 5 commits intomainfrom
__exportAll parameter logic to reduce default output size#8036sapphi-red merged 5 commits intomainfrom
Conversation
✅ Deploy Preview for rolldown-rs canceled.
|
This reduces output code size for the default behavior by eliminating the second parameter in most cases. Now: - Default (no second param): Symbol.toStringTag is added - With `no_symbols=1`: Symbol.toStringTag is omitted Updated 166 test snapshots to reflect the change. Co-authored-by: sapphi-red <[email protected]>
Clippy prefers positive conditions over negative ones. Changed the condition from `if !symbols` to `if symbols` with swapped branches. Co-authored-by: sapphi-red <[email protected]>
Copilot
AI
changed the title
[WIP] Change output code condition for default behavior
Invert __exportAll parameter logic to reduce default output size
Jan 24, 2026
Member
|
@copilot update esbuild diff by |
The diff.md file has been updated to reflect the removal of the second parameter from __exportAll calls in the default case. Co-authored-by: sapphi-red <[email protected]>
Contributor
Author
__exportAll parameter logic to reduce default output size
Contributor
There was a problem hiding this comment.
Pull request overview
This PR inverts the semantics of the __exportAll helper’s second parameter so that the default (no second argument) now emits the Symbol.toStringTag = 'Module' marker, reducing default output size. The Rust code that generates __exportAll calls is updated to only pass the second parameter when symbols should be disabled, and all affected test snapshots and fixtures are adjusted accordingly.
Changes:
- Change
__exportAll(all, symbols)to__exportAll(all, no_symbols)and switch the logic to setSymbol.toStringTagwhen the second argument is absent or falsy. - Update
ScopeHoistingFinalizerto omit the second argument in the default “symbols enabled” case and only pass1whengenerated_code.symbolsisfalse, plus a small optimization for empty namespaces. - Refresh all impacted snapshots and one dev-server HMR fixture to reflect the new
__exportAllcalling convention and resulting output hashes.
Reviewed changes
Copilot reviewed 167 out of 168 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/test-dev-server/tests/fixtures/multiple-edits/src/main.js | Updates HMR expectation to include [Symbol.toStringTag]: 'Module' on hot-update export objects. |
| crates/rolldown/tests/snapshots/integration_rolldown__filename_with_hash.snap | Updates filename-hash snapshot mappings due to codegen changes from the new __exportAll behavior. |
| crates/rolldown/tests/rolldown/warnings/invalid_option/unsupported_inline_dynamic_format/artifacts.snap | Snapshot: drops the , 1 second argument from __exportAll to match new default-symbol semantics. |
| crates/rolldown/tests/rolldown/warnings/cannot_call_namespace/artifacts.snap | Snapshot: same __exportAll second-arg removal for warning fixture output. |
| crates/rolldown/tests/rolldown/tree_shaking/issue_4682/artifacts.snap | Snapshot: updates __exportAll({}) call (no second arg) for tree-shaking test. |
| crates/rolldown/tests/rolldown/tree_shaking/export_star/artifacts.snap | Snapshot: adjusts export-star wrapper to call __exportAll without the second parameter. |
| crates/rolldown/tests/rolldown/tree_shaking/commonjs_inline_const/artifacts.snap | Snapshot: removes second parameter from multiple __exportAll calls in CJS inline-const case. |
| crates/rolldown/tests/rolldown/tree_shaking/commonjs/artifacts.snap | Snapshot: same __exportAll API change applied to CJS tree-shaking outputs. |
| crates/rolldown/tests/rolldown/topics/tla/inline_dynamic_import/artifacts.snap | Snapshot: updates namespace-creation __exportAll calls (no second arg) in TLA+dynamic-import scenario. |
| crates/rolldown/tests/rolldown/topics/preserve_semantic_of_entries_exports/named_export_in_wrapped_cjs/artifacts.snap | Snapshot: __exportAll calls now omit second arg while preserving wrapped CJS semantics. |
| crates/rolldown/tests/rolldown/topics/preserve_semantic_of_entries_exports/named_export_in_wrapped_and_shared_entries/artifacts.snap | Snapshot: same __exportAll signature update for wrapped/shared entries. |
| crates/rolldown/tests/rolldown/topics/preserve_semantic_of_entries_exports/named_export_in_wrapped/artifacts.snap | Snapshot: adjusts wrapped entry export helper to new __exportAll behavior. |
| crates/rolldown/tests/rolldown/topics/live_bindings/default_export_snapshot_not_live/artifacts.snap | Snapshot: updates live-bindings helper object creation via __exportAll without second arg. |
| crates/rolldown/tests/rolldown/topics/keep_names/declaration2/artifacts.snap | Snapshot: same __exportAll change in keep-names test output. |
| crates/rolldown/tests/rolldown/topics/hmr/static_import/artifacts.snap | Snapshot: HMR static-import exports now use single-arg __exportAll. |
| crates/rolldown/tests/rolldown/topics/hmr/self-accept-within-circular/artifacts.snap | Snapshot: circular HMR modules’ export objects updated to new __exportAll semantics. |
| crates/rolldown/tests/rolldown/topics/hmr/runtime_correctness/artifacts.snap | Snapshot: multiple HMR runtime-correctness export wrappers updated for inverted second param. |
| crates/rolldown/tests/rolldown/topics/hmr/register_exports/artifacts.snap | Snapshot: register-exports HMR fixture updated to use one-arg __exportAll. |
| crates/rolldown/tests/rolldown/topics/hmr/non_used_export/artifacts.snap | Snapshot: removes , 1 from HMR exports in non-used-export scenario. |
| crates/rolldown/tests/rolldown/topics/hmr/no_boundary_reload/artifacts.snap | Snapshot: same __exportAll update for boundary-reload fixture. |
| crates/rolldown/tests/rolldown/topics/hmr/no-accept-outside-circular/artifacts.snap | Snapshot: circular HMR graph exports updated to new helper contract. |
| crates/rolldown/tests/rolldown/topics/hmr/mutiply_entires/artifacts.snap | Snapshot: HMR multiple-entry exports use single-arg __exportAll. |
| crates/rolldown/tests/rolldown/topics/hmr/issue_5159/artifacts.snap | Snapshot: adjusts __exportAll usage in HMR regression fixture for issue 5159. |
| crates/rolldown/tests/rolldown/topics/hmr/issue_5150/artifacts.snap | Snapshot: same __exportAll change in HMR fixture for issue 5150. |
| crates/rolldown/tests/rolldown/topics/hmr/issue_5149/artifacts.snap | Snapshot: same __exportAll change in HMR fixture for issue 5149. |
| crates/rolldown/tests/rolldown/topics/hmr/issue_4818/artifacts.snap | Snapshot: updates export wrappers for JSON+HMR test to omit the second arg. |
| crates/rolldown/tests/rolldown/topics/hmr/import_meta_hot_accept/artifacts.snap | Snapshot: many HMR accept-path exports updated to new __exportAll behavior. |
| crates/rolldown/tests/rolldown/topics/hmr/generate_patch_error/artifacts.snap | Snapshot: same change in generate-patch-error HMR fixture. |
| crates/rolldown/tests/rolldown/topics/hmr/export_star/artifacts.snap | Snapshot: HMR + export-star test now uses updated helper calls. |
| crates/rolldown/tests/rolldown/topics/hmr/esm_no_export/artifacts.snap | Snapshot: HMR ESM-with-no-exports namespace objects created with single-arg __exportAll. |
| crates/rolldown/tests/rolldown/topics/hmr/error_recovery/from_rebuild_syntax_error/artifacts.snap | Snapshot: error-recovery HMR fixtures updated for new helper semantics. |
| crates/rolldown/tests/rolldown/topics/hmr/error_recovery/from_initial_build_syntax_error/artifacts.snap | Snapshot: same for initial-build error-recovery fixture. |
| crates/rolldown/tests/rolldown/topics/hmr/dynamic_import/artifacts.snap | Snapshot: dynamic-import HMR scenario uses updated __exportAll calls. |
| crates/rolldown/tests/rolldown/topics/hmr/delete_file_used/artifacts.snap | Snapshot: delete-file-used HMR test updated for new export helper contract. |
| crates/rolldown/tests/rolldown/topics/hmr/delete_file_not_used_anymore/artifacts.snap | Snapshot: same change for delete-file-not-used-anymore case. |
| crates/rolldown/tests/rolldown/topics/hmr/cjs_no_export/artifacts.snap | Snapshot: CJS-with-no-export HMR case now emits single-arg __exportAll. |
| crates/rolldown/tests/rolldown/topics/hmr/change_accept/artifacts.snap | Snapshot: change-accept fixture updated for new helper behavior. |
| crates/rolldown/tests/rolldown/topics/hmr/add_watch_file/artifacts.snap | Snapshot: HMR add-watch-file test adjusted to omit second arg. |
| crates/rolldown/tests/rolldown/topics/hmr/accept-outside-circular/artifacts.snap | Snapshot: accept-outside-circular HMR fixtures updated to new __exportAll usage. |
| crates/rolldown/tests/rolldown/topics/generated_code/symbols_ns2/artifacts.snap | Snapshot: verifies Symbol.toStringTag semantics with updated __exportAll behavior. |
| crates/rolldown/tests/rolldown/topics/generated_code/symbols_ns/artifacts.snap | Snapshot: same-symbol semantics coverage for import namespace objects. |
| crates/rolldown/tests/rolldown/topics/generated_code/reexports_from_external_commonjs/artifacts.snap | Snapshot: external CJS reexports updated to call __exportAll without second param. |
| crates/rolldown/tests/rolldown/topics/generated_code/reexports_from_external/artifacts.snap | Snapshot: ES external reexports updated similarly. |
| crates/rolldown/tests/rolldown/topics/generated_code/reexports_esm_dynamic/artifacts.snap | Snapshot: dynamic reexports-from-ESM updated to no longer pass 1 to __exportAll. |
| crates/rolldown/tests/rolldown/topics/deconflict/wrapped_esm_export_named_function/artifacts.snap | Snapshot: deconflict-wrapped-ESM named export wrapper uses new helper contract. |
| crates/rolldown/tests/rolldown/topics/deconflict/wrapped_esm_default_function/artifacts.snap | Snapshot: same change for wrapped default function case. |
| crates/rolldown/tests/rolldown/semantic/export_star_from_external_as_wrapped_entry_cjs/artifacts.snap | Snapshot: wrapped CJS external export-star uses single-arg __exportAll. |
| crates/rolldown/tests/rolldown/semantic/export_star_from_external_as_wrapped_entry/artifacts.snap | Snapshot: ES external wrapped entry export-star updated similarly. |
| crates/rolldown/tests/rolldown/optimization/chunk_merging/issue_4905/artifacts.snap | Snapshot: chunk-merging regression fixture updated for default-symbol __exportAll. |
| crates/rolldown/tests/rolldown/optimization/chunk_merging/dynamic_entry_merged_in_user_defined_entry/artifacts.snap | Snapshot: same for dynamic entry merged into user entry. |
| crates/rolldown/tests/rolldown/optimization/chunk_merging/dynamic_entry_merged_in_common_chunk2/artifacts.snap | Snapshot: same for dynamic entry merged into common chunk output. |
| crates/rolldown/tests/rolldown/optimization/chunk_merging/allow_extension_exports/artifacts.snap | Snapshot: extension-exports chunk-merging output updated for helper change. |
| crates/rolldown/tests/rolldown/misc/wrapped_esm/artifacts.snap | Snapshot: large wrapped-ESM fixture updated to use new __exportAll semantics. |
| crates/rolldown/tests/rolldown/misc/reexport_star/artifacts.snap | Snapshot: reexport-star misc test updated accordingly. |
| crates/rolldown/tests/rolldown/misc/invalid_ident_repr/artifacts.snap | Snapshot: invalid-identifier repr case uses updated helper for default exports. |
| crates/rolldown/tests/rolldown/issues/rolldown_vite_289/artifacts.snap | Snapshot: regression for Vite issue 289 updated to reflect new namespace shape. |
| crates/rolldown/tests/rolldown/issues/7384/artifacts.snap | Snapshot: regression for issue 7384 updated (__exportAll of t namespace). |
| crates/rolldown/tests/rolldown/issues/7233_chain/artifacts.snap | Snapshot: regression for chained zod reexports updated to omit second arg. |
| crates/rolldown/tests/rolldown/issues/7233/artifacts.snap | Snapshot: same for primary 7233 fixture. |
| crates/rolldown/tests/rolldown/issues/7115/artifacts.snap | Snapshot: issue 7115 fixture updated to call runtime __exportAll with one arg. |
| crates/rolldown/tests/rolldown/issues/6992/artifacts.snap | Snapshot: issue 6992 (Sentry reexports) updated to use new helper contract. |
| crates/rolldown/tests/rolldown/issues/6943/artifacts.snap | Snapshot: issue 6943 fixture updated for tryPatchHandler export wrapper. |
| crates/rolldown/tests/rolldown/issues/6660/artifacts.snap | Snapshot: issue 6660 fixture updated where an async export is wrapped in __exportAll. |
| crates/rolldown/tests/rolldown/issues/6651/artifacts.snap | Snapshot: issue 6651 fixture updated for multi-export namespace object. |
| crates/rolldown/tests/rolldown/issues/5870/artifacts.snap | Snapshot: issue 5870 (constant export) updated twice for new semantics. |
| crates/rolldown/tests/rolldown/issues/4129/artifacts.snap | Snapshot: issue 4129 HMR+require fixture updated to use __exportAll({}). |
| crates/rolldown/tests/rolldown/issues/3650/artifacts.snap | Snapshot: cross-referencing module cycle fixture updated to new helper usage. |
| crates/rolldown/tests/rolldown/function/shim_missing_exports/basic_wrapped_esm/artifacts.snap | Snapshot: shim-missing-exports wrapped ESM now uses single-arg __exportAll. |
| crates/rolldown/tests/rolldown/function/inline_dynamic_imports/basic/artifacts.snap | Snapshot: inline dynamic-import fixture updated for new helper contract. |
| crates/rolldown/tests/rolldown/function/format/export_proto_namespace/artifacts.snap | Snapshot: __proto__-named export namespace uses updated semantics across formats. |
| crates/rolldown/tests/rolldown/function/external/splitting_indirect_external_symbol/artifacts.snap | Snapshot: splitting indirect external symbol fixture uses updated __exportAll. |
| crates/rolldown/tests/rolldown/function/external/double-namespace-reexport/artifacts.snap | Snapshot: double-namespace reexport fixtures updated for helper change. |
| crates/rolldown/tests/rolldown/function/external/commonjs_reexport_external/artifacts.snap | Snapshot: CJS reexport external fixture uses __exportAll({}) (no second arg). |
| crates/rolldown/tests/rolldown/function/export_mode/iife/named/artifacts.snap | Snapshot: named IIFE export mode uses updated helper call. |
| crates/rolldown/tests/rolldown/function/export_mode/iife/default/artifacts.snap | Snapshot: default IIFE export mode likewise updated. |
| crates/rolldown/tests/rolldown/function/export_mode/cjs/default/artifacts.snap | Snapshot: CJS default export wrapper uses single-arg __exportAll. |
| crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/issue_4636/artifacts.snap | Snapshot: strict-execution-order fixture updated. |
| crates/rolldown/tests/rolldown/function/experimental/attach_debug_info/eliminated_facade_chunk/artifacts.snap | Snapshot: eliminated-facade-chunk debug-info test updated for new symbols behavior. |
| crates/rolldown/tests/rolldown/function/advanced_chunks/split_node_modules/artifacts.snap | Snapshot: includes inlined updated runtime-base __exportAll implementation and hash changes. |
| crates/rolldown/tests/rolldown/dce/conditional_exports/artifacts.snap | Snapshot: conditional-exports DCE case uses new __exportAll default semantics. |
| crates/rolldown/tests/rolldown/code_splitting/issue_5276_2/artifacts.snap | Snapshot: code splitting issue 5276_2 updated for new helper calls. |
| crates/rolldown/tests/rolldown/code_splitting/issue_5276/artifacts.snap | Snapshot: primary issue 5276 fixtures updated (ESM and CJS variants). |
| crates/rolldown/tests/rolldown/code_splitting/issue_2786/artifacts.snap | Snapshot: shared-module and JSON/JS pair updated to use single-arg __exportAll. |
| crates/rolldown/tests/rolldown/code_splitting/format_cjs_with_esm_require_esm/artifacts.snap | Snapshot: CJS+ESM split case updated where ESM chunk calls helper with one arg. |
| crates/rolldown/tests/rolldown/code_splitting/dynamic_import_and_static_import_one_file/artifacts.snap | Snapshot: mixed dynamic+static import case updated. |
| crates/rolldown/tests/rolldown/cjs_compat/require_call_expr_unused/artifacts.snap | Snapshot: CJS-compat require-call-unused fixture updated for __exportAll. |
| crates/rolldown/tests/rolldown/cjs_compat/require/require_esm/artifacts.snap | Snapshot: require-ESM compat case updated to use __exportAll({}). |
| crates/rolldown/tests/rolldown/cjs_compat/reexports_from_cjs/artifacts.snap | Snapshot: CJS reexports fixture updated similarly. |
| crates/rolldown/tests/rolldown/cjs_compat/reexport_commonjs/artifacts.snap | Snapshot: reexport-commonjs fixture updated. |
| crates/rolldown/tests/rolldown/cjs_compat/partial_cjs_ns_merge_2/artifacts.snap | Snapshot: partial namespace-merge test updated to wrap default export with new helper. |
| crates/rolldown/tests/rolldown/cjs_compat/optimize_interop_default_with_cjs_bailout/artifacts.snap | Snapshot: interop-default optimization bailout scenario updated. |
| crates/rolldown/tests/rolldown/cjs_compat/node_module_commonjs/artifacts.snap | Snapshot: CJS node_module compatibility fixture updated. |
| crates/rolldown/tests/rolldown/cjs_compat/module.exports_export/with_default/artifacts.snap | Snapshot: module.exports + default export compat fixture updated. |
| crates/rolldown/tests/rolldown/cjs_compat/module.exports_export/priority/artifacts.snap | Snapshot: priority resolution between exports and module.exports updated. |
| crates/rolldown/tests/rolldown/cjs_compat/module.exports_export/fallback/artifacts.snap | Snapshot: fallback behavior fixture updated. |
| crates/rolldown/tests/rolldown/cjs_compat/module.exports_export/basic/artifacts.snap | Snapshot: basic module.exports export compat test updated. |
| crates/rolldown/tests/rolldown/cjs_compat/issue_7634/artifacts.snap | Snapshot: issue 7634 CJS compat case updated. |
| crates/rolldown/tests/rolldown/cjs_compat/import_reexport_between_esm_and_cjs/esm_import_esm_which_export_all_from_multiple_cjs_named_import/artifacts.snap | Snapshot: ESM-import-ESM-from-multiple-CJS fixture updated to use __exportAll({}). |
| crates/rolldown/tests/rolldown/cjs_compat/import_reexport_between_esm_and_cjs/esm_import_esm_which_export_all_from_cjs_named_import/artifacts.snap | Snapshot: similar update for single CJS export-all case. |
| crates/rolldown/tests/rolldown/cjs_compat/exoprt_star_of_cjs/artifacts.snap | Snapshot: export-star-of-CJS fixture updated for empty and chained namespaces. |
| crates/rolldown/tests/rolldown/cjs_compat/esm_require_esm_unused/artifacts.snap | Snapshot: ESM-required-but-unused fixture updated. |
| crates/rolldown/tests/rolldown/cjs_compat/esm_require_esm/artifacts.snap | Snapshot: direct ESM-require fixture updated for helper semantics. |
| crates/rolldown/tests/rolldown/cjs_compat/basic_commonjs/artifacts.snap | Snapshot: basic CJS interop fixture updated for __exportAll. |
| crates/rolldown/tests/esbuild/ts/ts_import_equals_undefined_import/artifacts.snap | Snapshot: TS import = fixture namespace wrapper updated. |
| crates/rolldown/tests/esbuild/ts/ts_export_missing_es6/artifacts.snap | Snapshot: TS export-missing fixture updated. |
| crates/rolldown/tests/esbuild/ts/export_type_issue379/artifacts.snap | Snapshot: TS export-type issue coverage updated for helper behavior. |
| crates/rolldown/tests/esbuild/splitting/splitting_missing_lazy_export/artifacts.snap | Snapshot: splitting missing-lazy-export fixture uses __exportAll({}). |
| crates/rolldown/tests/esbuild/splitting/splitting_hybrid_esm_and_cjs_issue617/artifacts.snap | Snapshot: hybrid ESM+CJS splitting fixture updated. |
| crates/rolldown/tests/esbuild/splitting/splitting_dynamic_and_not_dynamic_es6_into_es6/artifacts.snap | Snapshot: dynamic+non-dynamic split ES6 fixture updated. |
| crates/rolldown/tests/esbuild/splitting/edge_case_issue2793_without_splitting/artifacts.snap | Snapshot: edge-case 2793 fixture updated where namespace export aggregates classes. |
| crates/rolldown/tests/esbuild/packagejson/package_json_dual_package_hazard_require_only/artifacts.snap | Snapshot: dual-package hazard (require-only) fixture updated for module wrapper. |
| crates/rolldown/tests/esbuild/packagejson/package_json_dual_package_hazard_import_and_require_separate_files/artifacts.snap | Snapshot: import+require separate-files fixture updated. |
| crates/rolldown/tests/esbuild/packagejson/package_json_dual_package_hazard_import_and_require_same_file/artifacts.snap | Snapshot: same-file variant updated. |
| crates/rolldown/tests/esbuild/packagejson/package_json_dual_package_hazard_import_and_require_implicit_main_force_module_before_main/artifacts.snap | Snapshot: implicit-main with forced module resolution updated. |
| crates/rolldown/tests/esbuild/packagejson/package_json_dual_package_hazard_import_and_require_implicit_main/artifacts.snap | Snapshot: implicit-main baseline fixture updated. |
| crates/rolldown/tests/esbuild/packagejson/package_json_dual_package_hazard_import_and_require_force_module_before_main/artifacts.snap | Snapshot: explicit force-module fixture updated. |
| crates/rolldown/tests/esbuild/packagejson/package_json_dual_package_hazard_import_and_require_browser/artifacts.snap | Snapshot: browser-field variant updated for module wrapper. |
| crates/rolldown/tests/esbuild/loader/loader_json_invalid_identifier_es6/artifacts.snap | Snapshot: JSON loader invalid-identifier export wrapper updated. |
| crates/rolldown/tests/esbuild/loader/empty_loader_js/artifacts.snap | Snapshot: empty JS loader fixture now uses __exportAll({}). |
| crates/rolldown/tests/esbuild/importstar_ts/ts_import_star_export_star_capture/artifacts.snap | Snapshot: TS import-star/export-star capture fixture updated. |
| crates/rolldown/tests/esbuild/importstar_ts/ts_import_star_export_star_as_capture/artifacts.snap | Snapshot: TS import-star/export-star-as capture fixture updated. |
| crates/rolldown/tests/esbuild/importstar_ts/ts_import_star_export_import_star_capture/artifacts.snap | Snapshot: TS import-star/export-import-star capture fixture updated. |
| crates/rolldown/tests/esbuild/importstar_ts/ts_import_star_capture/artifacts.snap | Snapshot: TS import-star-capture fixture updated. |
| crates/rolldown/tests/esbuild/importstar_ts/ts_import_star_and_common_js/artifacts.snap | Snapshot: TS import-star plus CJS fixture updated for helper call. |
| crates/rolldown/tests/esbuild/importstar/re_export_star_entry_point_and_inner_file/artifacts.snap | Snapshot: ES import-star re-export entry and inner file fixture updated. |
| crates/rolldown/tests/esbuild/importstar/re_export_other_file_import_export_self_as_namespace_es6/artifacts.snap | Snapshot: import-export-self-as-namespace fixture updated. |
| crates/rolldown/tests/esbuild/importstar/re_export_other_file_export_self_as_namespace_es6/artifacts.snap | Snapshot: export-self-as-namespace fixture updated. |
| crates/rolldown/tests/esbuild/importstar/re_export_namespace_import_missing_es6/artifacts.snap | Snapshot: namespace-import missing fixture updated. |
| crates/rolldown/tests/esbuild/importstar/namespace_import_re_export_star_missing_es6/artifacts.snap | Snapshot: namespace import re-export-star missing fixture updated. |
| crates/rolldown/tests/esbuild/importstar/namespace_import_missing_es6/artifacts.snap | Snapshot: namespace-import-missing fixture updated. |
| crates/rolldown/tests/esbuild/importstar/issue176/artifacts.snap | Snapshot: issue 176 import-star fixture updated. |
| crates/rolldown/tests/esbuild/importstar/import_star_of_export_star_as/artifacts.snap | Snapshot: import-star-of-export-star-as fixture updated. |
| crates/rolldown/tests/esbuild/importstar/import_star_export_star_omit_ambiguous/artifacts.snap | Snapshot: omit-ambiguous export-star fixture updated. |
| crates/rolldown/tests/esbuild/importstar/import_star_export_star_capture/artifacts.snap | Snapshot: export-star capture fixture updated. |
| crates/rolldown/tests/esbuild/importstar/import_star_export_star_as_capture/artifacts.snap | Snapshot: export-star-as capture fixture updated. |
| crates/rolldown/tests/esbuild/importstar/import_star_export_import_star_capture/artifacts.snap | Snapshot: export-import-star capture fixture updated. |
| crates/rolldown/tests/esbuild/importstar/import_star_capture/artifacts.snap | Snapshot: import-star capture fixture updated. |
| crates/rolldown/tests/esbuild/importstar/import_star_and_common_js/artifacts.snap | Snapshot: import-star plus CJS fixture updated. |
| crates/rolldown/tests/esbuild/importstar/import_export_self_as_namespace_es6/artifacts.snap | Snapshot: import/export-self-as-namespace fixture updated. |
| crates/rolldown/tests/esbuild/importstar/export_self_as_namespace_es6/artifacts.snap | Snapshot: export-self-as-namespace ES fixture updated. |
| crates/rolldown/tests/esbuild/importstar/export_self_as_namespace_common_js/artifacts.snap | Snapshot: same for CommonJS. |
| crates/rolldown/tests/esbuild/importstar/export_self_and_require_self_common_js/artifacts.snap | Snapshot: export-self-and-require-self CJS fixture updated. |
| crates/rolldown/tests/esbuild/importstar/export_self_and_import_self_common_js/artifacts.snap | Snapshot: export-self-and-import-self CJS fixture updated. |
| crates/rolldown/tests/esbuild/default/top_level_await_forbidden_require_dead_branch/artifacts.snap | Snapshot: TLA forbidden-require dead-branch output uses __exportAll({}). |
| crates/rolldown/tests/esbuild/default/top_level_await_forbidden_require/artifacts.snap | Snapshot: TLA forbidden-require non-dead-branch scenario updated similarly. |
| crates/rolldown/tests/esbuild/default/top_level_await_allowed_import_without_splitting/artifacts.snap | Snapshot: TLA allowed-import-without-splitting scenario updated. |
| crates/rolldown/tests/esbuild/default/this_with_es6_syntax/artifacts.snap | Snapshot: this-with-ES6-syntax fixture updated export wrapper. |
| crates/rolldown/tests/esbuild/default/minified_exports_and_module_format_common_js/artifacts.snap | Snapshot: minified exports+CommonJS module format fixture updated. |
| crates/rolldown/tests/esbuild/default/mangle_props_import_export_bundled/artifacts.snap | Snapshot: mangle-props import/export bundled fixture updated. |
| crates/rolldown/tests/esbuild/default/import_missing_neither_es6_nor_common_js/artifacts.snap | Snapshot: import-missing-neither-ESM-nor-CJS fixture updated to use __exportAll({}). |
| crates/rolldown/tests/esbuild/default/forbid_string_export_names_bundle/artifacts.snap | Snapshot: forbid-string-export-names fixture updated. |
| crates/rolldown/tests/esbuild/default/external_es6_converted_to_common_js/diff.md | Documentation diff: shows how generated code changed from two-arg to one-arg __exportAll. |
| crates/rolldown/tests/esbuild/default/external_es6_converted_to_common_js/artifacts.snap | Snapshot: external ES6 converted to CJS fixture updated for new helper contract. |
| crates/rolldown/tests/esbuild/default/exports_and_module_format_common_js/artifacts.snap | Snapshot: exports-and-module-format CJS fixture updated. |
| crates/rolldown/tests/esbuild/default/export_special_name_bundle/artifacts.snap | Snapshot: export of special name (__proto__) updated for new helper. |
| crates/rolldown/tests/esbuild/default/export_forms_with_minify_identifiers_and_no_bundle/artifacts.snap | Snapshot: export-forms-with-minify (no bundle) fixture updated. |
| crates/rolldown/tests/esbuild/default/export_forms_iife/artifacts.snap | Snapshot: IIFE export forms fixture updated. |
| crates/rolldown/tests/esbuild/default/export_forms_es6/artifacts.snap | Snapshot: ES6 export forms fixture updated. |
| crates/rolldown/tests/esbuild/default/export_forms_common_js/artifacts.snap | Snapshot: CommonJS export forms fixture updated throughout. |
| crates/rolldown/tests/esbuild/default/empty_export_clause_bundle_as_common_js_issue910/artifacts.snap | Snapshot: empty export clause CJS bundle updated to use __exportAll({}). |
| crates/rolldown/tests/esbuild/default/common_js_from_es6/artifacts.snap | Snapshot: CJS-from-ES6 fixture updated. |
| crates/rolldown/tests/esbuild/default/bundle_esm_with_nested_var_issue4348/artifacts.snap | Snapshot: nested-var bundle fixture updated for multi-export namespace helper. |
| crates/rolldown/tests/esbuild/dce/tree_shaking_in_esm_wrapper/artifacts.snap | Snapshot: DCE in ESM wrapper fixture updated export wrapper. |
| crates/rolldown/tests/esbuild/dce/package_json_side_effects_false_keep_star_import_es6/artifacts.snap | Snapshot: package.json side-effects keep-star-import fixture updated. |
| crates/rolldown/tests/esbuild/dce/package_json_side_effects_false_keep_bare_import_and_require_es6/artifacts.snap | Snapshot: same for bare import+require case. |
| crates/rolldown/src/runtime/runtime-base.js | Changes __exportAll to accept no_symbols and inverts logic so the default (no 2nd arg) sets Symbol.toStringTag = 'Module'. |
| crates/rolldown/src/module_finalizers/mod.rs | Updates namespace-object generation to omit the second argument when symbols are enabled and only pass 1 (disable symbols) when generated_code.symbols is false, plus uses {} instead of __exportAll({}) when there are no exports and symbols are disabled. |
Files not reviewed (1)
- crates/rolldown/tests/rolldown/function/advanced_chunks/split_node_modules/artifacts.snap: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Benchmarks Rust |
IWANABETHATGUY
approved these changes
Jan 24, 2026
Merged
shulaoda
added a commit
that referenced
this pull request
Jan 28, 2026
## [1.0.0-rc.2] - 2026-01-28
⚡ Lazy Barrel Optimization
- Skips compilation of unused re-export modules in side-effect-free barrel modules
- Particularly beneficial for projects importing from large component libraries
For large component libraries like Ant Design, when you import just one component:
```js
import { Button } from 'antd';
Button;
```
| Metric | Without lazy barrel | With lazy barrel |
| -------------------- | --------------------- | ---------------- |
| Modules compiled | 2986 | 250 |
| Build time | ~210ms | ~50ms |
By enabling lazy barrel, Rolldown reduces the number of compiled modules by 90% and speeds up the build by 2-4x.
Enable it in your config:
```js
export default {
experimental: {
lazyBarrel: true,
},
};
```
For more details, see the https://rolldown.rs/in-depth/lazy-barrel-optimization
### 💥 BREAKING CHANGES
- expose `\0rolldown/runtime` in transform hook (#8068) by @hyf0
- rename `rolldown:runtime` to `\0rolldown/runtime.js` (#8067) by @hyf0
### 🚀 Features
- remove inlined constants in smart mode (#8085) by @sapphi-red
- allow more options for `this.emitFile` with `type: 'prebuilt-chunk'` (#8062) by @sapphi-red
- warn when both code and postBanner contain shebang (#8039) by @Copilot
### 🐛 Bug Fixes
- update the links to Rolldown docs in the error messages (#8103) by @sapphi-red
- handle tsconfig.json load errors (#8105) by @sapphi-red
- include inlined constants in namespace object (#8099) by @sapphi-red
- vite test ci (#8084) by @IWANABETHATGUY
- renamer: nested binding shadowing external module namespace in UMD/IIFE formats (#8083) by @Dunqing
- deduplicate ESM chunk imports by canonical symbol (#8059) by @IWANABETHATGUY
- refine side-effect detection for BigInt and RegExp (#8060) by @IWANABETHATGUY
- rust: use string literal span for `new URL` error diagnostic (#8043) by @valadaptive
- rust: use ModuleType::Asset for `new URL` imports (#8035) by @valadaptive
- CJS-ESM interop - property assignment on CJS module exports (#8006) by @IWANABETHATGUY
- eliminate the facade chunk if the dynamic entry module has been merged into common chunk (#8046) by @IWANABETHATGUY
- Inlining dynamic imports broken with multiple entry points (#8037) by @IWANABETHATGUY
- devtools: revert `Chunk#id` to `Chunk#chunk_id` (#8040) by @hyf0
- invert `__exportAll` parameter logic to reduce default output size (#8036) by @Copilot
- `</script` tag search should be case insensitive (#8033) by @IWANABETHATGUY
- use directory name as-is for the variable name even if the name contained `.` (#8029) by @Copilot
- dev/lazy: remove unnecessary rewrite from top level `this` to `undefined` (#8020) by @hyf0
- dev/lazy: should keep lazy entries imports for patch file (#8019) by @hyf0
- `output.generatedCode.preset: 'es2015'` was not set by default (#8026) by @sapphi-red
- node: align option validator to types (#8023) by @sapphi-red
- node: allow `output.strictExecutionOrder` by the option validator (#8022) by @sapphi-red
- types: return `this` from on / off methods of `RolldownWatcher` (#8015) by @sapphi-red
### 🚜 Refactor
- rolldown_plugin_vite_dynamic_import_vars: remove v1 implementation (#8096) by @shulaoda
- rolldown_plugin_vite_import_glob: remove v1 implementation (#8095) by @shulaoda
- lazy-barrel: restructure lazy barrel implementation (#8070) by @shulaoda
- remove `use_built_ins` and `use_spread` from internal JSX options (#8079) by @sapphi-red
- remove `experimental.transformHiresSourcemap` (#8055) by @Copilot
- rust: use `is_data_url` more consistently (#8042) by @valadaptive
- use `FxIndexMap` to store EntryPoint (#8032) by @IWANABETHATGUY
- node: add type checks that ensures validator schema is up to date with types (#8024) by @sapphi-red
### 📚 Documentation
- link to vite plugin registry (#8086) by @sapphi-red
- lazy-barrel: improve documentation and enable in sidebar (#8072) by @shulaoda
- add more examples and details (#8054) by @sapphi-red
- in-depth: add dead code elimination page (#8007) by @sapphi-red
- update status from beta to release candidate (#8012) by @shulaoda
### ⚡ Performance
- run inline-const pass for modules that are affected by inlining (#8064) by @sapphi-red
### 🧪 Testing
- lazy-barrel: use package.json sideEffects instead of plugin hook (#8077) by @shulaoda
- lazy-barrel: enable tests and add treeshake-behavior cases (#8071) by @shulaoda
### ⚙️ Miscellaneous Tasks
- deps: update crate-ci/typos action to v1.42.3 (#8087) by @renovate[bot]
- deps: update rollup submodule for tests to v4.56.0 (#8073) by @sapphi-red
- deps: update oxc to v0.111.0 (#8063) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.6 (#8076) by @renovate[bot]
- deps: update test262 submodule for tests (#8074) by @sapphi-red
- deps: update crate-ci/typos action to v1.42.2 (#8069) by @renovate[bot]
- deps: update oxc apps (#8066) by @renovate[bot]
- remove `{@include ./foo.md}` from d.ts files (#8056) by @sapphi-red
- deps: update dependency oxlint-tsgolint to v0.11.2 (#8057) by @renovate[bot]
- deps: update github-actions (#8050) by @renovate[bot]
- deps: update npm packages (#8051) by @renovate[bot]
- deps: update rust crates (#8049) by @renovate[bot]
- debug: add IdxExt debug trait for human-readable index debugging (#8045) by @IWANABETHATGUY
- deps: update dependency rolldown-plugin-dts to v0.21.5 (#8034) by @renovate[bot]
- deps: update oxc resolver to v11.16.4 (#8031) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.4 (#8030) by @renovate[bot]
- deps: update dependency rust to v1.93.0 (#8018) by @renovate[bot]
- archive 2025 beta changelog (#8014) by @shulaoda
- update release workflow version pattern from beta to rc (#8013) by @shulaoda
### ❤️ New Contributors
* @valadaptive made their first contribution in [#8043](#8043)
Co-authored-by: shulaoda <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the optimization requested in #8026 to reduce output code size by inverting the logic of the
__exportAllfunction's second parameter.Changes Made
if (symbols)toif (!no_symbols)Impact
Code size savings: 3 bytes per
__exportAllcall in the default caseBefore:
After:
Since most bundles use the default ES2015 behavior with Symbol.toStringTag, this optimization reduces output size in the majority of cases by eliminating the second parameter.
Testing Results
✅ All Rust tests pass (871 esbuild + 710 rolldown + 46 rollup tests)
✅ Manual verification confirms correct behavior
✅ Clippy linting passes
✅ Code review found no issues
✅ 166 snapshot tests updated automatically
✅ Esbuild diff updated
Related: #8026
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.