designcourse icon indicating copy to clipboard operation
designcourse copied to clipboard

💥 remove some polyfills

Open thomas-lebeau opened this issue 1 year ago • 2 comments

[!Note] This PR is targeting the v6 branch

Motivation

Reduce bundle size by supporting only browser that support ES2018. We can remove some polyfills as they are supported by natively on the new browser support matrix

Changes

Remove the following polyfills:

  • Array.includes()
  • String.includes()
  • Array.find()
  • Array.from()
  • String.starstWith()
  • String.endsWith()
  • Array.forEach()
  • CSS.escape()
  • Element.matches()
  • Node.parentElement()
  • Element.classList
  • WeakSet
  • Element.closest()
  • Element.labels
  • Map.keys()

Testing

  • [x] Local
  • [ ] Staging
  • [x] Unit
  • [x] End to end

I have gone over the contributing documentation.

thomas-lebeau avatar Jul 10 '24 07:07 thomas-lebeau

Codecov Report

Attention: Patch coverage is 96.36364% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.75%. Comparing base (c04e32b) to head (b64d2a1).

Files Patch % Lines
packages/rum-core/src/browser/cookieObservable.ts 50.00% 1 Missing :warning:
...kages/rum/src/domain/record/trackers/trackInput.ts 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##               v6    #2857      +/-   ##
==========================================
+ Coverage   93.36%   93.75%   +0.38%     
==========================================
  Files         268      267       -1     
  Lines        7481     7378     -103     
  Branches     1687     1659      -28     
==========================================
- Hits         6985     6917      -68     
+ Misses        496      461      -35     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jul 10 '24 07:07 codecov-commenter

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 150.84 KiB 149.42 KiB -1457 B -0.94%
Logs 51.11 KiB 50.78 KiB -339 B -0.65%
Rum Slim 100.76 KiB 99.38 KiB -1417 B -1.37%
Worker 25.16 KiB 25.16 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.001 0.001 0.000
addaction 0.032 0.030 -0.002
adderror 0.032 0.032 -0.001
addtiming 0.001 0.001 -0.000
startview 0.846 0.862 0.016
startstopsessionreplayrecording 0.724 0.918 0.194
logmessage 0.019 0.024 0.005
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 20.89 KiB 21.85 KiB 985 B
addaction 70.99 KiB 70.85 KiB -146 B
adderror 85.21 KiB 84.84 KiB -371 B
addtiming 18.63 KiB 16.94 KiB -1734 B
startview 336.71 KiB 334.29 KiB -2486 B
startstopsessionreplayrecording 15.66 KiB 15.85 KiB 197 B
logmessage 71.47 KiB 69.75 KiB -1767 B

🔗 RealWorld

cit-pr-commenter[bot] avatar Jul 10 '24 07:07 cit-pr-commenter[bot]