Skip to content

chore(node): rename runtime-without-comments.js with runtime-base.js#2919

Merged
hyfdev merged 1 commit into
mainfrom
11-26-chore_node_rename_runtime-without-comments.js_with_runtime-base.js_
Nov 25, 2024
Merged

chore(node): rename runtime-without-comments.js with runtime-base.js#2919
hyfdev merged 1 commit into
mainfrom
11-26-chore_node_rename_runtime-without-comments.js_with_runtime-base.js_

Conversation

@hyfdev

@hyfdev hyfdev commented Nov 25, 2024

Copy link
Copy Markdown
Member

Description

Part of #2685.

hyfdev commented Nov 25, 2024

Copy link
Copy Markdown
Member Author

@netlify

netlify Bot commented Nov 25, 2024

Copy link
Copy Markdown

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit f61d80d
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/6744b4ce8f0ea50008e7cc85

@hyfdev
hyfdev added this pull request to the merge queue Nov 25, 2024
@github-actions

Copy link
Copy Markdown
Contributor

Benchmarks Rust

  • target: main(446dca9)
  • pr: 11-26-chore_node_rename_runtime-without-comments.js_with_runtime-base.js_(f61d80d)
group                                                               pr                                     target
-----                                                               --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol                     1.00     75.0±3.60ms        ? ?/sec    1.01     76.1±3.87ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-minify              1.00    102.9±2.28ms        ? ?/sec    1.02    104.5±2.29ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-minify-sourcemap    1.01    118.0±2.24ms        ? ?/sec    1.00    116.6±1.29ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap           1.00     84.3±1.49ms        ? ?/sec    1.01     85.5±2.40ms        ? ?/sec
bundle/bundle@rome-ts                                               1.01    134.2±4.64ms        ? ?/sec    1.00    132.2±2.09ms        ? ?/sec
bundle/bundle@rome-ts-minify                                        1.00    237.6±6.48ms        ? ?/sec    1.03    244.9±4.90ms        ? ?/sec
bundle/bundle@rome-ts-minify-sourcemap                              1.04   297.9±11.82ms        ? ?/sec    1.00   287.0±15.53ms        ? ?/sec
bundle/bundle@rome-ts-sourcemap                                     1.00    146.5±3.13ms        ? ?/sec    1.00    146.1±1.82ms        ? ?/sec
bundle/bundle@threejs                                               1.03     38.9±1.05ms        ? ?/sec    1.00     37.8±1.06ms        ? ?/sec
bundle/bundle@threejs-minify                                        1.01     99.1±2.47ms        ? ?/sec    1.00     98.0±3.36ms        ? ?/sec
bundle/bundle@threejs-minify-sourcemap                              1.08   126.0±10.58ms        ? ?/sec    1.00    116.3±1.90ms        ? ?/sec
bundle/bundle@threejs-sourcemap                                     1.03     50.7±0.74ms        ? ?/sec    1.00     49.4±1.11ms        ? ?/sec
bundle/bundle@threejs10x                                            1.03    433.1±4.91ms        ? ?/sec    1.00    420.7±6.91ms        ? ?/sec
bundle/bundle@threejs10x-minify                                     1.01  1354.0±25.07ms        ? ?/sec    1.00  1342.1±18.17ms        ? ?/sec
bundle/bundle@threejs10x-minify-sourcemap                           1.00  1530.6±23.93ms        ? ?/sec    1.00  1526.4±27.07ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                                  1.00    505.9±8.46ms        ? ?/sec    1.03    518.8±6.27ms        ? ?/sec
remapping/remapping                                                 1.00     28.2±0.25ms        ? ?/sec    1.02     28.8±0.55ms        ? ?/sec
remapping/render-chunk-remapping                                    1.03     78.5±0.45ms        ? ?/sec    1.00     76.5±0.41ms        ? ?/sec
scan/scan@rome-ts                                                   1.00    104.5±1.22ms        ? ?/sec    1.03    107.5±1.99ms        ? ?/sec
scan/scan@threejs                                                   1.01     29.6±0.74ms        ? ?/sec    1.00     29.2±0.60ms        ? ?/sec
scan/scan@threejs10x                                                1.00    301.1±3.04ms        ? ?/sec    1.01    302.9±5.24ms        ? ?/sec

Merged via the queue into main with commit 84f2980 Nov 25, 2024
@hyfdev
hyfdev deleted the 11-26-chore_node_rename_runtime-without-comments.js_with_runtime-base.js_ branch November 25, 2024 17:56
graphite-app Bot pushed a commit that referenced this pull request Jul 15, 2026
### Description

`crates/rolldown/src/runtime/index.js` is not part of the build, and hasn''t been for a long time. This PR deletes it.

The runtime module is assembled in [`runtime_module_task.rs`](https://github.com/rolldown/rolldown/blob/main/crates/rolldown/src/module_loader/runtime_module_task.rs#L33-L36) from exactly four `include_str!`ed files:

```rust
const RUNTIME_BASE_JS: &str = include_str!("../runtime/runtime-base.js");
const RUNTIME_TAIL_JS: &str = include_str!("../runtime/runtime-tail.js");
const RUNTIME_HEAD_NODE_JS: &str = include_str!("../runtime/runtime-head-node.js");
const RUNTIME_TAIL_NODE_JS: &str = include_str!("../runtime/runtime-tail-node.js");
```

`index.js` is not among them. Nothing else in the repo references it either — there''s no `build.rs` in the crate, and no path reference to it in Rust, JS, or `knip.jsonc`. Its only remaining coverage is incidental: the sibling `tsconfig.json` globs `./**/*`, so it gets type-checked and formatted alongside the files that actually ship.

### How it got here

It''s the original esbuild runtime port from #37. #375 added `runtime-without-comments.js` as the copy actually fed to the bundler; that file was renamed to `runtime-base.js` in #2919 and later split with `runtime-tail.js`. `index.js` was never wired back up — it survived as a copy that edits were hand-mirrored into.

### Why delete rather than leave it

The mirroring has fallen behind, so the file now actively misinforms:

| | `runtime-base.js` (ships) | `index.js` (dead) |
|---|---|---|
| `cb = null` release in `__commonJS` (#9067) | present | **missing** |
| `__exportAll` + `Symbol.toStringTag` | present | still the old `__export` |
| `__require` error text | rewritten to link the rolldown docs (in `runtime-tail.js`) | still esbuild''s "Dynamic require of …" |

Someone grepping for a runtime helper can land here and draw the wrong conclusion about what ships — the missing #9067 fix reads as a live memory leak. It isn''t, because the file is inert. Deleting it removes the trap and the ongoing cost of keeping a second copy in sync.

### Test Plan

Deletion only; no shipped output changes, so no snapshots move. `include_str!` resolves at compile time, so a stale reference would break the build:

- `cargo check -p rolldown --all-targets` — passes
- `tsc --noEmit -p crates/rolldown/src/runtime/tsconfig.json` — passes
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