Skip to content

Commit 653f750

Browse files
authored
feat(js): Document new bundle varieties (#4842)
A number of PRs (see below) have recently added to the bundles available for use on the CDN. This documents the new options, and does some general wordsmithing on the page. Bundle-adding PRs: getsentry/sentry-javascript#4674 getsentry/sentry-javascript#4699 getsentry/sentry-javascript#4718
1 parent 08c3e2d commit 653f750

File tree

1 file changed

+17
-5
lines changed
  • src/platforms/javascript/common/install

1 file changed

+17
-5
lines changed

src/platforms/javascript/common/install/cdn.mdx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: "Learn how Sentry supports loading its JavaScript SDK via a CDN."
66

77
import JsBundleList from "~src/components/jsBundleList";
88

9-
Sentry supports loading its JavaScript SDK via a CDN. Generally we suggest using our npm package (`@sentry/browser`) as utilizing a CDN create scenarios where Sentry is unable to load due to networking issues or common extensions like ad blockers. If you _must_ use a CDN, take a look at [loading Sentry lazily with our JS loader](../lazy-load-sentry/).
9+
Sentry supports loading the JavaScript SDK from a CDN. Generally we suggest using our npm package (`@sentry/browser`) instead, as using the CDN can create scenarios where Sentry is unable to load due to networking issues or common extensions like ad blockers. If you _must_ use a CDN, take a look at [loading Sentry lazily with our JS loader](../lazy-load-sentry/), which provides a deferred version of our minified ES5 browser bundle. To see what other bundles are available, see [Available Bundles](#available-bundles) below.
1010

1111
```html {tabTitle: CDN}
1212
<script
@@ -18,7 +18,7 @@ Sentry supports loading its JavaScript SDK via a CDN. Generally we suggest using
1818

1919
## Performance Bundle
2020

21-
To use Sentry's performance tracing an alternative bundle is needed. This allows us to keep the filesize down for users who only need error monitoring.
21+
To use Sentry's performance tracing, an alternative bundle is needed. This allows us to keep the filesize down for users who only need error monitoring.
2222

2323
```html {tabTitle: CDN}
2424
<script
@@ -34,12 +34,12 @@ You only need to load `bundle.tracing.min.js`, which provides both error and per
3434

3535
</Note>
3636

37-
The most important thing to note here is that `Sentry.Integrations` has been made available, and can be referenced in your call to `Sentry.init`:
37+
Once you've included the Sentry SDK bundle in your page, you can use Sentry in your own bundle:
3838

3939
```javascript {tabTitle: CDN}
4040
Sentry.init({
4141
dsn: "___PUBLIC_DSN___",
42-
// this assumes your build process sets "npm_package_version" in the env
42+
// this assumes your build process replaces `process.env.npm_package_version` with a value
4343
release: "my-project-name@" + process.env.npm_package_version,
4444
integrations: [new Sentry.BrowserTracing()],
4545

@@ -51,7 +51,19 @@ Sentry.init({
5151

5252
## Available Bundles
5353

54-
A variety of bundles are provided which are optimized for Sentry's various integrations.
54+
Our CDN hosts a variety of bundles:
55+
56+
- `@sentry/browser` (named `bundle.<modifiers>.js`)
57+
- `@sentry/browser` and `@sentry/tracing` together (named `bundle.tracing.<modifiers>.js`)
58+
- each of the integrations in `@sentry/integrations` (named `<integration-name>.<modifiers>.js`)
59+
60+
Each bundle is offered in both ES5 and ES6 versions, and for each version there are three bundle varieties: unminified, minified, and minified with debug logging. (That last version can be helpful for times when you need to debug an issue which only occurs in production. In a development environment, it makes most sense to use the unminified bundle, which always includes logging.)
61+
62+
For example:
63+
64+
- `bundle.js` is `@sentry/browser`, compiled to ES5 but not minified, with debug logging included (as it is for all unminified bundles)
65+
- `rewriteframes.es6.min.js` is the `RewriteFrames` integration, compiled to ES6 and minified, with no debug logging
66+
- `bundle.tracing.es6.debug.min.js` is `@sentry/browser` and `@sentry/tracing` bundled together, compiled to ES6 and minified, with debug logging included
5567

5668
<JsBundleList />
5769

0 commit comments

Comments
 (0)