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

ref(core)!: Cleanup internal types, including ReportDialogOptions #14861

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

Conversation

mydea
Copy link
Member

@mydea mydea commented Dec 30, 2024

These are small changes, cleaning up outdated (I believe?) TODOs, and some internal type stuff.

@mydea mydea self-assigned this Dec 30, 2024
@@ -131,7 +131,6 @@ function _isIgnoredTransaction(event: Event, ignoreTransactions?: Array<string |
}

function _isDeniedUrl(event: Event, denyUrls?: Array<string | RegExp>): boolean {
// TODO: Use Glob instead?
Copy link
Member Author

Choose a reason for hiding this comment

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

@AbhiPrasad I think this is not really relevant anymore, is it? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Yeah we can remove!

@@ -19,8 +19,6 @@ interface Performance {

/**
* Returns a timestamp in seconds since the UNIX epoch using the Date API.
*
* TODO(v8): Return type should be rounded.
Copy link
Member Author

Choose a reason for hiding this comment

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

@AbhiPrasad I think this would be pretty breaking, I do not think we actually want to reduce fidelity here? Or am I missing something?

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 added this because relay assumes that seconds comes in as integers, not floats. Let's ping ingest to double check.

Copy link
Member Author

Choose a reason for hiding this comment

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

but this would lose a whole lot of accuracy, wouldn't it? Or how would you then send sub-second timestamps?

@@ -32,8 +32,7 @@ export function setContextOnScope(scope: Scope, context: Context): void {

/**
* Get the context related to a scope.
* TODO v8: Use this for the `trace` functions.
Copy link
Member Author

Choose a reason for hiding this comment

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

We are already doing this, so all good :D

Copy link
Contributor

github-actions bot commented Dec 30, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.77 KB - -
@sentry/browser - with treeshaking flags 21.52 KB - -
@sentry/browser (incl. Tracing) 35.35 KB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Replay) 72.55 KB -0.01% -3 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.95 KB -0.01% -1 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 76.95 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 89.32 KB - -
@sentry/browser (incl. Feedback) 39.53 KB - -
@sentry/browser (incl. sendFeedback) 27.41 KB - -
@sentry/browser (incl. FeedbackAsync) 32.17 KB - -
@sentry/react 25.54 KB - -
@sentry/react (incl. Tracing) 38.16 KB - -
@sentry/vue 27.06 KB - -
@sentry/vue (incl. Tracing) 37.22 KB +0.01% +2 B 🔺
@sentry/svelte 22.94 KB - -
CDN Bundle 24.13 KB - -
CDN Bundle (incl. Tracing) 35.66 KB -0.01% -2 B 🔽
CDN Bundle (incl. Tracing, Replay) 70.7 KB -0.01% -5 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 75.9 KB -0.01% -3 B 🔽
CDN Bundle - uncompressed 70.59 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.05 KB -0.01% -1 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 219.99 KB -0.01% -1 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 232.86 KB -0.01% -1 B 🔽
@sentry/nextjs (client) 38.48 KB +0.01% +1 B 🔺
@sentry/sveltekit (client) 35.88 KB +0.01% +2 B 🔺
@sentry/node 162.88 KB - -
@sentry/node - without tracing 98.66 KB +0.01% +2 B 🔺
@sentry/aws-serverless 128.5 KB - -

View base workflow run

Copy link

codecov bot commented Dec 30, 2024

❌ 75 Tests Failed:

Tests completed Failed Passed Skipped
703 75 628 295
View the top 3 failed tests by shortest run time
errors.test.ts sends an error
Stack Traces | 0.213s run time
errors.test.ts:4:5 sends an error
errors.test.ts captures an error
Stack Traces | 0.222s run time
errors.test.ts:4:5 captures an error
errors.client.test.ts client-side errorscaptures error thrown on click
Stack Traces | 0.262s run time
errors.client.test.ts:5:3 captures error thrown on click

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@@ -131,7 +131,6 @@ function _isIgnoredTransaction(event: Event, ignoreTransactions?: Array<string |
}

function _isDeniedUrl(event: Event, denyUrls?: Array<string | RegExp>): boolean {
// TODO: Use Glob instead?
Copy link
Member

Choose a reason for hiding this comment

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

Yeah we can remove!

@@ -19,8 +19,6 @@ interface Performance {

/**
* Returns a timestamp in seconds since the UNIX epoch using the Date API.
*
* TODO(v8): Return type should be rounded.
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 added this because relay assumes that seconds comes in as integers, not floats. Let's ping ingest to double check.

// TODO(v9): Change this to [key: string]: unknkown;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
[key: string]: unknown;
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 this requires a changelog entry.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a changelog entry!

@mydea mydea changed the title ref(core): Cleanup todos & internal types ref(core): Cleanup internal types Dec 30, 2024
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

ReportDialogOptions changes needs a changelog entry because we are breaking the types.

@@ -47,9 +47,7 @@ export function getEnvelopeEndpointWithUrlEncodedAuth(dsn: DsnComponents, tunnel
export function getReportDialogEndpoint(
dsnLike: DsnLike,
dialogOptions: {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this should be typed with ReportDialogOptions

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved the type to core so we can reuse this here!

@mydea mydea force-pushed the fn/cleanup-todos branch from 2b01487 to a36df93 Compare January 3, 2025 12:02
@mydea mydea changed the title ref(core): Cleanup internal types ref(core)!: Cleanup internal types, including ReportDialogOptions Jan 3, 2025
@mydea mydea requested a review from AbhiPrasad January 3, 2025 12:43
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.

2 participants