Skip to content

🎨 [PANA-7353] Clean up naming in recording code#4628

Open
sethfowler-datadog wants to merge 1 commit into
mainfrom
seth.fowler/PANA-7353-clean-up-naming-in-recording-code
Open

🎨 [PANA-7353] Clean up naming in recording code#4628
sethfowler-datadog wants to merge 1 commit into
mainfrom
seth.fowler/PANA-7353-clean-up-naming-in-recording-code

Conversation

@sethfowler-datadog
Copy link
Copy Markdown
Contributor

Motivation

I'm about to start pushing a major new round of session replay improvements. Before that process starts, I'd like to take a moment to perform some cleanup. In SDK v6, the SDK included two serialization algorithms: the original one (v1) and the then-experimental replacement (change). In SDK v7, we've totally replaced the v1 algorithm with the change algorithm, but the split that previously existing remains visible in the naming of many functions and types which specify that they generate "change" output or work with the "change" codepath. Now that there's only one codepath, including "change" in all these names is unnecessary. Let's clean it up to make things a little less verbose.

Changes

This PR removes the term "change" everywhere in the recording code where it occurs unnecessarily. The term still appears, but only in places where it involves serialization logic for the Change record type itself; it's no longer spread throughout the code base.

This is a pure refactoring change; no functionality has been altered.

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

@sethfowler-datadog sethfowler-datadog requested review from a team as code owners May 14, 2026 17:06
@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented May 14, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 169.51 KiB 169.51 KiB 0 B 0.00%
Rum Profiler 5.97 KiB 5.97 KiB 0 B 0.00%
Rum Recorder 21.23 KiB 21.23 KiB 0 B 0.00%
Logs 54.70 KiB 54.70 KiB 0 B 0.00%
Rum Slim 127.85 KiB 127.85 KiB 0 B 0.00%
Worker 22.99 KiB 22.99 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
addglobalcontext N/A 0.0037 N/A
RUM - add action 0.0104 0.0176 +69.23%
RUM - add error 0.0126 0.0134 +6.35%
RUM - add timing 0.0007 0.0006 -14.29%
RUM - start view 0.0109 0.0144 +32.11%
RUM - start/stop session replay recording 0.0008 0.0013 +62.50%
Logs - log message 0.0176 0.0198 +12.50%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 42.69 KiB 38.50 KiB -4.19 KiB
RUM - add action 67.95 KiB 77.70 KiB +9.74 KiB
RUM - add timing 37.49 KiB 41.94 KiB +4.45 KiB
RUM - add error 73.15 KiB 71.38 KiB -1.77 KiB
RUM - start/stop session replay recording 41.06 KiB 41.85 KiB +804 B
RUM - start view 492.59 KiB 483.65 KiB -8.94 KiB
Logs - log message 55.59 KiB 56.74 KiB +1.15 KiB

🔗 RealWorld

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

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 76.96% (+0.00%)

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

Copy link
Copy Markdown

@gonzalezreal gonzalezreal left a comment

Choose a reason for hiding this comment

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

LGTM! Just a couple of nits

Comment on lines -39 to 43
* ChangeSerializationTransaction is used to build and emit a BrowserChangeRecord
* SerializationTransaction is used to build and emit a BrowserChangeRecord
* containing a serialized snapshot of the DOM. Unlike SerializationTransaction, it
* doesn't support emitting arbitrary BrowserRecords; instead, the builder methods it
* exposes are used to construct a single BrowserChangeRecord which is emitted at the end
* of the transaction.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤏🏽 This comment has become nonsensical 😄. The original compared ChangeSerializationTransaction to a (now-gone) sibling SerializationTransaction.

import type { TimeStamp } from '@datadog/browser-core'
import type { RumConfiguration } from '@datadog/browser-rum-core'
import { forEachChildNodes, getNodePrivacyLevel } from '@datadog/browser-rum-core'
import { registerCleanupTask } from '../../../../../core/test'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: I see this import has been changed to '@datadog/browser-core/test' in other spec files. Should we normalize all of them?

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.

2 participants