Skip to content

♻️ [RUM-10005] Exposes addEvent instead of strategy to plugins #3567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

thomas-lebeau
Copy link
Collaborator

@thomas-lebeau thomas-lebeau commented May 26, 2025

Motivation

Refactor plugin integration to use addEvent instead of strategy. This gives plugins author the ability to better integrate with native the RUM events (e.g. click actions)

Changes

  • Replace strategy object by addEvent method in plugin's onInit() method.
    • addEvent accept a subset of RumEvent as defined by rum-event-format and the domainContext to be passed to beforeSend.
    • addEvent will then send the event to the lifecycle RAW_RUM_EVENT_COLLECTED to be assembled and send.
  • Use the new addEvent in the react plugin

Test instructions

Additionally you can compare the error event before and after the refactor, they should be mostly identical

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@codecov-commenter
Copy link

codecov-commenter commented May 26, 2025

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.06%. Comparing base (e8a00ef) to head (126ee35).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
packages/rum-react/src/domain/reactPlugin.ts 83.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3567   +/-   ##
=======================================
  Coverage   92.05%   92.06%           
=======================================
  Files         317      318    +1     
  Lines        8098     8103    +5     
  Branches     1832     1832           
=======================================
+ Hits         7455     7460    +5     
  Misses        643      643           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/add-event branch 3 times, most recently from 54ccc04 to 585b3d3 Compare May 27, 2025 14:53
@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/add-event branch from 585b3d3 to 5547bc7 Compare May 28, 2025 08:07
@thomas-lebeau thomas-lebeau changed the title exposes addEvent instead of strategy to plugins ♻️ [RUM-10005] Exposes addEvent instead of strategy to plugins May 28, 2025
@thomas-lebeau thomas-lebeau marked this pull request as ready for review May 28, 2025 13:45
@thomas-lebeau thomas-lebeau requested a review from a team as a code owner May 28, 2025 13:45
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.

4 participants