-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
docs(solidstart): Add SolidStart SDK #11071
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Bundle ReportChanges will increase total bundle size by 21.17kB ⬆️
|
To get started, import `solidRouterBrowserTracingIntegration` from `@sentry/solidstart/solidrouter` and add it to `Sentry.init` | ||
instead of the regular `Sentry.browserTracingIntegration` to enable performance tracing. |
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.
Just a general question: Isn't the browserTracingIntegration
always included? Not sure if there was a PR for solidstart as well.
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.
It's not yet, I should create an issue for that.
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.
|
||
### Server-side Setup | ||
|
||
Create an instrument file `instrument.server.mjs` and initialize the Sentry SDK. |
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: Specify, where this file should be located. If it isn't root, you can also add the path to the filename in the code snippet.
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.
Updated
|
||
### Client-side Setup | ||
|
||
Initialize the Sentry SDK in your `entry-client.tsx` 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.
M: Specify, where this file should be located. And maybe also add jsx
(or any other supported file endings)
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.
Not sure we can/should specify the location. It depends on project structure, I think it's clear to people who have created a SolidStart project where this is located.
Also was considering the jsx
but feels pointless as the code here isn't really different. Can add tho, no strong feeligns.
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.
Updated
|
||
### Instrumentation | ||
|
||
Complete the setup by adding the Sentry middleware to your `middleware.ts` file. If you don't have a `middleware.ts` file yet, create one: |
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.
You could link to the middleware docs here (for people who don't have this file yet, this might be useful).
M: Also interesting here: Where should this be located
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.
Location again depends on the project structure. I could default it to src
but feel like it doesn't really add any extra info.
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.
Rewrote this section a bit, added the link and location of the middleware file.
Add an `--import` flag to the `NODE_OPTIONS` environment variable wherever you run your application. | ||
|
||
```bash {tabTitle: npm} | ||
NODE_OPTIONS='--import=./src/instrument.server.mjs npm start | ||
``` | ||
|
||
```bash {tabTitle: yarn} | ||
NODE_OPTIONS='--import=./src/instrument.server.mjs yarn start | ||
``` | ||
|
||
```bash {tabTitle: pnpm} | ||
NODE_OPTIONS='--import=./src/instrument.server.mjs pnpm start | ||
``` |
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: Just a suggestion as I did this differently in the Nuxt docs (see here): I added the code of how it should look like in the package.json
. It might be easier to understand for users where they have to add it. I also included a version for when the app is started with node
(where you can directly add the --import
option without the env variable)
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.
That's a nice approach, will change!
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.
Updated but I opted not to use node
directly as it's not mentioned by SolidStart nor vinxi.
306c632
to
14b04df
Compare
7f16309
to
8b71354
Compare
@@ -73,7 +75,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori | |||
</PlatformSection> | |||
</PlatformCategorySection> | |||
|
|||
<PlatformSection notSupported={["javascript", "javascript.astro", "javascript.cordova", "javascript.nextjs", "javascript.nuxt", "javascript.remix", "javascript.sveltekit", "javascript.bun", "javascript.capacitor", "javascript.ember", "javascript.angular", "javascript.react", "javascript.solid", "javascript.svelte", "javascript.vue"]}> | |||
<PlatformSection notSupported={["javascript", "javascript.astro", "javascript.cordova", "javascript.nextjs", "javascript.nuxt", "javascript.remix", "javascript.solidstart", "javascript.sveltekit", "javascript.bun", "javascript.capacitor", "javascript.ember", "javascript.angular", "javascript.react", "javascript.solid", "javascript.solidstart", "javascript.svelte", "javascript.vue"]}> |
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.
<PlatformSection notSupported={["javascript", "javascript.astro", "javascript.cordova", "javascript.nextjs", "javascript.nuxt", "javascript.remix", "javascript.solidstart", "javascript.sveltekit", "javascript.bun", "javascript.capacitor", "javascript.ember", "javascript.angular", "javascript.react", "javascript.solid", "javascript.solidstart", "javascript.svelte", "javascript.vue"]}> | |
<PlatformSection notSupported={["javascript", "javascript.astro", "javascript.cordova", "javascript.nextjs", "javascript.nuxt", "javascript.remix", "javascript.solidstart", "javascript.sveltekit", "javascript.bun", "javascript.capacitor", "javascript.ember", "javascript.angular", "javascript.react", "javascript.solid", "javascript.svelte", "javascript.vue"]}> |
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.
solidstart is twice in this array
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.
Removed
DESCRIBE YOUR PR
Adds docs for our new SolidStart SDK.
Closes: getsentry/sentry-javascript#12556
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES