Skip to content

🔥 remove betaTrackActionsInShadowDom and make shadow DOM action tracking the default#4355

Merged
BenoitZugmeyer merged 1 commit intov7from
benoit/remove-beta-track-actions-in-shadow-dom
Mar 18, 2026
Merged

🔥 remove betaTrackActionsInShadowDom and make shadow DOM action tracking the default#4355
BenoitZugmeyer merged 1 commit intov7from
benoit/remove-beta-track-actions-in-shadow-dom

Conversation

@BenoitZugmeyer
Copy link
Copy Markdown
Member

@BenoitZugmeyer BenoitZugmeyer commented Mar 17, 2026

Motivation

The betaTrackActionsInShadowDom option let users opt into accurate action names and selectors for clicks inside Shadow DOM elements. The feature is now stable enough to become the default for all users — no configuration needed.

Changes

  • Remove betaTrackActionsInShadowDom from the public API and internal configuration; shadow DOM traversal is now always active
  • Update unit and E2E tests to reflect the new default behavior

Test instructions

# Start the dev server
yarn dev-server start

cat > sandbox/test-shadow-dom-actions.html << 'HTMLEOF'
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Test shadow DOM actions</title>
    <script src="/datadog-rum.js"></script>
    <script>
      DD_RUM.init({
        clientToken: 'xxx',
        applicationId: 'xxx',
        proxy: '/proxy',
        trackUserInteractions: true,
      })
    </script>
  </head>
  <body>
    <my-button id="shadow-host"></my-button>
    <my-button id="shadow-host-named" data-dd-action-name="Custom Shadow Action"></my-button>
    <script>
      class MyButton extends HTMLElement {
        constructor() {
          super()
          this.attachShadow({ mode: 'open' })
          const button = document.createElement('button')
          button.textContent = 'Shadow Button'
          button.setAttribute('data-testid', 'shadow-btn')
          this.shadowRoot.appendChild(button)
        }
      }
      customElements.define('my-button', MyButton)
    </script>
  </body>
</html>
HTMLEOF

yarn dev-server intake clear
agent-browser open http://localhost:8080/test-shadow-dom-actions.html
agent-browser click '#shadow-host'
agent-browser click '#shadow-host-named'
agent-browser tab new
yarn dev-server intake rum-actions | jq '{name: .action.target.name, selector: ._dd.action.target.selector}'

# Expected:
# { "name": "Shadow Button", "selector": "#shadow-host::shadow BUTTON[data-testid=\"shadow-btn\"]" }
# { "name": "Custom Shadow Action", "selector": "MY-BUTTON[data-dd-action-name=\"Custom\\ Shadow\\ Action\"]::shadow BUTTON[data-testid=\"shadow-btn\"]" }

yarn dev-server stop
rm sandbox/test-shadow-dom-actions.html

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

…ing the default

Shadow DOM action tracking (accurate names and selectors from within shadow roots) is now always enabled. The beta flag is removed from the public API, internal configuration, and all tests.
@BenoitZugmeyer BenoitZugmeyer marked this pull request as ready for review March 17, 2026 17:53
@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner March 17, 2026 17:53
@BenoitZugmeyer BenoitZugmeyer merged commit c2610b4 into v7 Mar 18, 2026
20 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/remove-beta-track-actions-in-shadow-dom branch March 18, 2026 19:49
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 18, 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.

3 participants