From 65923feb81342650f413af9e198eb34aca487434 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Mon, 18 Sep 2023 09:08:43 +0200 Subject: [PATCH 01/10] feat: Add Bun docs --- src/data/platforms.yml | 3 +++ .../getting-started-config/javascript.bun.mdx | 19 +++++++++++++++++++ .../javascript.bun.mdx | 4 ++++ .../javascript/guides/bun/config.yml | 8 ++++++++ 4 files changed, 34 insertions(+) create mode 100644 src/platform-includes/getting-started-config/javascript.bun.mdx create mode 100644 src/platform-includes/getting-started-install/javascript.bun.mdx create mode 100644 src/platforms/javascript/guides/bun/config.yml diff --git a/src/data/platforms.yml b/src/data/platforms.yml index be19539218fb7..6b2a575418ff2 100644 --- a/src/data/platforms.yml +++ b/src/data/platforms.yml @@ -107,3 +107,6 @@ type: language name: Dart case_style: camelCase +- slug: bun + type: framework + name: Bun diff --git a/src/platform-includes/getting-started-config/javascript.bun.mdx b/src/platform-includes/getting-started-config/javascript.bun.mdx new file mode 100644 index 0000000000000..f6f11ce779f29 --- /dev/null +++ b/src/platform-includes/getting-started-config/javascript.bun.mdx @@ -0,0 +1,19 @@ +Once installed, you can capture exceptions manually for now. + + + +It's not possible to capture unhandled exceptions, unhandled promise rejections now - Bun is working on adding support for it. +[Github Issue](https://github.com/oven-sh/bun/issues/5091) follow this issue. + + + + + +```javascript {tabTitle:ESM} +import * as Sentry from "@sentry/bun"; + +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tracesSampleRate: 1.0, +}); +``` \ No newline at end of file diff --git a/src/platform-includes/getting-started-install/javascript.bun.mdx b/src/platform-includes/getting-started-install/javascript.bun.mdx new file mode 100644 index 0000000000000..95fc467d4a3b1 --- /dev/null +++ b/src/platform-includes/getting-started-install/javascript.bun.mdx @@ -0,0 +1,4 @@ +```bash {tabTitle:Bun} +bun add @sentry/bun +``` + diff --git a/src/platforms/javascript/guides/bun/config.yml b/src/platforms/javascript/guides/bun/config.yml new file mode 100644 index 0000000000000..ee2cfc7c3b8c8 --- /dev/null +++ b/src/platforms/javascript/guides/bun/config.yml @@ -0,0 +1,8 @@ +title: Bun +sdk: sentry.javascript.bun +fallbackPlatform: javascript +caseStyle: camelCase +supportLevel: production +categories: + - browser + - server From edfeb065b5b34cc59790acd8c87f6b4340938354 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 07:11:02 +0000 Subject: [PATCH 02/10] style(lint): Auto commit lint changes --- .../getting-started-config/javascript.bun.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform-includes/getting-started-config/javascript.bun.mdx b/src/platform-includes/getting-started-config/javascript.bun.mdx index f6f11ce779f29..bf0d99ced6e0d 100644 --- a/src/platform-includes/getting-started-config/javascript.bun.mdx +++ b/src/platform-includes/getting-started-config/javascript.bun.mdx @@ -1,4 +1,4 @@ -Once installed, you can capture exceptions manually for now. +Once installed, you can capture exceptions manually for now. @@ -16,4 +16,4 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", tracesSampleRate: 1.0, }); -``` \ No newline at end of file +``` From 5c7236d4bbb10daa8e8a0e31a18506ec0a9362c0 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 07:11:02 +0000 Subject: [PATCH 03/10] style(lint): Auto commit lint changes --- src/platform-includes/getting-started-install/javascript.bun.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/platform-includes/getting-started-install/javascript.bun.mdx b/src/platform-includes/getting-started-install/javascript.bun.mdx index 95fc467d4a3b1..9cb40312f4cc4 100644 --- a/src/platform-includes/getting-started-install/javascript.bun.mdx +++ b/src/platform-includes/getting-started-install/javascript.bun.mdx @@ -1,4 +1,3 @@ ```bash {tabTitle:Bun} bun add @sentry/bun ``` - From c7cdff4a65e5d40012f9da888c1e226a361b6750 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Mon, 18 Sep 2023 09:30:57 +0200 Subject: [PATCH 04/10] ref: Bun --- .../javascript.bun.mdx | 0 .../getting-started-verify/javascript.bun.mdx | 16 ++++++++++++++++ .../javascript/common/install/index.mdx | 1 + 3 files changed, 17 insertions(+) create mode 100644 src/platform-includes/getting-started-sourcemaps/javascript.bun.mdx create mode 100644 src/platform-includes/getting-started-verify/javascript.bun.mdx diff --git a/src/platform-includes/getting-started-sourcemaps/javascript.bun.mdx b/src/platform-includes/getting-started-sourcemaps/javascript.bun.mdx new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/src/platform-includes/getting-started-verify/javascript.bun.mdx b/src/platform-includes/getting-started-verify/javascript.bun.mdx new file mode 100644 index 0000000000000..7d76223a64426 --- /dev/null +++ b/src/platform-includes/getting-started-verify/javascript.bun.mdx @@ -0,0 +1,16 @@ +```javascript +const transaction = Sentry.startTransaction({ + op: "test", + name: "My First Test Transaction", +}); + +setTimeout(() => { + try { + foo(); + } catch (e) { + Sentry.captureException(e); + } finally { + transaction.finish(); + } +}, 99); +``` diff --git a/src/platforms/javascript/common/install/index.mdx b/src/platforms/javascript/common/install/index.mdx index fbf40ef81d04f..d78433334f660 100644 --- a/src/platforms/javascript/common/install/index.mdx +++ b/src/platforms/javascript/common/install/index.mdx @@ -4,6 +4,7 @@ sidebar_order: 1 description: "Review our alternate installation methods." notSupported: - javascript.angular + - javascript.bun - javascript.capacitor - javascript.cordova - javascript.electron From 8eea1f3ba94ea07b9b4e3ad724f57b48277c9940 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Mon, 18 Sep 2023 12:44:49 +0200 Subject: [PATCH 05/10] feat: Update bun docs --- .../javascript.bun.mdx | 1 + .../configure-sample-rate/javascript.bun.mdx | 17 +++++++++++++++++ .../javascript.bun.mdx | 17 +++++++++++++++++ .../enable-tracing/javascript.bun.mdx | 1 + .../javascript/common/profiling/index.mdx | 2 ++ 5 files changed, 38 insertions(+) create mode 100644 src/platform-includes/performance/automatic-instrumentation-intro/javascript.bun.mdx create mode 100644 src/platform-includes/performance/configure-sample-rate/javascript.bun.mdx create mode 100644 src/platform-includes/performance/enable-automatic-instrumentation/javascript.bun.mdx create mode 100644 src/platform-includes/performance/enable-tracing/javascript.bun.mdx diff --git a/src/platform-includes/performance/automatic-instrumentation-intro/javascript.bun.mdx b/src/platform-includes/performance/automatic-instrumentation-intro/javascript.bun.mdx new file mode 100644 index 0000000000000..ddddfb99d5822 --- /dev/null +++ b/src/platform-includes/performance/automatic-instrumentation-intro/javascript.bun.mdx @@ -0,0 +1 @@ +The Sentry SDK provides a `Tracing` integration to add automatic instrumentation for monitoring the performance of your application. diff --git a/src/platform-includes/performance/configure-sample-rate/javascript.bun.mdx b/src/platform-includes/performance/configure-sample-rate/javascript.bun.mdx new file mode 100644 index 0000000000000..973d6124220a0 --- /dev/null +++ b/src/platform-includes/performance/configure-sample-rate/javascript.bun.mdx @@ -0,0 +1,17 @@ + + +```javascript +import * as Sentry from "@sentry/bun"; + +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [new Sentry.Tracing()], + + // We recommend adjusting this value in production, or using tracesSampler + // for finer control + tracesSampleRate: 1.0, + + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], +}); +``` diff --git a/src/platform-includes/performance/enable-automatic-instrumentation/javascript.bun.mdx b/src/platform-includes/performance/enable-automatic-instrumentation/javascript.bun.mdx new file mode 100644 index 0000000000000..e502666b50172 --- /dev/null +++ b/src/platform-includes/performance/enable-automatic-instrumentation/javascript.bun.mdx @@ -0,0 +1,17 @@ +To enable tracing, include the `Tracing` integration in your SDK configuration options. + + + +```javascript +import * as Sentry from "@sentry/bun"; + +Sentry.init({ + dsn: "___PUBLIC_DSN___", + + integrations: [new Sentry.Tracing()], + + // We recommend adjusting this value in production, or using tracesSampler + // for finer control + tracesSampleRate: 1.0, +}); +``` diff --git a/src/platform-includes/performance/enable-tracing/javascript.bun.mdx b/src/platform-includes/performance/enable-tracing/javascript.bun.mdx new file mode 100644 index 0000000000000..7a277149ea14f --- /dev/null +++ b/src/platform-includes/performance/enable-tracing/javascript.bun.mdx @@ -0,0 +1 @@ +Tracing is available by default in the Sentry Bun. diff --git a/src/platforms/javascript/common/profiling/index.mdx b/src/platforms/javascript/common/profiling/index.mdx index 054de7d0ca93e..d7a0e81c6fd49 100644 --- a/src/platforms/javascript/common/profiling/index.mdx +++ b/src/platforms/javascript/common/profiling/index.mdx @@ -3,6 +3,8 @@ title: Profiling sidebar_order: 1 supported: - javascript +notSupported: + - javascript.bun description: "Learn what transactions are captured after tracing is enabled." --- From 4bdf91190dc630238571eddc68cde70ed5f5b094 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Tue, 19 Sep 2023 14:28:48 +0200 Subject: [PATCH 06/10] feat: Add icon to Platform --- package.json | 2 +- src/components/guideGrid.tsx | 2 +- src/components/hooks/usePlatform.tsx | 2 ++ src/components/navbarPlatformDropdown.tsx | 4 ++-- src/components/platformGrid.tsx | 2 +- src/components/platformLinkWithLogo.tsx | 2 +- src/gatsby/createSchemaCustomization/platformSchema.ts | 2 ++ src/pages/index.tsx | 6 +++++- src/pages/platform-redirect.tsx | 2 +- src/platforms/javascript/guides/bun/config.yml | 1 + src/types/platform.tsx | 4 ++++ yarn.lock | 8 ++++---- 12 files changed, 25 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 9c3110dd99972..4a259f238c291 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "js-cookie": "^3.0.5", "js-yaml": "^3.0.0", "jsdom": "^22.1.0", - "platformicons": "^5.6.0", + "platformicons": "^5.6.4", "prism-sentry": "^1.0.2", "prismjs": "^1.27.0", "query-string": "^6.13.1", diff --git a/src/components/guideGrid.tsx b/src/components/guideGrid.tsx index baab81d7a602f..9cf6e1e70b9b3 100644 --- a/src/components/guideGrid.tsx +++ b/src/components/guideGrid.tsx @@ -26,7 +26,7 @@ export function GuideGrid({platform, className}: Props) {
  • diff --git a/src/components/hooks/usePlatform.tsx b/src/components/hooks/usePlatform.tsx index 61680c0bf478c..338889703262f 100644 --- a/src/components/hooks/usePlatform.tsx +++ b/src/components/hooks/usePlatform.tsx @@ -17,6 +17,7 @@ const query = graphql` title url sdk + icon caseStyle supportLevel fallbackPlatform @@ -26,6 +27,7 @@ const query = graphql` name title url + icon sdk caseStyle supportLevel diff --git a/src/components/navbarPlatformDropdown.tsx b/src/components/navbarPlatformDropdown.tsx index d3e75ba635f79..5f557ef1534a4 100644 --- a/src/components/navbarPlatformDropdown.tsx +++ b/src/components/navbarPlatformDropdown.tsx @@ -14,7 +14,7 @@ export function NavbarPlatformDropdown() { currentPlatform ? ( diff --git a/src/components/platformLinkWithLogo.tsx b/src/components/platformLinkWithLogo.tsx index 0ad1c5e222700..3e3aee723dba1 100644 --- a/src/components/platformLinkWithLogo.tsx +++ b/src/components/platformLinkWithLogo.tsx @@ -21,7 +21,7 @@ export function PlatformLinkWithLogo({platform, label, url}: Props) { { categories: [PlatformCategory!] url: String! fallbackPlatform: String! + icon: String } type Platform implements Node { @@ -44,6 +45,7 @@ export const getPlatformTypeDefs = () => { categories: [PlatformCategory!] url: String! fallbackPlatform: String + icon: String } `, ]; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 9fb8d01457e7a..5f7b30ccc0335 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -128,7 +128,11 @@ function IndexPage() { {visiblePlatforms.map(platform => (
    - +
    {platform.title}
    diff --git a/src/pages/platform-redirect.tsx b/src/pages/platform-redirect.tsx index d00770dfccc67..3f9fd5c1a6e88 100644 --- a/src/pages/platform-redirect.tsx +++ b/src/pages/platform-redirect.tsx @@ -29,7 +29,7 @@ function BasePlatformRedirect({path = '/'}: Props) { diff --git a/src/platforms/javascript/guides/bun/config.yml b/src/platforms/javascript/guides/bun/config.yml index ee2cfc7c3b8c8..2745973fb2540 100644 --- a/src/platforms/javascript/guides/bun/config.yml +++ b/src/platforms/javascript/guides/bun/config.yml @@ -3,6 +3,7 @@ sdk: sentry.javascript.bun fallbackPlatform: javascript caseStyle: camelCase supportLevel: production +icon: bun categories: - browser - server diff --git a/src/types/platform.tsx b/src/types/platform.tsx index 59c7268677222..faa3a55aeb510 100644 --- a/src/types/platform.tsx +++ b/src/types/platform.tsx @@ -96,6 +96,10 @@ export interface PlatformConfig { * inherit configuration values from the parent platform. */ fallbackPlatform?: string; + /** + * The icon to use for this platform. This is the name of the icon as defined + */ + icon?: string; /** * Keywords used for search etc. */ diff --git a/yarn.lock b/yarn.lock index ab5a05f5f4868..377c062617da6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12162,10 +12162,10 @@ platform@^1.3.6: resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7" integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg== -platformicons@^5.6.0: - version "5.6.2" - resolved "https://registry.yarnpkg.com/platformicons/-/platformicons-5.6.2.tgz#24d109e56c3dcedbac513f5b8fa73335e0eddd1e" - integrity sha512-2X/cWYohEqVAMQiz/MCVjgJaFEX/jiSXncqcgnMztPcsCSL5JpLn4d8CBeSBjpMIDTlCvGF90p0vM0oc7yGTpA== +platformicons@^5.6.4: + version "5.6.4" + resolved "https://registry.yarnpkg.com/platformicons/-/platformicons-5.6.4.tgz#1c5b5aa410ea3f4a5113214863c08b7a5d7e5fc8" + integrity sha512-Mx6EEBC0XuwY7RU8Qa7YCdjhXj0QV7aFx1gYyBH8iEzz7uCLQmP7gj9WLfEu1WGo69AeJlkTjX6ViiEfTbUZOQ== dependencies: "@types/node" "*" "@types/react" "*" From d6d501247610ddc6db46f557ff797f3856331198 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Wed, 20 Sep 2023 13:51:04 +0200 Subject: [PATCH 07/10] ref: Remove auto instrumentation hint --- .../getting-started-config/javascript.bun.mdx | 8 -------- .../getting-started-primer/javascript.bun.mdx | 7 +++++++ src/platforms/common/index.mdx | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 src/platform-includes/getting-started-primer/javascript.bun.mdx diff --git a/src/platform-includes/getting-started-config/javascript.bun.mdx b/src/platform-includes/getting-started-config/javascript.bun.mdx index bf0d99ced6e0d..bb7b3474a4667 100644 --- a/src/platform-includes/getting-started-config/javascript.bun.mdx +++ b/src/platform-includes/getting-started-config/javascript.bun.mdx @@ -1,12 +1,4 @@ Once installed, you can capture exceptions manually for now. - - - -It's not possible to capture unhandled exceptions, unhandled promise rejections now - Bun is working on adding support for it. -[Github Issue](https://github.com/oven-sh/bun/issues/5091) follow this issue. - - - ```javascript {tabTitle:ESM} diff --git a/src/platform-includes/getting-started-primer/javascript.bun.mdx b/src/platform-includes/getting-started-primer/javascript.bun.mdx new file mode 100644 index 0000000000000..08ff205ded79b --- /dev/null +++ b/src/platform-includes/getting-started-primer/javascript.bun.mdx @@ -0,0 +1,7 @@ + + + +It's not possible to capture unhandled exceptions, unhandled promise rejections now - Bun is working on adding support for it. +[Github Issue](https://github.com/oven-sh/bun/issues/5091) follow this issue. + + diff --git a/src/platforms/common/index.mdx b/src/platforms/common/index.mdx index 1986dc16db23a..649cc41e1abec 100644 --- a/src/platforms/common/index.mdx +++ b/src/platforms/common/index.mdx @@ -1,6 +1,6 @@ -On this page, we get you up and running with Sentry's SDK, so that it will automatically report errors and exceptions in your application. +On this page, we get you up and running with Sentry's SDK. From 8244754b59c05dd179e9fb905096ed2277c22a65 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:52:49 +0000 Subject: [PATCH 08/10] style(lint): Auto commit lint changes --- src/platform-includes/getting-started-config/javascript.bun.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform-includes/getting-started-config/javascript.bun.mdx b/src/platform-includes/getting-started-config/javascript.bun.mdx index bb7b3474a4667..c889539cb1335 100644 --- a/src/platform-includes/getting-started-config/javascript.bun.mdx +++ b/src/platform-includes/getting-started-config/javascript.bun.mdx @@ -1,4 +1,5 @@ Once installed, you can capture exceptions manually for now. + ```javascript {tabTitle:ESM} From 29f9452bcb9bc33eb05a663f7585c01ea69751e2 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:55:02 +0000 Subject: [PATCH 09/10] style(lint): Auto commit lint changes --- src/platform-includes/getting-started-primer/javascript.bun.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/platform-includes/getting-started-primer/javascript.bun.mdx b/src/platform-includes/getting-started-primer/javascript.bun.mdx index 08ff205ded79b..6ab4b5e0495d2 100644 --- a/src/platform-includes/getting-started-primer/javascript.bun.mdx +++ b/src/platform-includes/getting-started-primer/javascript.bun.mdx @@ -1,4 +1,3 @@ - It's not possible to capture unhandled exceptions, unhandled promise rejections now - Bun is working on adding support for it. From bc460ef82dd986499436e0b92e6c40dd0ac4595a Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Wed, 20 Sep 2023 14:05:18 +0200 Subject: [PATCH 10/10] ref: Add Beta --- .../getting-started-primer/javascript.bun.mdx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/platform-includes/getting-started-primer/javascript.bun.mdx b/src/platform-includes/getting-started-primer/javascript.bun.mdx index 6ab4b5e0495d2..eb4697d019d60 100644 --- a/src/platform-includes/getting-started-primer/javascript.bun.mdx +++ b/src/platform-includes/getting-started-primer/javascript.bun.mdx @@ -1,6 +1,12 @@ + + +The Bun SDK is currently in Beta. + + + -It's not possible to capture unhandled exceptions, unhandled promise rejections now - Bun is working on adding support for it. +It's not possible to capture global unhandled exceptions, unhandled promise rejections now - Bun is working on adding support for it. [Github Issue](https://github.com/oven-sh/bun/issues/5091) follow this issue.