Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Bundles Sizes Evolution
🚀 CPU PerformancePending... 🧠 Memory PerformancePending... |
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 079b043 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
Implement Phases 1-2 of the partial view updates feature (behind experimental feature flag). Add VIEW_UPDATE event type, RawRumViewUpdateEvent interface, and a diff engine that computes minimal field-level diffs between view states using MERGE, REPLACE, APPEND, and DELETE strategies. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire the diff engine into viewCollection to conditionally emit view_update events when the PARTIAL_VIEW_UPDATES feature flag is enabled. First event per view.id is always a full view; subsequent updates emit only changed fields. Includes batch routing, beforeSend protection, feature flag context support, domain context types, and comprehensive unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Playwright E2E scenarios validating the complete partial view updates feature: view + view_update event flow, document_version ordering, feature flag toggle, navigation lifecycle, required field presence, and view end events. Skip view_update format validation until schema is available. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…a lands Validation skips for view_update events will cause typecheck failures once rum-events-format adds the view_update schema, serving as a reminder to remove the skips and enable full validation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix import ordering, unused imports, protected directory imports, unsafe type assertions, and formatting across all changed files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1e1e4f8 to
b9f667f
Compare
Cast to the schema-generated RumEvent type so that comparing .type against 'view_update' is a TypeScript error (view_update is absent from the schema union). The @ts-expect-error suppresses it now and will fail typecheck when the schema lands — serving as a reminder to remove the skip. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The rum-events-format schema PR has landed, adding RumViewUpdateEvent to the generated types. Remove the @ts-expect-error skips and runtime guards that were blocking validation, and fix the TypeScript errors that surface from the new schema: - Remove view_update skip from formatValidation.ts and e2e validation.ts - Update rumEvent.types.ts and profiling.ts with generated types - Add view_update to developer extension event type color map - Fix date/view.action optionality from ViewProperties shared schema type Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
|
||
| if (rawRumEvent.type === 'view_update') { | ||
| return SKIPPED | ||
| } |
There was a problem hiding this comment.
Why is view_update explicitly skipped here, but not view?
view_update gets an explicit guard because these events are emitted by SDK-internal timers and observers — user code never triggers them, so handlingStack is never set on their domain context. Without this guard, they'd go through getSourceUrl() only to hit computeStackTrace({ stack: undefined }) and return SKIPPED anyway. The explicit guard makes the intent clear and short-circuits pointless work.
view events don't need the same guard because they can have a meaningful handlingStack — specifically when a user explicitly calls datadogRum.startView(), which captures the call stack. In that case getSourceUrl() can resolve a real file URL and the view event legitimately receives source code context. When no handlingStack is present (the common case), it naturally returns SKIPPED via the contextByFile.get(url) miss at the end.
Motivation
Implement the "RUM Event Format Limitation" RFC (partial view updates) to reduce bandwidth by sending only changed fields in subsequent view events. When the
partial_view_updatesexperimental feature flag is enabled, the SDK sends the first event perview.idas a fullviewevent, and all subsequent updates asview_updateevents containing only changed fields.Changes
Phase 1 — Foundation Types & Feature Flag:
PARTIAL_VIEW_UPDATEStoExperimentalFeatureenumVIEW_UPDATEtoRumEventTypeandRawRumViewUpdateEventinterfaceVIEW_UPDATEtoRawRumEventunion andmodifiableFieldPathsByEventPhase 2 — Diff Engine:
viewDiff.tswithcomputeViewDiff()andcreateViewDiffTracker()Phase 3 — Pipeline Integration:
viewCollection.tsto conditionally emitvieworview_updateview_updatefrombeforeSenddismissal (same asview)VIEW_UPDATEto domain context type mapping and feature flag assembly hookvieweventPhase 4 — E2E Testing:
All changes are gated behind
enableExperimentalFeatures: ['partial_view_updates']. When the flag is OFF, behavior is identical to the current SDK.Test instructions
Checklist
🤖 Generated with Claude Code