Skip to content

Comments

refactor: simplify module_namespace construction second try#6118

Merged
graphite-app[bot] merged 1 commit intomainfrom
09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_
Sep 10, 2025
Merged

refactor: simplify module_namespace construction second try#6118
graphite-app[bot] merged 1 commit intomainfrom
09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Sep 10, 2025

related to #5923

Now use the suggestion from @sapphi-red #5926 (comment) to construct module_namespace.

note: It is safe to merge module_namespace declaration and the __export statement, since we always append __export statement before __reexport statements https://github.com/rolldown/rolldown/pull/5939/files#diff-869ccc2e55fee0609d8452d49a68b9df851a71c9f34bdd0324cbd5dfdfe8d1bfL458-L459

Something still needs to be done before the merge:

  • rolldown-dts-plugin supports our new __exports codegen pattern
  • rolldown-vite upgrade to version has the fixing patch.

Copy link
Member Author

IWANABETHATGUY commented Sep 10, 2025


How to use the Graphite Merge Queue

Add 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.

@IWANABETHATGUY IWANABETHATGUY changed the title Revert "chore: Revert "refactor: simplify module_namespace construction (#5939)" (#6117)" refactor: simplify module_namespace construction second try Sep 10, 2025
@netlify
Copy link

netlify bot commented Sep 10, 2025

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit dccd0f3
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/68c183d85875bb000704e819

@github-actions
Copy link
Contributor

github-actions bot commented Sep 10, 2025

Benchmarks Rust

  • target: main(524f25b)
  • pr: 09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_(dccd0f3)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     82.1±3.21ms        ? ?/sec    1.01     82.9±3.79ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.01     92.9±4.14ms        ? ?/sec    1.00     92.0±3.56ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    120.7±3.30ms        ? ?/sec    1.00    121.3±2.79ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    141.9±2.99ms        ? ?/sec    1.00    141.6±2.27ms        ? ?/sec
bundle/bundle@threejs                                        1.00     46.1±3.13ms        ? ?/sec    1.01     46.3±2.54ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     53.5±1.25ms        ? ?/sec    1.02     54.8±1.53ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    471.7±8.66ms        ? ?/sec    1.00    472.1±7.46ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    550.2±7.24ms        ? ?/sec    1.00    550.9±6.39ms        ? ?/sec
scan/scan@rome_ts                                            1.00     95.3±2.65ms        ? ?/sec    1.00     95.3±1.92ms        ? ?/sec
scan/scan@threejs                                            1.00     33.7±0.72ms        ? ?/sec    1.03     34.6±1.17ms        ? ?/sec
scan/scan@threejs10x                                         1.00    351.6±5.07ms        ? ?/sec    1.01    354.2±5.48ms        ? ?/sec

@IWANABETHATGUY IWANABETHATGUY force-pushed the 09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_ branch 2 times, most recently from 93214c3 to 1b26f9f Compare September 10, 2025 13:09
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review September 10, 2025 13:47
@IWANABETHATGUY
Copy link
Member Author

IWANABETHATGUY commented Sep 10, 2025

This pr is identical with #5939, and I have verified locally that with #6114, there is no error in the vite test ci

@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 10, 2025

Merge activity

related to #5923

Now use the suggestion from @sapphi-red #5926 (comment) to construct module_namespace.

note: It is safe to merge `module_namespace` declaration and the `__export` statement, since we always append `__export` statement before `__reexport` statements https://github.com/rolldown/rolldown/pull/5939/files#diff-869ccc2e55fee0609d8452d49a68b9df851a71c9f34bdd0324cbd5dfdfe8d1bfL458-L459

Something still needs to be done before the merge:
- ~`rolldown-dts-plugin` supports our new `__exports` codegen pattern~
- ~`rolldown-vite` upgrade to version has the fixing patch.~
@graphite-app graphite-app bot force-pushed the 09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_ branch from 1b26f9f to dccd0f3 Compare September 10, 2025 13:57
@sapphi-red
Copy link
Member

@IWANABETHATGUY
Copy link
Member Author

It seems it's failing? https://github.com/rolldown/rolldown/actions/runs/17616001957/job/50049152749#step:6:213

Yeah, it would still fail after this pr is merged, since rolldown-dts-plugin only support pattern in #6114, which means it will not fail after #6114 is merged

const module_ns = __export({...})

But since those two pr is stacked and could be batch merged by graphite, so I think it should be fine.

@sapphi-red
Copy link
Member

Ah, I see. Let me try that PR, just in case.

@graphite-app graphite-app bot merged commit dccd0f3 into main Sep 10, 2025
33 checks passed
@graphite-app graphite-app bot deleted the 09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_ branch September 10, 2025 14:12
Boshen added a commit that referenced this pull request Sep 10, 2025
## [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]>
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