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

⚡️ Remove classes in favour of functions #2885

Merged
merged 13 commits into from
Jul 25, 2024

Conversation

N-Boutaib
Copy link
Contributor

@N-Boutaib N-Boutaib commented Jul 22, 2024

Motivation

Bundle size reduction.

Changes

Migrating some classes to functions.

Remaining classes:

  • AbstractLifeCylce: Needs polymorphism
  • Observable: Failed to migrate
  • WeakSet: Polyfill of EI11 (will be cleaned eventually)
  • Logger: Prototype needed in code

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.74%. Comparing base (2ef6c81) to head (d7d48c7).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2885   +/-   ##
=======================================
  Coverage   93.74%   93.74%           
=======================================
  Files         266      266           
  Lines        7575     7564   -11     
  Branches     1685     1686    +1     
=======================================
- Hits         7101     7091   -10     
+ Misses        474      473    -1     

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

Copy link

cit-pr-commenter bot commented Jul 22, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 160.21 KiB 158.72 KiB -1518 B -0.93%
Logs 56.82 KiB 55.72 KiB -1122 B -1.93%
Rum Slim 108.78 KiB 107.54 KiB -1276 B -1.15%
Worker 25.21 KiB 25.21 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.049 0.060 0.011
adderror 0.065 0.067 0.003
addtiming 0.001 0.001 -0.000
startview 2.284 0.972 -1.312
startstopsessionreplayrecording 1.864 0.845 -1.018
logmessage 0.040 0.032 -0.008
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 19.13 KiB 20.16 KiB 1.03 KiB
addaction 69.89 KiB 75.18 KiB 5.29 KiB
adderror 87.44 KiB 87.65 KiB 210 B
addtiming 15.12 KiB 17.52 KiB 2.40 KiB
startview 348.52 KiB 350.14 KiB 1.61 KiB
startstopsessionreplayrecording 12.49 KiB 14.66 KiB 2.17 KiB
logmessage 69.00 KiB 72.63 KiB 3.63 KiB

🔗 RealWorld

@N-Boutaib N-Boutaib marked this pull request as ready for review July 23, 2024 13:24
@N-Boutaib N-Boutaib requested a review from a team as a code owner July 23, 2024 13:24
packages/core/src/domain/session/sessionManager.ts Outdated Show resolved Hide resolved
packages/core/src/domain/telemetry/telemetry.ts Outdated Show resolved Hide resolved
packages/core/src/tools/boundedBuffer.ts Outdated Show resolved Hide resolved
packages/core/src/transport/batch.ts Outdated Show resolved Hide resolved
packages/core/src/transport/batch.ts Outdated Show resolved Hide resolved
packages/rum-core/src/domain/tracing/tracer.spec.ts Outdated Show resolved Hide resolved
performances/src/proxy.ts Outdated Show resolved Hide resolved
packages/rum/src/domain/segmentCollection/segment.ts Outdated Show resolved Hide resolved
@N-Boutaib N-Boutaib merged commit 0764e79 into main Jul 25, 2024
20 checks passed
@N-Boutaib N-Boutaib deleted the najib.boutaib/bundle-size-reduction-classes-removal branch July 25, 2024 10:53
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.

5 participants