[demo split #4449] 2/5 — Add @datadog/browser-debugger package#4533
[demo split #4449] 2/5 — Add @datadog/browser-debugger package#4533allspain wants to merge 1 commit intoallspain/debug-5296-foundationfrom
Conversation
Original author: Thomas Watson <thomas.watson@datadoghq.com> (split of #4449) Co-authored-by: Thomas Watson <thomas.watson@datadoghq.com>
|
I have read the CLA Document and I hereby sign the CLA Rick Klein seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 255a4e2 | Docs | Datadog PR Page | Give us feedback! |
What this PR contains (2/5 — Package)
The
@datadog/browser-debuggerpackage itself: the full probe executionpipeline. Builds on the core changes from PR 1.
Changes
domain/api.ts— Core instrumentation hooks (onEntry,onReturn,onThrow) that execute probes when instrumented functions are called,including condition evaluation, snapshot capture, template message
rendering, and rate limiting.
domain/activeEntries.ts— Tracks per-probe execution stacks forcorrelating entry/return/throw events.
domain/probes.ts— Probe lifecycle management (add, remove, clear)with per-probe and global snapshot rate limiting.
domain/capture.ts— Deep value capture for arguments, locals, returnvalues, and thrown errors with configurable depth/size limits.
domain/expression.ts— Expression compiler that parses JSONexpression trees into executable functions.
domain/condition.ts— Probe condition evaluator with caching.domain/template.ts— Template segment compiler/evaluator for dynamicprobe messages.
domain/stacktrace.ts— Stack trace capture fromErrorobjects.domain/deliveryApi.ts— Polling-based probe delivery client.transport/startDebuggerBatch.ts— Reuses@datadog/browser-core's batch/flush infrastructure.entries/main.ts— Public API surface (datadogDebugger.init()),exposes
$dd_entry/$dd_return/$dd_throw/$dd_probesonglobalThis.Specs included for:
api,capture,condition,deliveryApi,expression,probes,stacktrace,template,entries/main.25 files, +6433 / -0.
Tests
Unit tests run with
yarn test:unit --spec "packages/debugger/src/**/*.spec.ts".