Skip to content

feat(sveltekit): Only inject fetch proxy script for SvelteKit < 2.16.0 #15126

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

Merged

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jan 22, 2025

With v9 onwards, we'll only inject the fetch proxy script into SvelteKit versions where we actually need it. This is all kit versions below 2.16.0. I'll update docs in a follow-up PR.

fixes #15007

Copy link
Contributor

github-actions bot commented Jan 22, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.03 KB - -
@sentry/browser - with treeshaking flags 22.92 KB - -
@sentry/browser (incl. Tracing) 35.8 KB - -
@sentry/browser (incl. Tracing, Replay) 72.59 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 66.13 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 76.85 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 89.35 KB - -
@sentry/browser (incl. Feedback) 39.71 KB - -
@sentry/browser (incl. sendFeedback) 27.66 KB - -
@sentry/browser (incl. FeedbackAsync) 32.44 KB - -
@sentry/react 24.84 KB - -
@sentry/react (incl. Tracing) 37.69 KB - -
@sentry/vue 27.14 KB - -
@sentry/vue (incl. Tracing) 37.52 KB - -
@sentry/svelte 23.15 KB - -
CDN Bundle 24.23 KB - -
CDN Bundle (incl. Tracing) 35.91 KB - -
CDN Bundle (incl. Tracing, Replay) 70.56 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 75.69 KB - -
CDN Bundle - uncompressed 70.83 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.57 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 217.42 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 229.99 KB - -
@sentry/nextjs (client) 38.65 KB - -
@sentry/sveltekit (client) 36.3 KB - -
@sentry/node 156.36 KB -0.01% -1 B 🔽
@sentry/node - without tracing 97.45 KB - -
@sentry/aws-serverless 106.92 KB -0.01% -1 B 🔽

View base workflow run

@Lms24 Lms24 force-pushed the lms/feat-sveltekit-check-version-for-proxy-script-inject branch from 44f6aea to ce32c24 Compare January 22, 2025 11:10
Base automatically changed from lms/feat-sveltekit-remove-fetch-proxy-nonce to develop January 22, 2025 11:32
@Lms24 Lms24 force-pushed the lms/feat-sveltekit-check-version-for-proxy-script-inject branch 3 times, most recently from 46cc1a4 to a0bc030 Compare January 23, 2025 07:44
Copy link

codecov bot commented Jan 23, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
695 1 694 302
View the top 1 failed tests by shortest run time
sdk.test.ts SDK-internal behaviorDoesn&apos;t inject fetch proxy script for SvelteKit&gt;=2.16.0
Stack Traces | 30s run time
sdk.test.ts:5:3 Doesn't inject fetch proxy script for SvelteKit>=2.16.0

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

@Lms24 Lms24 force-pushed the lms/feat-sveltekit-check-version-for-proxy-script-inject branch from 383920f to f52fd16 Compare January 28, 2025 15:05
@Lms24 Lms24 self-assigned this Jan 28, 2025
@Lms24 Lms24 requested review from a team, mydea and s1gr1d and removed request for a team January 28, 2025 15:25
@Lms24 Lms24 marked this pull request as ready for review January 28, 2025 15:25
@Lms24 Lms24 force-pushed the lms/feat-sveltekit-check-version-for-proxy-script-inject branch from f52fd16 to 0b53e27 Compare January 31, 2025 07:59
if (options.injectFetchProxyScript == null) {
try {
// @ts-expect-error - the dynamic import is fine here
const { VERSION } = await import('@sveltejs/kit');
Copy link
Member

Choose a reason for hiding this comment

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

l: Does it make sense to cache this somewhere? 🤔

Copy link
Member Author

@Lms24 Lms24 Jan 31, 2025

Choose a reason for hiding this comment

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

We do :) options.injectFetchProxyScript will only be set once

Copy link
Member

@andreiborza andreiborza left a comment

Choose a reason for hiding this comment

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

LGTM

@Lms24 Lms24 merged commit d9b7543 into develop Jan 31, 2025
122 checks passed
@Lms24 Lms24 deleted the lms/feat-sveltekit-check-version-for-proxy-script-inject branch January 31, 2025 09:18
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.

Only inject fetch proxy script if SvelteKit<2.16.0 is used
3 participants