feat(solidstart)!: Default to --import setup and add autoInjectServerSentry#14862
Merged
feat(solidstart)!: Default to --import setup and add autoInjectServerSentry#14862
--import setup and add autoInjectServerSentry#14862Conversation
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 |
andreiborza
reviewed
Jan 7, 2025
Comment on lines
+14
to
+15
| // The first page load causes a hydration error on the dev server sometimes - a reload works around this | ||
| await page.reload(); |
Member
There was a problem hiding this comment.
m: Is this an issue again? We aren't using the dev server right?
Comment on lines
+18
to
+24
| // 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)); |
Member
There was a problem hiding this comment.
q: Is this still relevant now that we copy over the release injection files? We probably want to have debug id injections now.
Comment on lines
+14
to
+15
| // The first page load causes a hydration error on the dev server sometimes - a reload works around this | ||
| await page.reload(); |
Member
There was a problem hiding this comment.
l: Is this still relevant? We aren't using the dev mode anymore right?
Comment on lines
+18
to
+24
| // 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)); |
Member
There was a problem hiding this comment.
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
s1gr1d
added a commit
that referenced
this pull request
Jan 10, 2025
…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 <andrei.borza@sentry.io>
3 tasks
s1gr1d
added a commit
that referenced
this pull request
Jan 22, 2025
…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 <andrei.borza@sentry.io>
s1gr1d
added a commit
that referenced
this pull request
Jan 22, 2025
…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 <andrei.borza@sentry.io> (cherry picked from commit 38ff6eb)
s1gr1d
added a commit
that referenced
this pull request
Jan 23, 2025
…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 <andrei.borza@sentry.io>
s1gr1d
added a commit
that referenced
this pull request
Jan 23, 2025
…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 <andrei.borza@sentry.io> (cherry picked from commit 38ff6eb)
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 a
withSentrywrapper for SolidStart's config to build and placeinstrument.server.tsalongside the server build output so that it doesn't have to be placed in/publicanymore to be discoverable.The setup is changed to be aligned with Nuxt.
First, the
instrument.server.tsfile 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:
--importCLI flag to their start command like this:node --import ./.output/server/instrument.server.mjs .output/server/index.mjsautoInjectServerSentry: '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