-
-
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
feat: Add PlatformOrGuideName
and PlatformSdkPackageName
components
#9200
feat: Add PlatformOrGuideName
and PlatformSdkPackageName
components
#9200
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
- Install the <PlatformSdkPackageName fallback="@sentry/browser"/> SDK, minimum version 7.60.0 | ||
- Configure the document response header to include `Document-Policy: js-profiling` | ||
- Configure the SDK to use the `BrowserProfilingIntegration` and set `profilesSampleRate` | ||
|
||
## Step 1: Install the JavaScript Browser SDK | ||
## Step 1: Install the <PlatformOrGuideName/> SDK | ||
|
||
<PlatformSection notSupported={["javascript.electron"]}> | ||
|
||
Install our JavaScript browser SDK using either `yarn` or `npm`, the minimum version that supports profiling is **7.60.0**. | ||
Install our <PlatformOrGuideName/> SDK using either `yarn` or `npm`, the minimum version that supports profiling is **7.60.0**. |
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.
This is the concrete use case I want to fix (which was reported by our sales engineers today in Slack).
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.
Concept sounds great to me. Commented re: one suspicious line, otherwise LGTM!
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! 🚢
This PR adds two components that return the name and SDK package name of the currently selected platform.
PlatformSdkPackageName
returns the package name, e.g.@sentry/nextjs
PlatformOrGuideName
returns the name of the currently selected platform or guide, e.g.Next.JS
Motivation: We have a lot of pages where we statically write a package name (e.g.
@sentry/browser
) which doesn't change when users select a guide (e.g. NextJS). This leads to confusion. Reportedly from SEs, thought they'd need to install and initialize the browser SDK in addition to the NextJS SDK.Alternatives: Sure, we could also copy the guide per platform (IIRC we did this for Replay a while back) but it's arguably more work if the changes between these files are literally the name of a package or framework.
Let me know what you think, happy to adjust or close this if you have better ideas!
Example page with dynamic sdk/platform name
PS: Please assume I know next to nothing about NextJS or RSC when reviewing this PR ;)