-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Lms24
merged 10 commits into
develop
from
lms/feat-sveltekit-check-version-for-proxy-script-inject
Jan 31, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a043643
feat(sveltekit): Only inject fetch proxy script for SvelteKit < 2.16.0
Lms24 fcaaff3
format
Lms24 f65ac01
change exports - does this fix tests?
Lms24 85ad7bc
test
Lms24 e9dd1fe
revert exports
Lms24 725eb2b
try cached dynamic import in handler
Lms24 95917b2
cleanup and e2e test
Lms24 52cd25f
fix test
Lms24 0b53e27
add e2e tests to check for fetch proxy on versions 2.5.0 and ^2.16.0
Lms24 4896a82
rename e2e test app
Lms24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
dev-packages/e2e-tests/test-applications/sveltekit-2.5.0-twp/tests/sdk.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { expect, test } from '@playwright/test'; | ||
|
||
test.describe('SDK-internal behavior', () => { | ||
test('Injects fetch proxy script for SvelteKit<2.16.0', async ({ page }) => { | ||
await page.goto('/'); | ||
|
||
const sentryCarrier = await page.evaluate('typeof window.__SENTRY__'); | ||
const proxyHandle = await page.evaluate('typeof window._sentryFetchProxy'); | ||
|
||
// sanity check | ||
expect(sentryCarrier).toBe('object'); | ||
|
||
// fetch proxy script ran | ||
expect(proxyHandle).toBe('function'); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
dev-packages/e2e-tests/test-applications/sveltekit-2/tests/sdk.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { waitForInitialPageload } from './utils'; | ||
|
||
test.describe('SDK-internal behavior', () => { | ||
test("Doesn't inject fetch proxy script for SvelteKit>=2.16.0", async ({ page }) => { | ||
await waitForInitialPageload(page, { route: '/' }); | ||
const sentryCarrier = await page.evaluate('typeof window.__SENTRY__'); | ||
const proxyHandle = await page.evaluate('typeof window._sentryFetchProxy'); | ||
|
||
// sanity check | ||
expect(sentryCarrier).toBe('object'); | ||
|
||
// fetch proxy script didn't run | ||
expect(proxyHandle).toBe('undefined'); | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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? 🤔
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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