svelte-tel-input icon indicating copy to clipboard operation
svelte-tel-input copied to clipboard

Component gets super slow when using Sentry Replay

Open rohanrajpal opened this issue 2 years ago • 3 comments

Hey

Thanks a lot for this amazing component! Has made my life so much easier.

I noticed that after we setup sentry yesterday, and particularly this snippet of code

// hooks.client.ts
import { PUBLIC_ENV } from '$env/static/public';
import { version } from '$app/environment';

import * as Sentry from '@sentry/sveltekit';

Sentry.init({
    dsn: <elided>,

    // We recommend adjusting this value in production, or using tracesSampler
    // for finer control
    tracesSampleRate: 1.0,

    // Optional: Initialize Session Replay:
    integrations: [new Sentry.Replay()], --> if i comment this, the component is fast again!
    replaysSessionSampleRate: 0.1,
    replaysOnErrorSampleRate: 1.0,

    environment: PUBLIC_ENV,
    release: version,
});

export const handleError = Sentry.handleErrorWithSentry();

when initialized, makes the country selection section to be super duper slow, i'm baffled as to why is this happening

if you feel this is more of a sentry issue, I shall report it there and close this issue, a relevant discussion would be https://github.com/getsentry/sentry-javascript/discussions/5838#discussion-4426187

rohanrajpal avatar Aug 15 '23 12:08 rohanrajpal

Hello there!

You're welcome.

Well, it shouldn't be the issue of the select itself. That's not really complicated and everybody could do his own. I tried to make it customizable as much as possible. However, I checked the sentry replay session feature and as I see it's "hide" texts and fields. The example component country select makes ~250 elements when you open it. IMO Sentry is try to hide all those elements textContent.

gyurielf avatar Aug 15 '23 16:08 gyurielf

Hello there!

You're welcome.

Well, it shouldn't be the issue of the select itself. That's not really complicated and everybody could do his own. I tried to make it customizable as much as possible. However, I checked the sentry replay session feature and as I see it's "hide" texts and fields. The example component country select makes ~250 elements when you open it. IMO Sentry is try to hide all those elements textContent.

Ah, makes sense. Yes that can slow things down, I shall report this issue on Sentry then.

rohanrajpal avatar Aug 16 '23 04:08 rohanrajpal

Hello there! Is there any update ? I'm just curious :)

gyurielf avatar Oct 11 '23 16:10 gyurielf