Skip to content

✨ Add view_update support to developer extension#4319

Open
mormubis wants to merge 2 commits intomainfrom
adlrb/partial-view-extension
Open

✨ Add view_update support to developer extension#4319
mormubis wants to merge 2 commits intomainfrom
adlrb/partial-view-extension

Conversation

@mormubis
Copy link
Contributor

Motivation

With the partial_view_updates experimental feature enabled, the SDK now emits view_update events alongside regular view events. Without this change, those events would silently appear in the extension as unstyled/unlabeled — no color, no description, just a raw JSON blob. Since view_update is the whole point of the feature, engineers debugging it need to see these events clearly.

Changes

Added a ViewUpdateDescription component that shows the document version, view name, and a count of changed fields in the event. The color map now recognizes view_update (same blue as view), and event sorting handles the optional date field that view_update carries per the schema.

Also fixed a pre-existing crash in getViewNamenew URL(relativeUrl) throws when the URL is a path like /home, which is common in SPAs. Wrapped it in a try/catch and fall back to the raw string.

Test instructions

  1. Enable the feature flag: datadogRum.init({ enableExperimentalFeatures: ['partial_view_updates'] })
  2. Open the Browser SDK developer extension
  3. Interact with the page to generate view updates
  4. Verify view_update events appear in blue with a description like View update v3 · /home · 2 fields changed

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

🤖 Generated with Claude Code

- eventRow.tsx: add view_update to event type color map
- eventRow.tsx: add ViewUpdateDescription component showing document version,
  view name, and count of changed fields
- eventRow.tsx: fix URL construction crash for relative URLs in getViewName
- eventCollection.ts: handle nullable date in compareEvents (view_update has
  optional date per ViewProperties schema)
@mormubis mormubis changed the title ✨ Add view_update support to developer extension ✨ Add view_update support to developer extension Mar 13, 2026
@mormubis mormubis marked this pull request as ready for review March 13, 2026 11:02
@mormubis mormubis requested a review from a team as a code owner March 13, 2026 11:02
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41bbd47c2f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Sort events chronologically
if (a.date !== b.date) {
return b.date - a.date
return (b.date ?? 0) - (a.date ?? 0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep undated events out of epoch-based sort

Coercing missing timestamps to 0 makes any event without date sort as if it happened at Unix epoch, so view_update entries with omitted dates are pushed to the bottom and can be dropped by the slice(0, MAXIMUM_LOGGED_EVENTS) retention logic under normal traffic. This regresses the new view_update workflow because recent updates become hard to see or disappear entirely when date is absent.

Useful? React with 👍 / 👎.

@cit-pr-commenter-54b7da
Copy link

cit-pr-commenter-54b7da bot commented Mar 13, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 175.03 KiB 175.03 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 27.46 KiB 27.46 KiB 0 B 0.00%
Logs 56.84 KiB 56.84 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 130.67 KiB 130.67 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.0044 0.0046 +4.55%
RUM - add action 0.0158 0.0159 +0.63%
RUM - add error 0.0135 0.0161 +19.26%
RUM - add timing 0.0026 0.0058 +123.08%
RUM - start view 0.0135 0.0151 +11.85%
RUM - start/stop session replay recording 0.0007 0.0009 +28.57%
Logs - log message 0.0152 0.0182 +19.74%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 26.83 KiB 27.88 KiB +1.05 KiB
RUM - add action 51.88 KiB 52.02 KiB +148 B
RUM - add timing 25.84 KiB 26.60 KiB +775 B
RUM - add error 56.33 KiB 55.27 KiB -1.06 KiB
RUM - start/stop session replay recording 26.17 KiB 26.19 KiB +19 B
RUM - start view 450.20 KiB 464.81 KiB +14.60 KiB
Logs - log message 45.27 KiB 44.60 KiB -692 B

🔗 RealWorld

@datadog-prod-us1-3
Copy link

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 0.00%
Overall Coverage: 77.19% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4255372 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

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