Skip to content

ref(browser): Refactor sending client reports w. fetch fallback - #4008

Merged
kamilogorek merged 2 commits into
masterfrom
bind-beacon
Sep 27, 2021
Merged

ref(browser): Refactor sending client reports w. fetch fallback#4008
kamilogorek merged 2 commits into
masterfrom
bind-beacon

Conversation

@kamilogorek

@kamilogorekkamilogorek commented Sep 24, 2021

Copy link
Copy Markdown
Contributor

getNativeFetchImplementation has been moved out of FetchTransport and added cache check to optimize it for use in multiple places. Other than that, no changes to it or to FetchTransport were done.

Fixes#4006

ref: vercel/next.js#23856
ref: https://github.com/vercel/next.js/pull/26601/files
ref: https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch

@github-actions

github-actionsBot commented Sep 24, 2021

Copy link
Copy Markdown
Contributor

size-limit report

PathSize
@sentry/browser - CDN Bundle (gzipped)22.32 KB (+0.01% 🔺)
@sentry/browser - Webpack23.3 KB (0%)
@sentry/react - Webpack23.33 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped)29.77 KB (0%)


if (hasSendBeacon) {
// Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch
const sendBeacon = global.navigator.sendBeacon.bind(global.navigator);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Should we also wrap in a try catch just in case?

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6.13.2 Introduces Illegal invocation error on global navigator

3 participants

@kamilogorek@AbhiPrasad@smeubank