-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(astro): Add sentryAstro
integration
#9218
Merged
Merged
Conversation
This file contains 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
Lms24
commented
Oct 10, 2023
mydea
reviewed
Oct 11, 2023
mydea
reviewed
Oct 11, 2023
mydea
reviewed
Oct 11, 2023
mydea
reviewed
Oct 11, 2023
mydea
reviewed
Oct 11, 2023
mydea
reviewed
Oct 11, 2023
mydea
approved these changes
Oct 11, 2023
Lms24
force-pushed
the
lms/feat-astro-integration
branch
from
October 12, 2023 12:34
4d2aa66
to
418380b
Compare
Closed
Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
Lms24
force-pushed
the
lms/feat-astro-integration
branch
from
October 12, 2023 13:45
418380b
to
811fd0b
Compare
size-limit report 📦
|
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 the
sentryAstro
Astro integration which will be the core component of the Astro SDK.The integration takes care of a few things:
clientInitPath
option is set, it will inject the file content from the specified file pathsentry.(client|server).config.(ts|js)
file is found in the root dir, the file content will be injectedThe idea is: Basic SDK setup will only require
sentryAstro
to be added by users. Everything else happens automatically. We also support a more custom setup but it will require additional config files. The reason is that we can only inject serialized code. We cannot take e.g. function callbacks (e.g.beforeSend
) in the options ofsentryAstro
.For more details how to set up the SDK, feel free to take a look at the README.
UPDATE: To satisfy Astros soft requirement of making the integration the default integration of the package, I decided to actually transiple the integration with the rest of the code. Therefore, I removed the "integration sync" logic that was initially in this PR. To make this work, I slightly adjusted our NPM rollup config to opt out of adding polyfills. These caused problems in Astro and are not necessary (Astro is Node 18+, so no need for polyfills injected by Sucrase).
This also means that this integration will be correctly installed when running
npx astro add @sentry/astro
. So we basically get half a wizard for free 🎉ref #9182