Skip to content

Comments

refactor: simplify __export runtime helper to create target object internally#6114

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

refactor: simplify __export runtime helper to create target object internally#6114
graphite-app[bot] merged 1 commit intomainfrom
09-10-refactor_simplify_runtime___export_

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Sep 10, 2025

Since the first argument of __export is always {}, moving it into the function body could reduce output size a little.

@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review September 10, 2025 05:46
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 refactor: simplify runtime __export refactor: simplify __export runtime helper to create target object internally Sep 10, 2025
@netlify
Copy link

netlify bot commented Sep 10, 2025

Deploy Preview for rolldown-rs canceled.

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

@IWANABETHATGUY IWANABETHATGUY changed the title refactor: simplify __export runtime helper to create target object internally refactor: simplify __export runtime helper to create target object internally Sep 10, 2025
@IWANABETHATGUY IWANABETHATGUY force-pushed the 09-10-refactor_simplify_runtime___export_ branch from 488ab5c to 9ddb743 Compare September 10, 2025 05:48
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 10, 2025

Open in StackBlitz

@rolldown/browser

npm i https://pkg.pr.new/@rolldown/browser@6114

@rolldown/debug

npm i https://pkg.pr.new/@rolldown/debug@6114

@rolldown/pluginutils

npm i https://pkg.pr.new/@rolldown/pluginutils@6114

rolldown

npm i https://pkg.pr.new/rolldown@6114

@rolldown/binding-android-arm64

npm i https://pkg.pr.new/@rolldown/binding-android-arm64@6114

@rolldown/binding-darwin-arm64

npm i https://pkg.pr.new/@rolldown/binding-darwin-arm64@6114

@rolldown/binding-darwin-x64

npm i https://pkg.pr.new/@rolldown/binding-darwin-x64@6114

@rolldown/binding-freebsd-x64

npm i https://pkg.pr.new/@rolldown/binding-freebsd-x64@6114

@rolldown/binding-linux-arm-gnueabihf

npm i https://pkg.pr.new/@rolldown/binding-linux-arm-gnueabihf@6114

@rolldown/binding-linux-arm64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-gnu@6114

@rolldown/binding-linux-arm64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-musl@6114

@rolldown/binding-linux-x64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-gnu@6114

@rolldown/binding-linux-x64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-musl@6114

@rolldown/binding-openharmony-arm64

npm i https://pkg.pr.new/@rolldown/binding-openharmony-arm64@6114

@rolldown/binding-wasm32-wasi

npm i https://pkg.pr.new/@rolldown/binding-wasm32-wasi@6114

@rolldown/binding-win32-arm64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-arm64-msvc@6114

@rolldown/binding-win32-ia32-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-ia32-msvc@6114

@rolldown/binding-win32-x64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-x64-msvc@6114

commit: 488ab5c

@github-actions
Copy link
Contributor

github-actions bot commented Sep 10, 2025

Benchmarks Rust

  • target: 09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_(dccd0f3)
  • pr: 09-10-refactor_simplify_runtime___export_(47633cd)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     83.3±2.40ms        ? ?/sec    1.02     85.1±2.49ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     94.1±2.63ms        ? ?/sec    1.02     95.6±4.28ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    123.0±3.03ms        ? ?/sec    1.01    124.7±2.82ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    143.4±3.30ms        ? ?/sec    1.01    144.7±2.27ms        ? ?/sec
bundle/bundle@threejs                                        1.00     46.6±2.54ms        ? ?/sec    1.02     47.6±1.26ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     54.8±0.95ms        ? ?/sec    1.01     55.2±0.85ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    480.0±7.28ms        ? ?/sec    1.01    482.9±6.71ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    562.9±5.97ms        ? ?/sec    1.00    565.4±5.75ms        ? ?/sec
scan/scan@rome_ts                                            1.02    100.5±1.93ms        ? ?/sec    1.00     98.6±1.87ms        ? ?/sec
scan/scan@threejs                                            1.01     36.1±2.03ms        ? ?/sec    1.00     35.7±2.09ms        ? ?/sec
scan/scan@threejs10x                                         1.01    367.4±5.56ms        ? ?/sec    1.00    363.7±4.24ms        ? ?/sec

@IWANABETHATGUY IWANABETHATGUY marked this pull request as draft September 10, 2025 06:39
@IWANABETHATGUY IWANABETHATGUY changed the base branch from main to graphite-base/6114 September 10, 2025 06:40
@IWANABETHATGUY IWANABETHATGUY force-pushed the 09-10-refactor_simplify_runtime___export_ branch from 349f751 to e563318 Compare September 10, 2025 06:41
@IWANABETHATGUY IWANABETHATGUY changed the base branch from graphite-base/6114 to 09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_ September 10, 2025 06:41
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 10, 2025

Merge activity

  • Sep 10, 6:41 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Sep 10, 1:57 PM UTC: The merge label 'graphite: merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 10, 1:57 PM UTC: IWANABETHATGUY added this pull request to the Graphite merge queue.
  • Sep 10, 2:05 PM UTC: The Graphite merge queue removed this pull request due to removal of a downstack PR #6118.
  • Sep 10, 2:05 PM UTC: sapphi-red removed this pull request from the Graphite merge queue.
  • Sep 10, 2:11 PM UTC: The merge label 'graphite: merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 10, 2:11 PM UTC: IWANABETHATGUY added this pull request to the Graphite merge queue.
  • Sep 10, 2:13 PM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot changed the base branch from 09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_ to main September 10, 2025 06:41
@IWANABETHATGUY IWANABETHATGUY changed the base branch from main to graphite-base/6114 September 10, 2025 13:09
@IWANABETHATGUY IWANABETHATGUY force-pushed the 09-10-refactor_simplify_runtime___export_ branch from e563318 to 496b52f Compare September 10, 2025 13:09
@IWANABETHATGUY IWANABETHATGUY changed the base branch from graphite-base/6114 to 09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_ September 10, 2025 13:09
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review September 10, 2025 13:53
…internally (#6114)

Since the first argument of `__export` is always `{}`, moving it into the function body could reduce output size a little.
@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
@graphite-app graphite-app bot force-pushed the 09-10-refactor_simplify_runtime___export_ branch from 496b52f to 47633cd Compare September 10, 2025 13:58
Base automatically changed from 09-10-revert_chore_revert_refactor_simplify_module_namespace_construction_5939_6117_ to main September 10, 2025 14:12
@graphite-app graphite-app bot merged commit 47633cd into main Sep 10, 2025
48 checks passed
@graphite-app graphite-app bot deleted the 09-10-refactor_simplify_runtime___export_ branch September 10, 2025 14:13
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]>
graphite-app bot pushed a commit that referenced this pull request Dec 24, 2025
…dule-lexer` (#7640)

Closes #7634

Rename `__export` to `__exportAll` to ensure compatibility with `cjs-module-lexer` versions older than 2.1.1 (which covers most Node.js versions).

`cjs-module-lexer` has special handling for `__export` (a pattern used by TypeScript). Since it uses pattern matching to detect exports, it fails to parse `__export` when there is only one argument (e.g., `__export({ ... })`), expecting the form `__export(exports, { ... })` instead.

By using a different name, we avoid triggering this faulty heuristic entirely.

Background:
why we change the `__export` runtime helper
1. #6114
2. #5926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants