Skip to content

⚗️ Add canvas recording init configuration - #4947

Merged
BeltranBulbarellaDD merged 6 commits into
mainfrom
beltran.bulbarella/canvas_support_1-initconfig
Aug 17, 2026
Merged

⚗️ Add canvas recording init configuration#4947
BeltranBulbarellaDD merged 6 commits into
mainfrom
beltran.bulbarella/canvas_support_1-initconfig

Conversation

@BeltranBulbarellaDD

@BeltranBulbarellaDD BeltranBulbarellaDD commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Motivation

Prepare the Browser SDK configuration surface for Session Replay canvas recording while keeping the capability behind an experimental feature flag. Grouping canvas recording settings in an object leaves room for future controls such as maximum image size or compression type without adding more top-level initialization parameters. Keeping enable separate from the related settings also allows canvas recording to be toggled without losing values such as the configured maximum FPS.

Design references:

Changes

  • Add the hidden sessionReplayCanvasRecording RUM initialization object with this shape:

    sessionReplayCanvasRecording?: {
      enable: boolean
      maxFramesPerSecond?: number
    }
  • Require enable so canvas recording can be explicitly enabled or disabled while preserving related settings.

  • Default maxFramesPerSecond to 1 FPS and validate it at runtime as a finite number in the inclusive range [0, 5]. Setting it to 0 disables canvas frame recording.

  • Require both sessionReplayCanvasRecording.enable: true and the session_replay_record_canvas experimental feature flag for recording to be effective.

  • Keep canvas recording disabled when the configuration object is omitted or the experimental feature is unavailable.

  • Add a reusable finite number field to the js-core configuration schema, with optional inclusive min and max bounds.

  • Update the js-core API report and add focused unit coverage for defaults, custom frame rates, enabled and disabled states, feature gating, missing required fields, and invalid option shapes.

Test instructions

  • yarn test:unit --spec packages/js-core/src/entries/configuration.spec.ts --spec packages/browser-rum-core/src/domain/configuration/configuration.spec.ts
  • yarn typecheck
  • yarn api:check
  • ESLint and Prettier checks on the changed source and test files.

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

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 14, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 60.00%
Overall Coverage: 77.22% (-0.02%)

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

@cit-pr-commenter-54b7da

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

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 180.54 KiB 181.27 KiB +748 B +0.40%
Rum Profiler 8.43 KiB 8.43 KiB 0 B 0.00%
Rum Recorder 21.12 KiB 21.12 KiB 0 B 0.00%
Logs 57.04 KiB 57.50 KiB +472 B +0.81%
Rum Salesforce N/A 139.22 KiB N/A N/A N/A
Rum Slim 138.49 KiB 139.21 KiB +742 B +0.52%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%
Rum Shopify N/A 200.99 KiB N/A N/A N/A
Rum-shopify Profiler N/A 8.43 KiB N/A N/A N/A
Rum-shopify Recorder N/A 3.72 KiB N/A N/A N/A

@BeltranBulbarellaDD

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown

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: 066a0c36d2

ℹ️ 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".

Comment thread packages/js-core/src/entries/configuration.ts
@BeltranBulbarellaDD
BeltranBulbarellaDD marked this pull request as ready for review August 14, 2026 09:56
@BeltranBulbarellaDD
BeltranBulbarellaDD requested a review from a team as a code owner August 14, 2026 09:56

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

Copy link
Copy Markdown

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: 4845699db1

ℹ️ 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".

Comment thread packages/browser-rum-core/src/domain/configuration/configuration.spec.ts Outdated
Comment thread packages/browser-rum-core/src/domain/configuration/configuration.ts Outdated

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

Copy link
Copy Markdown

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: 1e132ae585

ℹ️ 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".

Comment thread packages/browser-rum-core/src/domain/configuration/configuration.ts Outdated
Comment thread packages/browser-rum-core/src/domain/configuration/configuration.ts
@BeltranBulbarellaDD
BeltranBulbarellaDD force-pushed the beltran.bulbarella/canvas_support_1-initconfig branch from 1e132ae to 1bc1fbf Compare August 14, 2026 14:53
@sbarrio
sbarrio requested a review from thomas-lebeau August 17, 2026 07:06
Comment thread packages/browser-rum-core/src/domain/configuration/configuration.ts Outdated
@BeltranBulbarellaDD
BeltranBulbarellaDD force-pushed the beltran.bulbarella/canvas_support_1-initconfig branch from 3ec079f to 3a2a2d7 Compare August 17, 2026 09:19
@BeltranBulbarellaDD
BeltranBulbarellaDD merged commit f1481e5 into main Aug 17, 2026
31 checks passed
@BeltranBulbarellaDD
BeltranBulbarellaDD deleted the beltran.bulbarella/canvas_support_1-initconfig branch August 17, 2026 09:38
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 17, 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