feat(sveltekit): Add SDK setup code#249
Merged
Lms24 merged 5 commits intolms/sveltekit-supportfrom Apr 19, 2023
Merged
Conversation
|
f85fcf8 to
7f7c37b
Compare
lforst
approved these changes
Apr 19, 2023
| // sessions when an error occurs. | ||
| replaysOnErrorSampleRate: 1.0, | ||
|
|
||
| integrations: [new Sentry.Replay()], |
There was a problem hiding this comment.
giga-l: Maybe a note that users can remove this if they don't intend to use replay? (bundle size and all)
| export const handle = sequence(sentryHandle); | ||
|
|
||
| // If you have a custom error handler, pass it to `handleErrorWithSentry` | ||
| export const handleError = handleErrorWithSentry(); No newline at end of file |
There was a problem hiding this comment.
super-giga-l: Do we wanna add a newline at the end of these template files? I think it's pretty common everywhere.
e1b5b8b to
4c1eb25
Compare
Base automatically changed from
lms/sveltekit-cli-config
to
lms/sveltekit-support
April 19, 2023 12:43
6429d39 to
5e4fc8c
Compare
Lms24
added a commit
that referenced
this pull request
Apr 19, 2023
Add basic SDK setup code generation to the wizard. During SDK setup, we distinguish between two cases for each SvelteKit (client and server) hook file: * If no hook file exists, we can just copy our hooks file template with the complete instrumentation. Great! 🎉 * If there is a pre-existing hooks file, we partially merge it with a Sentry import and init call and request additional manual intervention from the user
Lms24
added a commit
that referenced
this pull request
Apr 21, 2023
Add basic SDK setup code generation to the wizard. During SDK setup, we distinguish between two cases for each SvelteKit (client and server) hook file: * If no hook file exists, we can just copy our hooks file template with the complete instrumentation. Great! 🎉 * If there is a pre-existing hooks file, we partially merge it with a Sentry import and init call and request additional manual intervention from the user
Lms24
added a commit
that referenced
this pull request
May 3, 2023
Add basic SDK setup code generation to the wizard. During SDK setup, we distinguish between two cases for each SvelteKit (client and server) hook file: * If no hook file exists, we can just copy our hooks file template with the complete instrumentation. Great! 🎉 * If there is a pre-existing hooks file, we partially merge it with a Sentry import and init call and request additional manual intervention from the user
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds basic SDK setup code generation to the wizard.
During SDK setup, we distinguish between two cases for each SvelteKit (client and server) hook file:
With this PR, there are still
fourthree manual steps required to get the SDK working. The wizard will prompt the user to do each step with simple code examples:Theoretically, we can further automate the merging process, as well as adjusting the Vite config. However, this requires AST modification and before I start with that, I want to get this out. The goal is of course to get rid of all manual steps. A very promising library for AST manipulation is magicast 👀
Example flow without pre-existing hooks files:

#skip-changelog