Skip to content

Tighten Live Debugger global hook typing#4508

Draft
watson wants to merge 1 commit intowatson/DEBUG-5296/add-live-debuggerfrom
watson/DEBUG-5296/more-types
Draft

Tighten Live Debugger global hook typing#4508
watson wants to merge 1 commit intowatson/DEBUG-5296/add-live-debuggerfrom
watson/DEBUG-5296/more-types

Conversation

@watson
Copy link
Copy Markdown
Collaborator

@watson watson commented Apr 21, 2026

Motivation

Avoid unsafe any casts in the Live Debugger global hook setup.

Changes

Replace any casts used when assigning $dd_entry, $dd_return, $dd_throw, and $dd_probes on globalThis with a small explicit DebuggerInstrumentationGlobal type in packages/debugger/src/entries/main.ts.

Test instructions

  1. Inspect packages/debugger/src/entries/main.ts.
  2. Confirm the debugger globals are still assigned during init().
  3. Confirm the change is type-only and does not alter the runtime hook wiring.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

Copy link
Copy Markdown
Collaborator Author

watson commented Apr 21, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@datadog-prod-us1-4
Copy link
Copy Markdown

datadog-prod-us1-4 Bot commented Apr 21, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 0.00%
Overall Coverage: 76.68% (-0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c5ebc6b | Docs | Datadog PR Page | Give us feedback!

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Apr 21, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 179.42 KiB 179.42 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 27.03 KiB 27.03 KiB 0 B 0.00%
Logs 56.80 KiB 56.80 KiB 0 B 0.00%
Rum Slim 135.26 KiB 135.26 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.00545 0.0044 -19.27%
RUM - add action 0.0161 0.013 -19.25%
RUM - add error 0.013999999999999999 0.0125 -10.71%
RUM - add timing 0.00295 0.0027 -8.47%
RUM - start view 0.01405 0.0121 -13.88%
RUM - start/stop session replay recording 0.0009 0.0007 -22.22%
Logs - log message 0.016900000000000002 0.0148 -12.43%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 31.53 KiB 32.09 KiB +575 B
RUM - add action 101.84 KiB 115.15 KiB +13.31 KiB
RUM - add timing 32.46 KiB 32.35 KiB -116 B
RUM - add error 104.34 KiB 93.58 KiB -10.76 KiB
RUM - start/stop session replay recording 32.01 KiB 31.58 KiB -439 B
RUM - start view 489.22 KiB 490.67 KiB +1.45 KiB
Logs - log message 99.21 KiB 109.68 KiB +10.47 KiB

🔗 RealWorld

@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4508 April 21, 2026 07:35
@watson watson force-pushed the watson/DEBUG-5296/more-types branch from 8027d31 to bc24fd5 Compare April 21, 2026 07:38
@watson watson force-pushed the graphite-base/4508 branch from bf9a162 to b9da4f3 Compare April 21, 2026 07:38
@watson watson changed the base branch from graphite-base/4508 to watson/DEBUG-5296/add-live-debugger April 21, 2026 07:38
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4508 April 21, 2026 08:17
@watson watson force-pushed the watson/DEBUG-5296/more-types branch from bc24fd5 to 6f0a5f4 Compare April 21, 2026 08:18
@watson watson force-pushed the graphite-base/4508 branch from b9da4f3 to 0040ee8 Compare April 21, 2026 08:18
@watson watson changed the base branch from graphite-base/4508 to watson/DEBUG-5296/add-live-debugger April 21, 2026 08:18
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4508 April 21, 2026 09:12
@watson watson force-pushed the watson/DEBUG-5296/more-types branch from 6f0a5f4 to eaee933 Compare April 21, 2026 09:13
@watson watson force-pushed the graphite-base/4508 branch from 0040ee8 to 653aee9 Compare April 21, 2026 09:13
@watson watson changed the base branch from graphite-base/4508 to watson/DEBUG-5296/add-live-debugger April 21, 2026 09:13
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4508 April 22, 2026 12:24
@watson watson force-pushed the watson/DEBUG-5296/more-types branch from eaee933 to 05a34bf Compare April 22, 2026 21:03
@watson watson force-pushed the graphite-base/4508 branch from 653aee9 to 7d1efe7 Compare April 22, 2026 21:03
@watson watson changed the base branch from graphite-base/4508 to watson/DEBUG-5296/add-live-debugger April 22, 2026 21:03
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4508 April 23, 2026 10:42
Replace `any` casts when installing debugger globals with an explicit typed
global interface so the runtime stays lint-clean without changing behavior.
@watson watson force-pushed the watson/DEBUG-5296/more-types branch from 05a34bf to c5ebc6b Compare April 23, 2026 10:59
@watson watson changed the base branch from graphite-base/4508 to watson/DEBUG-5296/add-live-debugger April 23, 2026 10:59
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