Skip to content

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
* 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
@github-actions
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 feat(core): Return client from init method Jun 21, 2024
@chargome chargome force-pushed the cg/return-client-from-init branch from 34d8355 to febc201 Compare June 21, 2024 08:31
@chargome chargome merged commit 012c349 into develop Jun 21, 2024
@chargome chargome deleted the cg/return-client-from-init branch June 21, 2024 08:54
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.

Return client from init methods

4 participants