Skip to content
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

Merged
merged 4 commits into from
Aug 26, 2024
Merged

docs(solidstart): Add SolidStart SDK #11071

merged 4 commits into from
Aug 26, 2024

Conversation

andreiborza
Copy link
Member

@andreiborza andreiborza commented Aug 13, 2024

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.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

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

Copy link

vercel bot commented Aug 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
changelog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 8:40am
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 8:40am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
develop-docs ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 8:40am

Copy link

codecov bot commented Aug 13, 2024

Bundle Report

Changes will increase total bundle size by 21.17kB ⬆️

Bundle name Size Change
sentry-docs-server 8.26MB 11.01kB ⬆️
sentry-docs-edge-server 254.34kB 3 bytes ⬇️
sentry-docs-client 6.26MB 10.16kB ⬆️

Comment on lines +13 to +14
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.
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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.
Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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)

Copy link
Member Author

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.

Copy link
Member Author

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:
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member Author

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.

Comment on lines 90 to 102
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
```
Copy link
Member

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)

Copy link
Member Author

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!

Copy link
Member Author

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.

@@ -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"]}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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"]}>

Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@andreiborza andreiborza merged commit 5b06282 into master Aug 26, 2024
11 checks passed
@andreiborza andreiborza deleted the ab/solidstart-docs branch August 26, 2024 08:57
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add solidstart SDK docs
3 participants