Skip to content

fix(rolldown_plugin_lazy_compilation): use loadExports for fetched proxy to preserve original export names#9132

Draft
h-a-n-a wants to merge 1 commit intomainfrom
04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names
Draft

fix(rolldown_plugin_lazy_compilation): use loadExports for fetched proxy to preserve original export names#9132
h-a-n-a wants to merge 1 commit intomainfrom
04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names

Conversation

@h-a-n-a
Copy link
Copy Markdown
Member

@h-a-n-a h-a-n-a commented Apr 16, 2026

Summary

When a dynamic import target ends up in a ChunkKind::Common chunk (shared across multiple entry boundaries), rolldown minifies all its export names. The lazy compilation fetched proxy previously did const mod = await import(...); return mod, passing the raw chunk namespace to user code — so sel.foo became undefined because the actual key was a short alias like $.

Fix: switch the fetched proxy template to use __rolldown_runtime__.loadExports() instead of returning the chunk namespace directly. The runtime registry stores exports with their original names, bypassing the mangled chunk-level exports.

Test plan

TODO

Blocked by #7974

Copy link
Copy Markdown
Member Author

h-a-n-a commented Apr 16, 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
Copy Markdown

netlify Bot commented Apr 16, 2026

Deploy Preview for rolldown-rs canceled.

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

@h-a-n-a h-a-n-a changed the base branch from main to graphite-base/9132 April 17, 2026 06:07
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 77ca16d to 6341d2b Compare April 17, 2026 06:08
@h-a-n-a h-a-n-a changed the base branch from graphite-base/9132 to 04-17-fix_collect_destructured_bindings_in_hmr_module_exports April 17, 2026 06:08
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 6341d2b to 77a731d Compare April 17, 2026 06:13
@h-a-n-a h-a-n-a force-pushed the 04-17-fix_collect_destructured_bindings_in_hmr_module_exports branch from 25a1f91 to 625e552 Compare April 17, 2026 06:13
@graphite-app graphite-app Bot changed the base branch from 04-17-fix_collect_destructured_bindings_in_hmr_module_exports to graphite-base/9132 April 17, 2026 16:02
@graphite-app graphite-app Bot force-pushed the graphite-base/9132 branch from 625e552 to f554244 Compare April 17, 2026 16:09
@graphite-app graphite-app Bot force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 77a731d to 033efca Compare April 17, 2026 16:09
@graphite-app graphite-app Bot changed the base branch from graphite-base/9132 to main April 17, 2026 16:10
@graphite-app graphite-app Bot force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 033efca to eb0e1fc Compare April 17, 2026 16:10
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from eb0e1fc to 7487a99 Compare April 21, 2026 07:31
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 7487a99 to 496f339 Compare April 21, 2026 10:25
@h-a-n-a h-a-n-a changed the base branch from main to graphite-base/9132 April 27, 2026 07:29
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 496f339 to 2aac0e7 Compare April 27, 2026 07:29
@h-a-n-a h-a-n-a changed the base branch from graphite-base/9132 to 04-21-fix_fix_race_condition_of_module_initialization_in_hmr_patches April 27, 2026 07:30
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 2aac0e7 to e0f9d72 Compare April 27, 2026 07:43
@h-a-n-a h-a-n-a force-pushed the 04-21-fix_fix_race_condition_of_module_initialization_in_hmr_patches branch 2 times, most recently from b4dc062 to 90d94c1 Compare April 27, 2026 07:45
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from e0f9d72 to 55ab442 Compare April 27, 2026 07:45
@graphite-app graphite-app Bot changed the base branch from 04-21-fix_fix_race_condition_of_module_initialization_in_hmr_patches to graphite-base/9132 April 27, 2026 08:10
@graphite-app graphite-app Bot force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 55ab442 to c2554f1 Compare April 27, 2026 08:15
@graphite-app graphite-app Bot force-pushed the graphite-base/9132 branch from 90d94c1 to 27026df Compare April 27, 2026 08:15
@graphite-app graphite-app Bot changed the base branch from graphite-base/9132 to main April 27, 2026 08:15
@graphite-app graphite-app Bot force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from c2554f1 to f2c3464 Compare April 27, 2026 08:15
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 0b49d58 to 35914c4 Compare April 29, 2026 08:51
@h-a-n-a h-a-n-a changed the base branch from main to graphite-base/9132 April 29, 2026 08:54
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 35914c4 to 852f962 Compare April 29, 2026 08:55
@h-a-n-a h-a-n-a changed the base branch from graphite-base/9132 to 04-29-fix_dev_apply___tocommonjs_interop_when_cjs_requires_esm_in_hmr_finalizer April 29, 2026 08:55
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 852f962 to 7e39c60 Compare April 29, 2026 15:53
@h-a-n-a h-a-n-a force-pushed the 04-29-fix_dev_apply___tocommonjs_interop_when_cjs_requires_esm_in_hmr_finalizer branch 2 times, most recently from 9308578 to 90e83d2 Compare April 29, 2026 16:09
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 7e39c60 to 817d34b Compare April 29, 2026 16:09
@h-a-n-a h-a-n-a force-pushed the 04-29-fix_dev_apply___tocommonjs_interop_when_cjs_requires_esm_in_hmr_finalizer branch from 90e83d2 to 8db1bb3 Compare April 29, 2026 16:18
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 817d34b to 11bdba7 Compare April 29, 2026 16:18
@graphite-app graphite-app Bot changed the base branch from 04-29-fix_dev_apply___tocommonjs_interop_when_cjs_requires_esm_in_hmr_finalizer to graphite-base/9132 April 30, 2026 08:33
@graphite-app graphite-app Bot force-pushed the graphite-base/9132 branch from 8db1bb3 to fb0d3b6 Compare April 30, 2026 08:37
@graphite-app graphite-app Bot force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 11bdba7 to 731e03d Compare April 30, 2026 08:37
@graphite-app graphite-app Bot changed the base branch from graphite-base/9132 to main April 30, 2026 08:38
@graphite-app graphite-app Bot force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 731e03d to 872b05f Compare April 30, 2026 08:38
@h-a-n-a h-a-n-a changed the base branch from main to graphite-base/9132 May 6, 2026 06:55
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 872b05f to db8a48f Compare May 6, 2026 06:55
@h-a-n-a h-a-n-a changed the base branch from graphite-base/9132 to 05-06-fix_dev_lazy_lazily_compiled_modules_should_be_watched May 6, 2026 06:55
@h-a-n-a h-a-n-a force-pushed the 05-06-fix_dev_lazy_lazily_compiled_modules_should_be_watched branch from 23d68cf to 8627017 Compare May 6, 2026 06:56
@h-a-n-a h-a-n-a force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from db8a48f to 565a66a Compare May 6, 2026 06:56
@graphite-app graphite-app Bot changed the base branch from 05-06-fix_dev_lazy_lazily_compiled_modules_should_be_watched to graphite-base/9132 May 6, 2026 07:22
@graphite-app graphite-app Bot force-pushed the graphite-base/9132 branch from 8627017 to db46692 Compare May 6, 2026 07:27
@graphite-app graphite-app Bot force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 565a66a to 65d51b3 Compare May 6, 2026 07:27
@graphite-app graphite-app Bot changed the base branch from graphite-base/9132 to main May 6, 2026 07:28
@graphite-app graphite-app Bot force-pushed the 04-16-fix_rolldown_plugin_lazy_compilation_use_loadexports_for_fetched_proxy_to_preserve_original_export_names branch from 65d51b3 to ec35a9a Compare May 6, 2026 07:28
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.

1 participant