getsentry / sentry-docs

Sentry's documentation (and tools to build it)
https://docs.sentry.io
Other
332 stars 1.46k forks source link

Figure out how to encourage vanilla TypeScript users to use npm package for browser SDK #11712

Open AbhiPrasad opened 1 week ago

AbhiPrasad commented 1 week ago

SDK

JavaScript SDK

Description

As was raised in https://github.com/getsentry/sentry-javascript/issues/5409#issuecomment-2448439732, folks who use TypeScript probably should use the npm package @sentry/browser for the best experience, but currently our docs + onboarding pushes them to use the loader/cdn.

This is not a great experience because the CDN/loader isn't typed, and because of the permutations of the CDN bundles the types are hard to figure out (tracing bundle vs. replay bundle).

Suggested Solution

We should have a flow in onboarding where if you are using a vanilla js app with TypeScript we encourage you to use the npm bundle.

matejminar commented 3 days ago

Makes perfect sense! Two quick solutions that come to my mind (product-wise) are:

  1. We add another switch above Loader/NPM to choose between JavaScript/Typescript (choosing TS will preselect NPM or won't even show the second switch) Image

  2. We add Typescript to this screen: Image

@AbhiPrasad Do you have any preferences or different suggestions?