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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

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

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 23.13 KB - -
@sentry/browser - with treeshaking flags 21.82 KB +0.05% +10 B 🔺
@sentry/browser (incl. Tracing) 35.62 KB - -
@sentry/browser (incl. Tracing, Replay) 72.89 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 63.32 KB +0.06% +34 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 77.3 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 89.69 KB - -
@sentry/browser (incl. Feedback) 39.88 KB - -
@sentry/browser (incl. sendFeedback) 27.74 KB - -
@sentry/browser (incl. FeedbackAsync) 32.5 KB - -
@sentry/react 25.86 KB - -
@sentry/react (incl. Tracing) 38.48 KB - -
@sentry/vue 27.36 KB - -
@sentry/vue (incl. Tracing) 37.5 KB - -
@sentry/svelte 23.3 KB - -
CDN Bundle 24.21 KB - -
CDN Bundle (incl. Tracing) 35.76 KB - -
CDN Bundle (incl. Tracing, Replay) 70.87 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 76.17 KB - -
CDN Bundle - uncompressed 71.09 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.61 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 220.67 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 233.88 KB - -
@sentry/nextjs (client) 38.76 KB - -
@sentry/sveltekit (client) 36.17 KB - -
@sentry/node 157.95 KB +0.01% +1 B 🔺
@sentry/node - without tracing 98.84 KB -0.01% -2 B 🔽
@sentry/aws-serverless 126.57 KB - -

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 😬

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
2 participants