-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Conversation
packages/node/src/sdk/index.ts
Outdated
@@ -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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
size-limit report 📦
|
There was a problem hiding this 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! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
34d8355
to
febc201
Compare
fixes #12495