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): Return client from init method #12585

Merged
merged 22 commits into from
Jun 21, 2024
Merged

Conversation

chargome
Copy link
Member

fixes #12495

@chargome chargome requested review from a team, AbhiPrasad and s1gr1d and removed request for a team June 20, 2024 14:34
@@ -98,14 +98,14 @@ function shouldAddPerformanceIntegrations(options: Options): boolean {
/**
* Initialize Sentry for Node.
*/
export function init(options: NodeOptions | undefined = {}): void {
export function init(options: NodeOptions | undefined = {}): NodeClient {
Copy link
Member

Choose a reason for hiding this comment

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

m: Although we always return a top-level client here, making this NodeClient | undefined gives us more flexibility in the future for top-level API without making breaking changes. It also allows us to align the type signature everywhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes you're right, will update that!

@chargome chargome marked this pull request as draft June 20, 2024 14:44
Copy link
Contributor

github-actions bot commented Jun 20, 2024

size-limit report 📦

Path Size
@sentry/browser 22.22 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing) 33.31 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay) 69.09 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.42 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) 73.15 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) 85.34 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 87.21 KB (+0.01% 🔺)
@sentry/browser (incl. metrics) 26.5 KB (+0.03% 🔺)
@sentry/browser (incl. Feedback) 38.45 KB (+0.02% 🔺)
@sentry/browser (incl. sendFeedback) 26.85 KB (+0.03% 🔺)
@sentry/browser (incl. FeedbackAsync) 31.45 KB (+0.02% 🔺)
@sentry/react 24.97 KB (+0.04% 🔺)
@sentry/react (incl. Tracing) 36.36 KB (+0.03% 🔺)
@sentry/vue 26.33 KB (+0.02% 🔺)
@sentry/vue (incl. Tracing) 35.17 KB (+0.02% 🔺)
@sentry/svelte 22.36 KB (+0.03% 🔺)
CDN Bundle 23.42 KB (+0.02% 🔺)
CDN Bundle (incl. Tracing) 35.05 KB (+0.02% 🔺)
CDN Bundle (incl. Tracing, Replay) 69.18 KB (+0.01% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) 74.38 KB (+0.01% 🔺)
CDN Bundle - uncompressed 68.8 KB (+0.04% 🔺)
CDN Bundle (incl. Tracing) - uncompressed 103.66 KB (+0.03% 🔺)
CDN Bundle (incl. Tracing, Replay) - uncompressed 214.13 KB (+0.02% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 226.79 KB (+0.02% 🔺)
@sentry/nextjs (client) 36.24 KB (+0.02% 🔺)
@sentry/sveltekit (client) 33.95 KB (+0.03% 🔺)
@sentry/node 112.99 KB (+0.01% 🔺)
@sentry/node - without tracing 90.39 KB (+0.01% 🔺)
@sentry/aws-serverless 99.48 KB (+0.01% 🔺)
@chargome chargome marked this pull request as ready for review June 21, 2024 07:41
@chargome chargome requested a review from AbhiPrasad June 21, 2024 07:42
@chargome chargome self-assigned this Jun 21, 2024
Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

I think it would be nice to eventually get to a place where this does not need to return Client | undefined as it makes stuff less ergonomic for users, but it's fine for now and we can make the return type stricter later if we want. So let's go with this for now! 👍

Copy link
Member

@s1gr1d s1gr1d 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!

@chargome chargome changed the title feat: Return client from init method Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants