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!: Bump typescript to ~5.0.0 #14758

Merged
merged 1 commit into from
Dec 19, 2024
Merged

feat!: Bump typescript to ~5.0.0 #14758

merged 1 commit into from
Dec 19, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Dec 17, 2024

Closes #14757

For now we keep downleveling to 3.8, as long as that works without problems... we can still remove that in a follow up step.

@mydea mydea self-assigned this Dec 17, 2024
Copy link
Contributor

github-actions bot commented Dec 17, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.13 KB - -
@sentry/browser - with treeshaking flags 21.81 KB - -
@sentry/browser (incl. Tracing) 35.61 KB - -
@sentry/browser (incl. Tracing, Replay) 72.88 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 63.29 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 77.29 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 89.68 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.29 KB - -
CDN Bundle 24.21 KB - -
CDN Bundle (incl. Tracing) 35.77 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.56 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 220.63 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 233.83 KB - -
@sentry/nextjs (client) 38.76 KB - -
@sentry/sveltekit (client) 36.15 KB - -
@sentry/node 157.95 KB - -
@sentry/node - without tracing 98.84 KB -0.01% -1 B 🔽
@sentry/aws-serverless 126.57 KB +0.01% +1 B 🔺

View base workflow run

@mydea mydea force-pushed the fn/bump-typescript branch from b894c53 to 0b9bfdc Compare December 17, 2024 15:59
@@ -444,7 +444,8 @@ describe('markFunctionWrapped', () => {
const wrappedFunc = jest.fn();
markFunctionWrapped(wrappedFunc, originalFunc);

expect((wrappedFunc as WrappedFunction).__sentry_original__).toBe(originalFunc);
// cannot wrap because it is frozen, but we do not error!
Copy link
Member Author

Choose a reason for hiding this comment

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

huh, why did this test pass before? 😅 some ts bug or so? The new behavior is def. the actual expected behavior!

@mydea mydea force-pushed the fn/bump-typescript branch from 0b9bfdc to 042c25d Compare December 17, 2024 17:11
CpuProfilerBindings.startProfiling(name);
await fn();
return CpuProfilerBindings.stopProfiling(name, format);
return CpuProfilerBindings.stopProfiling(name, ProfileFormat.THREAD);
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 started complaining in TS, no idea why. I fixed it by just inlining the one place that we used a different format.

@mydea mydea force-pushed the fn/bump-typescript branch 2 times, most recently from ad2f77c to 080fc65 Compare December 18, 2024 10:17
@@ -53,6 +53,8 @@ In preparation for the OpenTelemetry SDK v2, which will raise the minimum requir

Additionally, like the OpenTelemetry SDK, the Sentry JavaScript SDK will follow [DefinitelyType's version support policy](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window) which has a support time frame of 2 years for any released version of TypeScript.

Older Typescript versions _may_ still work, but we will not test them anymore and no more guarantees apply.
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 this note, not 100% sure if this makes sense? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

yeah that feels reasonable to me.

Copy link
Member

Choose a reason for hiding this comment

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

No hard opinions but personally if a sentence effectively says nothing, which is the case for this one I believe, I would not write it down.

@@ -158,7 +158,7 @@ export function getLocationHref(): string {
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function getDomElement<E = any>(selector: string): E | null {
if (WINDOW.document && WINDOW.document.querySelector) {
if (WINDOW.document && 'querySelector' in WINDOW.document) {
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 complains about being deprecated, which is really stupid 😬 I wonder if we need this check at all anymore 🤔 but probably...

Copy link
Member

Choose a reason for hiding this comment

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

https://caniuse.com/queryselector seems to be supported in all the environments we say we support, I think it's fine.

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 will remove/deprecate this in a separate PR!

@mydea mydea marked this pull request as ready for review December 18, 2024 10:19
@mydea mydea requested review from a team as code owners December 18, 2024 10:19
@@ -53,6 +53,8 @@ In preparation for the OpenTelemetry SDK v2, which will raise the minimum requir

Additionally, like the OpenTelemetry SDK, the Sentry JavaScript SDK will follow [DefinitelyType's version support policy](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window) which has a support time frame of 2 years for any released version of TypeScript.

Older Typescript versions _may_ still work, but we will not test them anymore and no more guarantees apply.
Copy link
Member

Choose a reason for hiding this comment

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

yeah that feels reasonable to me.

mydea added a commit that referenced this pull request Dec 19, 2024
I noticed this in
#14758, this seems
unnecessary and all browsers/envs we support should be able to handle
this. We only use this in two places anyhow, so we can just guard there
(a bit) for this instead.

I will add a deprecation to v8 for this too, although this is just
exported from core and will most likely not affect anybody.
@mydea mydea force-pushed the fn/bump-typescript branch from 080fc65 to f8d1138 Compare December 19, 2024 11:38
@mydea mydea merged commit 61660df into develop Dec 19, 2024
171 checks passed
@mydea mydea deleted the fn/bump-typescript branch December 19, 2024 12:16
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] Bump typescript to v5.0.0
4 participants