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

ref(hub): Remove _invokeClient #4972

Merged
merged 1 commit into from
Apr 28, 2022
Merged

ref(hub): Remove _invokeClient #4972

merged 1 commit into from
Apr 28, 2022

Conversation

AbhiPrasad
Copy link
Member

See earlier work in #4195

Dependent on #4971

This PR removes the dynamic dispatch of _invokeClient in favour of explicitly using client methods. We introduce a _withClient helper that does this.

_withClient grabs the client and scope from the stack of scopes on the hub, and executes a callback with those values. This allows the consumer of the function to directly access the client instance and call methods on it.

There are a couple consequences of this change

  • Things are now typed with typescript!
  • We remove arg spread operator usage
  • No more string usage from dynamic dispatch

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

@AbhiPrasad AbhiPrasad added this to the 7.0.0 milestone Apr 25, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Apr 25, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 18.1 KB (-10.12% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 56.95 KB (-11.86% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 16.91 KB (-10.34% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 51.23 KB (-11.62% 🔽)
@sentry/browser - Webpack (gzipped + minified) 18.83 KB (-18.98% 🔽)
@sentry/browser - Webpack (minified) 61.01 KB (-25.34% 🔽)
@sentry/react - Webpack (gzipped + minified) 18.85 KB (-19.01% 🔽)
@sentry/nextjs Client - Webpack (gzipped + minified) 42.53 KB (-11.5% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 23.88 KB (-8.43% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 22.44 KB (-8.36% 🔽)

@AbhiPrasad AbhiPrasad force-pushed the v7-abhi-delete-minimal branch from 02af0fa to 215d57d Compare April 25, 2022 17:57
@AbhiPrasad AbhiPrasad force-pushed the v7-abhi-invoke-client branch from 8a02b12 to 3908bca Compare April 25, 2022 17:58
@AbhiPrasad AbhiPrasad force-pushed the v7-abhi-invoke-client branch from 3908bca to 41bbcf6 Compare April 26, 2022 15:28
Base automatically changed from v7-abhi-delete-minimal to 7.x April 26, 2022 16:42
@AbhiPrasad AbhiPrasad force-pushed the v7-abhi-invoke-client branch from 41bbcf6 to fd4c840 Compare April 26, 2022 17:25
@AbhiPrasad AbhiPrasad changed the title feat(hub): Remove _invokeClient ref(hub): Remove _invokeClient Apr 26, 2022
@AbhiPrasad AbhiPrasad force-pushed the v7-abhi-invoke-client branch from fd4c840 to ea35dc3 Compare April 28, 2022 12:36
@AbhiPrasad AbhiPrasad force-pushed the v7-abhi-invoke-client branch from ea35dc3 to 120b19c Compare April 28, 2022 13:23
@AbhiPrasad AbhiPrasad merged commit b3fddcd into 7.x Apr 28, 2022
@AbhiPrasad AbhiPrasad deleted the v7-abhi-invoke-client branch April 28, 2022 14:34
AbhiPrasad added a commit that referenced this pull request May 30, 2022
This PR removes the dynamic dispatch of `_invokeClient` in favour of explicitly using client methods. We introduce a `_withClient` helper that does this.

`_withClient` grabs the client and scope from the stack of scopes on the hub, and executes a callback with those values. This allows the consumer of the function to directly access the client instance and call methods on it.
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