Skip to content

Comments

feat(debug): attach both session_id and build_id to debug events#4994

Merged
hyf0 merged 1 commit intomainfrom
06-18-feat_debug_attach_both_session_id_and_build_id_to_debug_events
Jun 18, 2025
Merged

feat(debug): attach both session_id and build_id to debug events#4994
hyf0 merged 1 commit intomainfrom
06-18-feat_debug_attach_both_session_id_and_build_id_to_debug_events

Conversation

@hyf0
Copy link
Member

@hyf0 hyf0 commented Jun 17, 2025

To clarify:

  • session means a period that matchs RolldownBuild's lifetime. Every rolldown(..) creates a new session id.
  • build_id will be created for every RolldownBuild#write or ``RolldownBuild#generate`
  • build_id always belong to some session.
  • watch doesn't support debug mode so far.

For #4134,

Rolldown is gonna emits a meta.json for each session/.rolldown/[session_id]. FYI @antfu.


the output now looks like

{"timestamp":1750197631355,"session_id":"sid_1750197631338_0","action":"BuildStart","build_id":"bid_1750197631354_0"}
{"timestamp":1750197631355,"session_id":"sid_1750197631338_0","action":"BuildStart","build_id":"bid_1750197631354_0"}
{"timestamp":1750197631356,"session_id":"sid_1750197631338_0","action":"HookResolveIdCallStart","importer":null,"module_request":"./index.ts","import_kind":"import-statement","plugin_name":"builtin:oxc-runtime","plugin_index":0,"trigger":"${hook_resolve_id_trigger}","call_id":"./index.ts_1750197631356","build_id":"bid_1750197631354_0"}
{"timestamp":1750197631356,"session_id":"sid_1750197631338_0","action":"HookResolveIdCallEnd","resolved_id":null,"is_external":null,"plugin_name":"builtin:oxc-runtime","plugin_index":0,"trigger":"${hook_resolve_id_trigger}","call_id":"./index.ts_1750197631356","build_id":"bid_1750197631354_0"}
{"timestamp":1750197631357,"session_id":"sid_1750197631338_0","action":"HookResolveIdCallStart","importer":null,"module_request":"./index.ts","import_kind":"import-statement","plugin_name":"builtin:data-uri","plugin_index":1,"trigger":"${hook_resolve_id_trigger}","call_id":"./index.ts_1750197631357","build_id":"bid_1750197631354_0"}
{"timestamp":1750197631357,"session_id":"sid_1750197631338_0","action":"HookResolveIdCallEnd","resolved_id":null,"is_external":null,"plugin_name":"builtin:data-uri","plugin_index":1,"trigger":"${hook_resolve_id_trigger}","call_id":"./index.ts_1750197631357","build_id":"bid_1750197631354_0"}

@netlify
Copy link

netlify bot commented Jun 17, 2025

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 8e9d991
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/68524cc6517be000088edadb
😎 Deploy Preview https://deploy-preview-4994--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hyf0 hyf0 enabled auto-merge June 17, 2025 22:10
@hyf0 hyf0 disabled auto-merge June 17, 2025 22:13
@github-actions
Copy link
Contributor

github-actions bot commented Jun 17, 2025

Benchmarks Rust

  • target: main(f342001)
  • pr: 06-18-feat_debug_attach_both_session_id_and_build_id_to_debug_events(8e9d991)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     72.9±1.70ms        ? ?/sec    1.04     75.8±2.07ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     84.9±2.46ms        ? ?/sec    1.01     85.5±1.98ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    112.8±2.06ms        ? ?/sec    1.00    113.3±2.23ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    126.9±1.53ms        ? ?/sec    1.01    128.0±2.17ms        ? ?/sec
bundle/bundle@threejs                                        1.00     40.7±2.31ms        ? ?/sec    1.00     40.7±2.00ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.02     47.2±1.80ms        ? ?/sec    1.00     46.4±0.46ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    431.2±4.32ms        ? ?/sec    1.00    431.9±3.92ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    504.6±4.52ms        ? ?/sec    1.00    506.1±4.04ms        ? ?/sec
scan/scan@rome_ts                                            1.00     88.0±1.96ms        ? ?/sec    1.02     89.5±1.64ms        ? ?/sec
scan/scan@threejs                                            1.00     30.4±0.39ms        ? ?/sec    1.03     31.3±1.90ms        ? ?/sec
scan/scan@threejs10x                                         1.00    318.9±3.89ms        ? ?/sec    1.01    323.5±5.86ms        ? ?/sec

@antfu
Copy link
Collaborator

antfu commented Jun 18, 2025

I wonder why we need to differentiate between session and build? In metaframeworks, the rolldown() might be called multiple times and that might be something not Rolldown could control (maybe metaframework would pass more meaningful names etc), but I am not sure if build_id would improve that (Or maybe it's for different purpose?)

@hyf0 hyf0 force-pushed the 06-18-feat_debug_attach_both_session_id_and_build_id_to_debug_events branch from b3cdad1 to 3a04995 Compare June 18, 2025 05:12
Copy link
Member Author

hyf0 commented Jun 18, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@hyf0 hyf0 requested a review from IWANABETHATGUY June 18, 2025 05:18
@hyf0
Copy link
Member Author

hyf0 commented Jun 18, 2025

Just talked with antfu. We'er ok to this PR's behaviors so far,

@hyf0 hyf0 force-pushed the 06-18-feat_debug_attach_both_session_id_and_build_id_to_debug_events branch from 3a04995 to 8e9d991 Compare June 18, 2025 05:21
@hyf0 hyf0 added this pull request to the merge queue Jun 18, 2025
Merged via the queue into main with commit 8ab94e2 Jun 18, 2025
24 checks passed
@hyf0 hyf0 deleted the 06-18-feat_debug_attach_both_session_id_and_build_id_to_debug_events branch June 18, 2025 06:02
Boshen pushed a commit that referenced this pull request Jun 19, 2025
## [1.0.0-beta.18] - 2025-06-19

### 🚀 Features

- advancedChunks: no need to include dependencies for
`PreserveEntrySignatures::False` too (#5005) by @hyf0
- analyze commonjs module side effects and remove unused module (#5003)
by @IWANABETHATGUY
- specially handling commonjs export stmt side effects (#5002) by
@IWANABETHATGUY
- rolldown: oxc v0.73.2 (#5000) by @Boshen
- debug: attach both `session_id` and `build_id` to debug events (#4994)
by @hyf0

### 🐛 Bug Fixes

- rolldown_plugin_import_glob: correctly handle alias glob patterns
(#5007) by @shulaoda
- rolldown_plugin_alias: correctly handle `resolved_id` (#5006) by
@shulaoda
- imported namespace is missing after external import namespace merging
(#4999) by @IWANABETHATGUY
- node: add `experimental.viteMode` to option validator (#4996) by
@sapphi-red
- plugin/vite-resolve: optional peer dep id parse error (#4995) by
@sapphi-red

### 🚜 Refactor

- debug: remove extra mechanism for passing `session_id` and unnecessary
passing of spans (#5001) by @hyf0

### 📚 Documentation

- update description about directive handling (#4992) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- deps: update dependency rolldown-plugin-dts to v0.13.11 (#4863) by
@renovate[bot]
- infra: update changelog configuration in `cliff.toml` (#4961) by
@shulaoda
- infra: add knip to ci (#4991) by @webpro

Co-authored-by: sapphi-red <[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