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

Investigate loading SDK without blocking page-load #134

Open
cedricziel opened this issue Mar 16, 2023 — with Slack · 2 comments
Open

Investigate loading SDK without blocking page-load #134

cedricziel opened this issue Mar 16, 2023 — with Slack · 2 comments
Labels
question Further information is requested triage/needs more info

Comments

Copy link
Contributor

What

We should investigate if we can load the SDK async without side-effects.

If we can and found no reason not to do it, we need to adjust docs an the in-app instructions in the App O11y plugin

@cedricziel cedricziel added the question Further information is requested label Mar 16, 2023 — with Slack
@codecapitano
Copy link
Collaborator

codecapitano commented Mar 20, 2023

Did some first rough tests.

Works fine with async anddefer attributes added.

Note 1:
I struggled a bit with initializing the React Instrumentation that way but did not put too much time into it. So I need to double check this specific case.
(Very likely a lot of the users, even if they have an spa, do not want to add any 3rd parties to their initial bundle and rather lazy load them later after delivery to the browser.)

Note 2:
The async attribute is sometimes added alongside the defer attribute as a fallback for older browsers which do not support defer. It's important to know that the execution order of scripts differ between the two. Defer keeps the relative order of scripts while async does not. Even that this shouldn't be any problem it needs to be double checked.

@eskirk
Copy link
Collaborator

eskirk commented Aug 14, 2023

@codecapitano @cedricziel any action we can take on this? or has Marco's answer satisfied this ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested triage/needs more info
Projects
None yet
Development

No branches or pull requests

3 participants