-
-
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)!: Default to --import
setup and add autoInjectServerSentry
#14862
Conversation
autoInjectServerSentry
autoInjectServerSentry
--import
setup and add autoInjectServerSentry
e7b59a0
to
b402fe1
Compare
❌ 3 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
// The first page load causes a hydration error on the dev server sometimes - a reload works around this | ||
await page.reload(); |
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: Is this an issue again? We aren't using the dev server right?
// TODO: Ensure this file is source mapped too. | ||
// Placing this after the sentry vite plugin means this | ||
// file won't get a sourcemap and won't have a debug id injected. | ||
// Because the file is just copied over to the output server | ||
// directory the release injection file from sentry vite plugin | ||
// wouldn't resolve correctly otherwise. | ||
sentryPlugins.push(makeBuildInstrumentationFilePlugin(options)); |
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.
q: Is this still relevant now that we copy over the release injection files? We probably want to have debug id injections now.
// The first page load causes a hydration error on the dev server sometimes - a reload works around this | ||
await page.reload(); |
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: Is this still relevant? We aren't using the dev mode anymore right?
// TODO: Ensure this file is source mapped too. | ||
// Placing this after the sentry vite plugin means this | ||
// file won't get a sourcemap and won't have a debug id injected. | ||
// Because the file is just copied over to the output server | ||
// directory the release injection file from sentry vite plugin | ||
// wouldn't resolve correctly otherwise. | ||
sentryPlugins.push(makeBuildInstrumentationFilePlugin(options)); |
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: Now that we copy over release injection files, we should ensure that the instrumentation file is also properly injected with debug ids right?
…instrumentation files
0d73fd9
to
60dacf6
Compare
60dacf6
to
333d210
Compare
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.
LGTM
…import` (#14863)⚠️ THIS PR IS BASED ON #14862 Adds the option to dynamically import the server config file. ```typescript // app.config.ts import { defineConfig } from '@solidjs/start/config'; import { sentrySolidStartVite, withSentry } from '@sentry/solidstart'; export default defineConfig(withSentry( { /* ... */ }, { autoInjectServerSentry: 'experimental_dynamic-import' }) ); ``` --------- Co-authored-by: Andrei Borza <[email protected]>
…erSentry` (#14862) This PR adds a `withSentry` wrapper for SolidStart's config to build and place `instrument.server.ts` alongside the server build output so that it doesn't have to be placed in `/public` anymore to be discoverable. The setup is changed to be aligned with Nuxt. First, the `instrument.server.ts` file is added to the build output (the sentry release injection file needs to be copied as well - this is not ideal at the moment as there **could** be other imports as well, but it's okay for now) Then, there are two options to set up the SDK: 1. Users provide an `--import` CLI flag to their start command like this: ```node --import ./.output/server/instrument.server.mjs .output/server/index.mjs``` 2. Users can add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry ```typescript // app.config.ts import { defineConfig } from '@solidjs/start/config'; import { withSentry } from '@sentry/solidstart'; export default defineConfig(withSentry( { /* ... */ }, { autoInjectServerSentry: 'top-level-import' // optional }) ); ``` --- builds on top of the idea in this PR: #13784 --------- Co-authored-by: Andrei Borza <[email protected]>
…import` (#14863)⚠️ THIS PR IS BASED ON #14862 Adds the option to dynamically import the server config file. ```typescript // app.config.ts import { defineConfig } from '@solidjs/start/config'; import { sentrySolidStartVite, withSentry } from '@sentry/solidstart'; export default defineConfig(withSentry( { /* ... */ }, { autoInjectServerSentry: 'experimental_dynamic-import' }) ); ``` --------- Co-authored-by: Andrei Borza <[email protected]> (cherry picked from commit 38ff6eb)
…erSentry` (#14862) This PR adds a `withSentry` wrapper for SolidStart's config to build and place `instrument.server.ts` alongside the server build output so that it doesn't have to be placed in `/public` anymore to be discoverable. The setup is changed to be aligned with Nuxt. First, the `instrument.server.ts` file is added to the build output (the sentry release injection file needs to be copied as well - this is not ideal at the moment as there **could** be other imports as well, but it's okay for now) Then, there are two options to set up the SDK: 1. Users provide an `--import` CLI flag to their start command like this: ```node --import ./.output/server/instrument.server.mjs .output/server/index.mjs``` 2. Users can add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry ```typescript // app.config.ts import { defineConfig } from '@solidjs/start/config'; import { withSentry } from '@sentry/solidstart'; export default defineConfig(withSentry( { /* ... */ }, { autoInjectServerSentry: 'top-level-import' // optional }) ); ``` --- builds on top of the idea in this PR: #13784 --------- Co-authored-by: Andrei Borza <[email protected]>
…import` (#14863)⚠️ THIS PR IS BASED ON #14862 Adds the option to dynamically import the server config file. ```typescript // app.config.ts import { defineConfig } from '@solidjs/start/config'; import { sentrySolidStartVite, withSentry } from '@sentry/solidstart'; export default defineConfig(withSentry( { /* ... */ }, { autoInjectServerSentry: 'experimental_dynamic-import' }) ); ``` --------- Co-authored-by: Andrei Borza <[email protected]> (cherry picked from commit 38ff6eb)
…15135) Backport of #14862 and #14863 --------- Co-authored-by: Andrei Borza <[email protected]>
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.The setup is changed to be aligned with Nuxt.
First, the
instrument.server.ts
file is added to the build output (the sentry release injection file needs to be copied as well - this is not ideal at the moment as there could be other imports as well, but it's okay for now)Then, there are two options to set up the SDK:
--import
CLI flag to their start command like this:node --import ./.output/server/instrument.server.mjs .output/server/index.mjs
autoInjectServerSentry: 'top-level-import'
and the Sentry config will be imported at the top of the server entrybuilds on top of the idea in this PR: #13784