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

feat: add client side performance tracking #112

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
fix: lint
  • Loading branch information
renanccastro committed May 22, 2024
commit 90b868eb8a5285d2f717c4e4d2e913e10d9ff9b5
4 changes: 3 additions & 1 deletion lib/client/hijack/wrapSubscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export function wrapSubscription () {
const onReady = () => {
Kadira.webVitals.completedObjects += 1;
Kadira.webVitals.subs.push({ start, end: Ntp._now() });
oldReady && oldReady();
if (oldReady) {
oldReady();
}
};
callbacks.onReady = onReady;
return oldSubscribe(arguments[0],...params, callbacks);
Expand Down
1 change: 0 additions & 1 deletion lib/client/models/webVitals.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export class WebVitalsModel {
} else {
document.addEventListener('readystatechange', () => {
if (document.readyState === 'complete') {
console.log('COMPLETE');
/* stop tracking new dynamic imports/methods/publications */
this.stopTracking();
}
Expand Down
Loading