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(core): Add new transports to base backend #4752

Merged
merged 8 commits into from
Mar 23, 2022

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Mar 22, 2022

Part of #4660

Adds new transports to base backend in core. For now, they are gated behind options._experiments.newTransport = true. The reason this is gated is because client reports does not work with the new transports.

The next step is to add new transports for fetch, xhr (browser) as well as http, https (node). We can do this in any order!

This is pretty hacky code, but considering that we are going to remove a lot of this in v7 anyway, I decided to keep this as is. Also no tests because we are moving fast!

Resolves https://getsentry.atlassian.net/browse/WEB-588

Simplify new transport send by grabbing the envelope category from the
envelope instead of passing it in explicitly.
this._options._experiments &&
this._options._experiments.newTransport
) {
const api = initAPIDetails(this._options.dsn, this._options._metadata, this._options.tunnel);
Copy link
Member Author

Choose a reason for hiding this comment

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

it's annoying to do this, but considering that the client has access to API, won't be needed in the future!

@AbhiPrasad AbhiPrasad force-pushed the abhi-new-transport-in-client branch from 3f8e5b9 to ea233df Compare March 22, 2022 14:43
@AbhiPrasad AbhiPrasad force-pushed the abhi-new-transport-in-client branch from ea233df to 35b0399 Compare March 22, 2022 15:15
Adds new transports to base backend in core. For now, they are gated
behind `options._experiments.newTransport = true`.

The next step is to add new transports for fetch, xhr (browser) as well
as http, https (node).
@AbhiPrasad AbhiPrasad force-pushed the abhi-new-transport-in-client branch from 35b0399 to 2326bb9 Compare March 23, 2022 12:45
Base automatically changed from abhi-get-env-type to master March 23, 2022 13:11
Copy link
Member

@lforst lforst left a comment

Choose a reason for hiding this comment

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

Looks good! Only comment I would have had was on that extra _setupNewTransport field but you caught it on your own :)

Nvm base changed. Looking at it some more.

@lforst lforst self-requested a review March 23, 2022 13:14
@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2022

size-limit report

Path Base Size (43fa409) Current Size Change
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.49 KB 19.66 KB +0.86% 🔺
@sentry/browser - ES5 CDN Bundle (minified) 62.17 KB 62.83 KB +1.07% 🔺
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.11 KB 18.24 KB +0.71% 🔺
@sentry/browser - ES6 CDN Bundle (minified) 55.5 KB 56.15 KB +1.18% 🔺
@sentry/browser - Webpack (gzipped + minified) 22.6 KB 22.78 KB +0.79% 🔺
@sentry/browser - Webpack (minified) 79.21 KB 80.16 KB +1.21% 🔺
@sentry/react - Webpack (gzipped + minified) 22.63 KB 22.81 KB +0.79% 🔺
@sentry/nextjs Client - Webpack (gzipped + minified) 47.6 KB 47.78 KB +0.37% 🔺
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.36 KB 25.53 KB +0.66% 🔺
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 23.72 KB 23.85 KB +0.56% 🔺

@AbhiPrasad AbhiPrasad enabled auto-merge (squash) March 23, 2022 13:20
@AbhiPrasad AbhiPrasad merged commit 69c6874 into master Mar 23, 2022
@AbhiPrasad AbhiPrasad deleted the abhi-new-transport-in-client branch March 23, 2022 13:59
@AbhiPrasad AbhiPrasad added this to the Pre 7.0.0 Work milestone Mar 23, 2022
Sign up for free to 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.

2 participants