-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: Prevent fetch errors loops with invalid fetch implementations #3318
Conversation
c88d351
to
a0b2f8c
Compare
size-limit report
|
a0b2f8c
to
69e96ba
Compare
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.
Approved but we should validate if this can cause issues with csp.
const sandbox = document.createElement('iframe'); | ||
sandbox.hidden = true; | ||
document.head.appendChild(sandbox); | ||
if (sandbox.contentWindow?.fetch) { | ||
return sandbox.contentWindow.fetch.bind(global); | ||
} | ||
document.head.removeChild(sandbox); |
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.
This is so slow, that it doesn't execute below 50ms for mobile lighthouse. Thus it delays the TTI metric plus adds to TBT in lighthouse, even if you only execute install in a single macrotask, thus including sentry now costs you points in mobile lighthouse and lowers your ranking on google.
desktop
mobile
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.
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.
Thanks for letting us know, should be patched in #3341
No description provided.