Skip to content

Tighten Live Debugger global hook typing - #4508

Merged
watson merged 1 commit into
mainfrom
watson/DEBUG-5296/more-types
May 12, 2026
Merged

Tighten Live Debugger global hook typing#4508
watson merged 1 commit into
mainfrom
watson/DEBUG-5296/more-types

Conversation

@watson

@watson watson commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

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

watson commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator Author

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

@datadog-prod-us1-4

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

Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

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

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

@cit-pr-commenter-54b7da

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

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 179.56 KiB 179.56 KiB 0 B 0.00%
Rum Profiler 6.04 KiB 6.04 KiB 0 B 0.00%
Rum Recorder 27.03 KiB 27.03 KiB 0 B 0.00%
Logs 56.69 KiB 56.69 KiB 0 B 0.00%
Rum Slim 135.41 KiB 135.41 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.005 0.0038 -24.00%
RUM - add action 0.014133333333333333 0.0125 -11.56%
RUM - add error 0.013566666666666666 0.0119 -12.29%
RUM - add timing 0.0028333333333333335 0.0025 -11.76%
RUM - start view 0.0131 0.0117 -10.69%
RUM - start/stop session replay recording 0.0007333333333333333 0.0006 -18.18%
Logs - log message 0.014933333333333333 0.0137 -8.26%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 31.23 KiB 31.35 KiB +126 B
RUM - add action 54.86 KiB 55.03 KiB +173 B
RUM - add timing 32.96 KiB 32.33 KiB -644 B
RUM - add error 60.66 KiB 60.62 KiB -37 B
RUM - start/stop session replay recording 32.15 KiB 31.86 KiB -299 B
RUM - start view 483.79 KiB 485.50 KiB +1.71 KiB
Logs - log message 48.88 KiB 49.41 KiB +543 B

🔗 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
@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
@watson
watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4508 May 7, 2026 05:30
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 graphite-base/4508 branch from 8130067 to e739e7e Compare May 12, 2026 09:14
@watson
watson force-pushed the watson/DEBUG-5296/more-types branch from c5ebc6b to 6fc9b0b Compare May 12, 2026 09:14
@watson
watson changed the base branch from graphite-base/4508 to main May 12, 2026 09:14
@watson
watson marked this pull request as ready for review May 12, 2026 09:14
@watson
watson requested a review from a team as a code owner May 12, 2026 09:14
@watson
watson merged commit 0933671 into main May 12, 2026
21 checks passed
@watson
watson deleted the watson/DEBUG-5296/more-types branch May 12, 2026 11:57
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants