Skip to content
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

♻️ [RUM-8319] Use assembly hook for action #3305

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amortemousque
Copy link
Collaborator

Motivation

The overall goal is to create a Modular SDK to simplify contributions and enhance extensibility.
This PR uses the assemble hook to decouple action assembly

Changes

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@amortemousque amortemousque requested a review from a team as a code owner January 29, 2025 17:04
Copy link

cit-pr-commenter bot commented Jan 29, 2025

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 146.36 KiB 146.40 KiB 43 B +0.03%
Logs 51.06 KiB 51.06 KiB 0 B 0.00%
Rum Slim 105.14 KiB 105.18 KiB 43 B +0.04%
Worker 24.50 KiB 24.50 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.002 0.002 0.000
addaction 0.035 0.035 0.001
addtiming 0.001 0.001 -0.000
adderror 0.051 0.053 0.002
startstopsessionreplayrecording 0.007 0.010 0.003
startview 0.379 0.388 0.010
logmessage 0.019 0.028 0.009
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 29.33 KiB 27.71 KiB -1667 B
addaction 58.79 KiB 56.78 KiB -2061 B
addtiming 27.00 KiB 26.91 KiB -92 B
adderror 60.40 KiB 59.56 KiB -869 B
startstopsessionreplayrecording 27.94 KiB 24.31 KiB -3723 B
startview 419.39 KiB 419.30 KiB -88 B
logmessage 65.40 KiB 57.97 KiB -7603 B

🔗 RealWorld

@amortemousque amortemousque force-pushed the aymeric/assembly-hook-for-action branch from f1eb9ec to 46c2b56 Compare January 29, 2025 17:14
@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 93.64%. Comparing base (1e6be41) to head (46c2b56).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ges/rum-core/src/domain/action/actionCollection.ts 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3305      +/-   ##
==========================================
- Coverage   93.71%   93.64%   -0.08%     
==========================================
  Files         291      291              
  Lines        7670     7676       +6     
  Branches     1747     1751       +4     
==========================================
  Hits         7188     7188              
- Misses        482      488       +6     

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

Copy link
Contributor

@sethfowler-datadog sethfowler-datadog left a comment

Choose a reason for hiding this comment

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

LGTM!

}

return {
type: eventType,
Copy link
Contributor

Choose a reason for hiding this comment

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

The event will already have a type property, right? Assuming that's true, it may make sense to only have the hook return the properties it's adding or changing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right! Specifying the type is a bit of an ugly hack to improve type checking 😞. See

// Ensuring the `type` field is always present improves type checking, especially in conditional logic in hooks (e.g., `if (eventType === 'view')`).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Happy to discuss a better alternative :)

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.

3 participants