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)!: Remove standalone Client interface & deprecate BaseClient #14800

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

mydea
Copy link
Member

@mydea mydea commented Dec 19, 2024

This PR renames the BaseClient class to Client, makes the ClientOptions optional on Client.
It keeps a deprecated BaseClient alias around, we can remove that in v9 (it does not really hurt to keep it too much, IMHO).

Closes #9840

@mydea mydea requested review from lforst, Lms24 and AbhiPrasad December 19, 2024 11:01
@mydea mydea self-assigned this Dec 19, 2024
Copy link
Contributor

github-actions bot commented Dec 19, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.77 KB - -
@sentry/browser - with treeshaking flags 21.53 KB +0.07% +15 B 🔺
@sentry/browser (incl. Tracing) 35.38 KB - -
@sentry/browser (incl. Tracing, Replay) 72.58 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 63.02 KB +0.07% +45 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 76.98 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 88.84 KB - -
@sentry/browser (incl. Feedback) 39.04 KB - -
@sentry/browser (incl. sendFeedback) 27.41 KB - -
@sentry/browser (incl. FeedbackAsync) 32.22 KB - -
@sentry/react 25.54 KB - -
@sentry/react (incl. Tracing) 38.19 KB - -
@sentry/vue 27.1 KB - -
@sentry/vue (incl. Tracing) 37.25 KB - -
@sentry/svelte 22.94 KB - -
CDN Bundle 24.14 KB - -
CDN Bundle (incl. Tracing) 35.71 KB - -
CDN Bundle (incl. Tracing, Replay) 70.74 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 75.94 KB - -
CDN Bundle - uncompressed 70.59 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.17 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 220.11 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 232.86 KB - -
@sentry/nextjs (client) 38.5 KB - -
@sentry/sveltekit (client) 35.91 KB - -
@sentry/node 162.51 KB -0.01% -1 B 🔽
@sentry/node - without tracing 98.26 KB -0.01% -1 B 🔽
@sentry/aws-serverless 128.13 KB -0.01% -1 B 🔽

View base workflow run

@mydea mydea marked this pull request as ready for review December 19, 2024 11:34
@mydea mydea requested review from a team as code owners December 19, 2024 11:34
* @param scope An optional scope containing event metadata.
* @returns A string representing the id of the check in.
*/
public captureCheckIn?(checkIn: CheckIn, monitorConfig?: MonitorConfig, scope?: Scope): string;
Copy link
Member

Choose a reason for hiding this comment

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

I think we intentionally didn't add this to BaseClient, only to the ServerRuntimeClient so that check-in stays server-side specific.

Why did we make this change here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was in the type of Client. I merged this in as a type, but it is still optional! So not every client has to implement this method. I think that means nothing effectively should change?

@@ -547,7 +559,7 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
public emit(hook: 'createDsc', dsc: DynamicSamplingContext, rootSpan?: Span): void;

/** @inheritdoc */
public emit(hook: 'beforeSendFeedback', feedback: FeedbackEvent, options?: { includeReplay: boolean }): void;
public emit(hook: 'beforeSendFeedback', feedback: FeedbackEvent, options?: { includeReplay?: boolean }): void;
Copy link
Member

Choose a reason for hiding this comment

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

Was this typed incorrectly before?

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! It differed between here and the type interface 😬

Instead this now is based on the `BaseClient` class.
feat(core)!: Remove standalone `Client` interface & deprecate `BaseClient`
@mydea mydea merged commit b8c83be into develop Jan 7, 2025
152 checks passed
@mydea mydea deleted the fn/client-type branch January 7, 2025 09:50
mydea added a commit that referenced this pull request Jan 10, 2025
mydea added a commit that referenced this pull request Jan 13, 2025
From #14800

I noticed I totally forgot to migrate the jsdoc comments from the types
to the class, oops!
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.

[v9] Remove Client type, rename BaseClient -> Client and use that instead
4 participants