-
Notifications
You must be signed in to change notification settings - Fork 144
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-6813] Lazy load session replay #3152
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v6 #3152 +/- ##
==========================================
+ Coverage 93.51% 93.64% +0.13%
==========================================
Files 286 286
Lines 7552 7559 +7
Branches 1718 1718
==========================================
+ Hits 7062 7079 +17
+ Misses 490 480 -10 ☔ View full report in Codecov by Sentry. |
@@ -14,3 +14,17 @@ export function runOnReadyState( | |||
const eventName = expectedReadyState === 'complete' ? DOM_EVENT.LOAD : DOM_EVENT.DOM_CONTENT_LOADED | |||
return addEventListener(configuration, window, eventName, callback, { once: true }) | |||
} | |||
|
|||
export function asyncRunOnReadyState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, I introduced an async version of runOnReadyState
but if we agree on this lazy loading approach I'll refactor the original runOnReadyState
to use promises.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactoring runOnReadyState
is quite complexe. Let's keep asyncRunOnReadyState
for now
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
04a8db5
to
2205ee9
Compare
04ff36b
to
372da63
Compare
a003eae
to
91030c8
Compare
d1b54e2
to
72a8645
Compare
72a8645
to
96a5cc9
Compare
.gitlab-ci.yml
Outdated
@@ -309,7 +309,7 @@ deploy-feature: | |||
stage: deploy | |||
when: manual | |||
variables: | |||
SUFFIX: 'my-feature' #/datadog-[product]-${SUFFIX}.js | |||
SUFFIX: 'lazy-replay' #/datadog-[product]-${SUFFIX}.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 suggestion: You can set the suffix in gitlab when you start a manual job
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, good to know :)
88eb41f
to
5041590
Compare
Motivation
Use dynamic imports to lazy load Session Replay, reducing the bundle size by 3KB (compressed) for users without Session Replay. Transitioning from Webpack, which adds overhead via
__webpack_require__
, to a new bundler could save additional bytes.Changes
webpack.ssr.js
targetingnode
and used for the ssr testwebpack.web.js
targetingweb
and used for e2e testsstartRecording
using dynamic importdeploy.js
script to deploy chunksupload-source-maps.js
script to upload chunks mapsTesting
I have gone over the contributing documentation.