-
-
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(solidstart): Add withSentry
config wrapper
#13784
base: develop
Are you sure you want to change the base?
Conversation
5e1af7a
to
cc78ede
Compare
I'm investigating my claim in the note to reviewers. I might be wrong here and we can simplify to just using |
packages/solidstart/README.md
Outdated
If your `instrument.server.ts` file is not located in the `src` folder, you can specify the path via the | ||
`sentrySolidStartVite` plugin. |
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.
m: The option is instrumentation
right? You could add this here, so it is clear where the path can be specified.
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.
Thanks, I updated the readme to make this clearer.
packages/solidstart/README.md
Outdated
Sentry relies on running `instrument.server.ts` as early as possible. Add the `sentrySolidStartVite` plugin from | ||
`@sentry/solidstart` to your `app.config.ts`. This takes care of building `instrument.server.ts` and placing it | ||
alongside the server entry file. |
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: I would restructure this a little bit at it is hard to follow when reading it first. The first sentence says it relies on running the file as early as possible but the explanation for this comes later.
The proposed structure: do this -> why to do this -> what it does.
Sentry relies on running `instrument.server.ts` as early as possible. Add the `sentrySolidStartVite` plugin from | |
`@sentry/solidstart` to your `app.config.ts`. This takes care of building `instrument.server.ts` and placing it | |
alongside the server entry file. | |
Add the `sentrySolidStartVite` plugin from `@sentry/solidstart` to your plugins in `app.config.ts`. Sentry relies on running `instrument.server.ts` as early as possible. The `sentrySolidStartVite` plugin builds the `instrument.server.ts` file and places it alongside the server entry file. |
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.
Thanks. I updated the readme and removed some of this explanation in favor of simplicity. Maybe this is better kept in the docs.
packages/solidstart/README.md
Outdated
|
||
To upload source maps, configure an auth token. Auth tokens can be passed to the plugin explicitly with the `authToken` | ||
option, with a `SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the working | ||
directory when building your project. We recommend you add the auth token to your CI/CD environment as an environment |
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.
directory when building your project. We recommend you add the auth token to your CI/CD environment as an environment | |
directory when building your project. We recommend adding the auth token to your CI/CD environment as an environment |
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.
Thanks, updated.
…instrumentation files
cc78ede
to
084f7f1
Compare
084f7f1
to
82e4c12
Compare
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky tests
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
This PR adds a
withSentry
wrapper for SolidStart's config to build and placeinstrument.server.ts
alongside the server build output so that it doesn't have to be placed in/public
anymore to be discoverable.It also adds an experimental option to top level import
instrument.server.ts
in the server entry file for platforms that currently do not support--import
, overriding the start command or setting scopedNODE_OPTIONS
(e.g. Vercel, Netlify (free version)).The configuration now looks like this:
Note to reviewers
Unfortunately, we need bothwithSentry
andsentrySolidStartVite
because SolidStart's config allows thevite
configuration to be a function that gets the current build target (i.e.server
,client
,server-fns
) passed in and we cannot add our plugin first for this case as the function would have to be executed (and thus run all predefined plugins) before we can add our plugin.The
sentrySolidStartVite
plugin is now automatically added bywithSentry
.Closes: #13785