Browse Source

ref(getting-started-docs): Clean up docs load (#53511)

Priscila Oliveira 1 year ago
parent
commit
9abf737088

+ 7 - 83
static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx

@@ -6,89 +6,6 @@ import {PlatformKey} from 'sentry/data/platformCategories';
 import type {Organization, PlatformIntegration, Project, ProjectKey} from 'sentry/types';
 import {useApiQuery} from 'sentry/utils/queryClient';
 
-// Documents already migrated from sentry-docs to main sentry repository
-export const migratedDocs = [
-  'javascript-react',
-  'javascript-remix',
-  'javascript-angular',
-  'javascript-vue',
-  'javascript-gatsby',
-  'javascript-ember',
-  'javascript-svelte',
-  'javascript-sveltekit',
-  'javascript-nextjs',
-  'javascript',
-  'python-django',
-  'python',
-  'python-flask',
-  'python-wsgi',
-  'python-tryton',
-  'python-tornado',
-  'python-starlette',
-  'python-serverless',
-  'python-sanic',
-  'python-quart',
-  'python-pyramid',
-  'python-pylons',
-  'python-gcpfunctions',
-  'python-falcon',
-  'python-chalice',
-  'python-bottle',
-  'python-fastapi',
-  'python-asgi',
-  'python-aiohttp',
-  'python-awslambda',
-  'dotnet',
-  'dotnet-aspnetcore',
-  'dotnet-awslambda',
-  'dotnet-gcpfunctions',
-  'dotnet-maui',
-  'dotnet-uwp',
-  'dotnet-winforms',
-  'dotnet-wpf',
-  'dotnet-xamarin',
-  'dotnet-aspnet',
-  'react-native',
-  'java',
-  'java-spring-boot',
-  'java-logback',
-  'java-log4j2',
-  'java-spring',
-  'php',
-  'php-laravel',
-  'php-symfony',
-  'go',
-  'rust',
-  'minidump',
-  'native',
-  'native-qt',
-  'ruby',
-  'ruby-rails',
-  'ruby-rack',
-  'kotlin',
-  'node',
-  'node-awslambda',
-  'node-azurefunctions',
-  'node-connect',
-  'node-express',
-  'node-gcpfunctions',
-  'node-koa',
-  'node-serverlesscloud',
-  'electron',
-  'elixir',
-  'android',
-  'ionic',
-  'unity',
-  'capacitor',
-  'cordova',
-  'unreal',
-  'apple',
-  'apple-ios',
-  'apple-macos',
-  'flutter',
-  'dart',
-];
-
 type SdkDocumentationProps = {
   activeProductSelection: ProductSolution[];
   organization: Organization;
@@ -120,6 +37,7 @@ export function SdkDocumentation({
     default: React.ComponentType<ModuleProps>;
   }>(null);
 
+  // TODO: This will be removed once we no longer rely on sentry-docs to load platform icons
   const platformPath =
     platform?.type === 'framework'
       ? platform.language === 'minidump'
@@ -141,6 +59,12 @@ export function SdkDocumentation({
         : platform?.id === 'dart'
         ? `dart/dart`
         : platform?.id.replace(`${platform.language}-`, `${platform.language}/`)
+      : platform?.id === 'python-celery'
+      ? `python/celery`
+      : platform?.id === 'python-rq'
+      ? `python/rq`
+      : platform?.id === 'python-pymongo'
+      ? `python/mongo`
       : `${platform?.language}/${platform?.id}`;
 
   const {

+ 2 - 0
static/app/data/platformCategories.tsx

@@ -117,6 +117,7 @@ export const backend = [
   'python-pyramid',
   'python-tornado',
   'python-rq',
+  'python-pymongo',
   'ruby',
   'ruby-rails',
   'ruby-rack',
@@ -295,6 +296,7 @@ export const releaseHealth: PlatformKey[] = [
   'python-pyramid',
   'python-tornado',
   'python-rq',
+  'python-pymongo',
   'rust',
   // serverless
   // desktop

+ 10 - 6
static/app/gettingStartedDocs/java/java.tsx

@@ -7,12 +7,16 @@ import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
 import {t, tct} from 'sentry/locale';
 
 // Configuration Start
-const introduction = tct(
-  'Sentry for Java is a collection of modules provided by Sentry; it supports Java 1.8 and above. At its core, Sentry for Java provides a raw client for sending events to Sentry. If you use [strong:Spring Boot, Spring, Logback, or Log4j2], we recommend visiting our Sentry Java documentation for installation instructions.',
-  {
-    strong: <strong />,
-    link: <ExternalLink href="https://docs.sentry.io/platforms/java/" />,
-  }
+const introduction = (
+  <p>
+    {tct(
+      'Sentry for Java is a collection of modules provided by Sentry; it supports Java 1.8 and above. At its core, Sentry for Java provides a raw client for sending events to Sentry. If you use [strong:Spring Boot, Spring, Logback, or Log4j2], we recommend visiting our Sentry Java documentation for installation instructions.',
+      {
+        strong: <strong />,
+        link: <ExternalLink href="https://docs.sentry.io/platforms/java/" />,
+      }
+    )}
+  </p>
 );
 
 export const steps = ({

+ 13 - 9
static/app/gettingStartedDocs/java/log4j2.tsx

@@ -7,15 +7,19 @@ import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
 import {t, tct} from 'sentry/locale';
 
 // Configuration Start
-const introduction = tct(
-  'The [code:sentry-log4j2] library provides [log4jLink:Log4j 2.x] support for Sentry via an [appenderLink:Appender] that sends logged exceptions to Sentry.',
-  {
-    log4jLink: <ExternalLink href="https://logging.apache.org/log4j/2.x//" />,
-    appenderLink: (
-      <ExternalLink href="https://logging.apache.org/log4j/2.x/manual/appenders.html" />
-    ),
-    code: <code />,
-  }
+const introduction = (
+  <p>
+    {tct(
+      'The [code:sentry-log4j2] library provides [log4jLink:Log4j 2.x] support for Sentry via an [appenderLink:Appender] that sends logged exceptions to Sentry.',
+      {
+        log4jLink: <ExternalLink href="https://logging.apache.org/log4j/2.x//" />,
+        appenderLink: (
+          <ExternalLink href="https://logging.apache.org/log4j/2.x/manual/appenders.html" />
+        ),
+        code: <code />,
+      }
+    )}
+  </p>
 );
 
 export const steps = ({

+ 11 - 7
static/app/gettingStartedDocs/java/logback.tsx

@@ -7,13 +7,17 @@ import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
 import {t, tct} from 'sentry/locale';
 
 // Configuration Start
-const introduction = tct(
-  'The sentry-logback library provides Logback support for Sentry using an [link:Appender] that sends logged exceptions to Sentry.',
-  {
-    link: (
-      <ExternalLink href="https://logback.qos.ch/apidocs/ch/qos/logback/core/Appender.html" />
-    ),
-  }
+const introduction = (
+  <p>
+    {tct(
+      'The sentry-logback library provides Logback support for Sentry using an [link:Appender] that sends logged exceptions to Sentry.',
+      {
+        link: (
+          <ExternalLink href="https://logback.qos.ch/apidocs/ch/qos/logback/core/Appender.html" />
+        ),
+      }
+    )}
+  </p>
 );
 
 export const steps = ({

+ 18 - 14
static/app/gettingStartedDocs/java/spring-boot.tsx

@@ -7,20 +7,24 @@ import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
 import {t, tct} from 'sentry/locale';
 
 // Configuration Start
-const introduction = tct(
-  "There are two variants of Sentry available for Spring Boot. If you're using Spring Boot 2, use [springBootStarterLink:sentry-spring-boot-starter]. If you're using Spring Boot 3, use [springBootStarterJakartaLink:sentry-spring-boot-starter-jakarta] instead. Sentry's integration with [springBootLink:Spring Boot] supports Spring Boot 2.1.0 and above to report unhandled exceptions as well as release and registration of beans. If you're on an older version, use [legacyIntegrationLink:our legacy integration].",
-  {
-    springBootStarterLink: (
-      <ExternalLink href="https://github.com/getsentry/sentry-java/tree/master/sentry-spring-boot-starter" />
-    ),
-    springBootStarterJakartaLink: (
-      <ExternalLink href="https://github.com/getsentry/sentry-java/tree/master/sentry-spring-boot-starter-jakarta" />
-    ),
-    springBootLink: <ExternalLink href="https://spring.io/projects/spring-boot" />,
-    legacyIntegrationLink: (
-      <ExternalLink href="https://docs.sentry.io/platforms/java/legacy/spring/" />
-    ),
-  }
+const introduction = (
+  <p>
+    {tct(
+      "There are two variants of Sentry available for Spring Boot. If you're using Spring Boot 2, use [springBootStarterLink:sentry-spring-boot-starter]. If you're using Spring Boot 3, use [springBootStarterJakartaLink:sentry-spring-boot-starter-jakarta] instead. Sentry's integration with [springBootLink:Spring Boot] supports Spring Boot 2.1.0 and above to report unhandled exceptions as well as release and registration of beans. If you're on an older version, use [legacyIntegrationLink:our legacy integration].",
+      {
+        springBootStarterLink: (
+          <ExternalLink href="https://github.com/getsentry/sentry-java/tree/master/sentry-spring-boot-starter" />
+        ),
+        springBootStarterJakartaLink: (
+          <ExternalLink href="https://github.com/getsentry/sentry-java/tree/master/sentry-spring-boot-starter-jakarta" />
+        ),
+        springBootLink: <ExternalLink href="https://spring.io/projects/spring-boot" />,
+        legacyIntegrationLink: (
+          <ExternalLink href="https://docs.sentry.io/platforms/java/legacy/spring/" />
+        ),
+      }
+    )}
+  </p>
 );
 
 export const steps = ({

+ 17 - 13
static/app/gettingStartedDocs/java/spring.tsx

@@ -7,19 +7,23 @@ import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
 import {t, tct} from 'sentry/locale';
 
 // Configuration Start
-const introduction = tct(
-  "There are two variants of Sentry available for Spring. If you're using Spring 5, use [sentrySpringLink:sentry-spring]. If you're using Spring 6, use [sentrySpringJakartaLink:sentry-spring-jakarta] instead. Sentry's integration with Spring supports Spring Framework 5.1.2 and above to report unhandled exceptions and optional user information. If you're on an older version, use [legacyIntegrationLink:our legacy integration].",
-  {
-    sentrySpringLink: (
-      <ExternalLink href="https://github.com/getsentry/sentry-java/tree/master/sentry-spring" />
-    ),
-    sentrySpringJakartaLink: (
-      <ExternalLink href="https://github.com/getsentry/sentry-java/tree/master/sentry-spring-jakarta" />
-    ),
-    legacyIntegrationLink: (
-      <ExternalLink href="https://docs.sentry.io/platforms/java/guides/spring/legacy/" />
-    ),
-  }
+const introduction = (
+  <p>
+    {tct(
+      "There are two variants of Sentry available for Spring. If you're using Spring 5, use [sentrySpringLink:sentry-spring]. If you're using Spring 6, use [sentrySpringJakartaLink:sentry-spring-jakarta] instead. Sentry's integration with Spring supports Spring Framework 5.1.2 and above to report unhandled exceptions and optional user information. If you're on an older version, use [legacyIntegrationLink:our legacy integration].",
+      {
+        sentrySpringLink: (
+          <ExternalLink href="https://github.com/getsentry/sentry-java/tree/master/sentry-spring" />
+        ),
+        sentrySpringJakartaLink: (
+          <ExternalLink href="https://github.com/getsentry/sentry-java/tree/master/sentry-spring-jakarta" />
+        ),
+        legacyIntegrationLink: (
+          <ExternalLink href="https://docs.sentry.io/platforms/java/guides/spring/legacy/" />
+        ),
+      }
+    )}
+  </p>
 );
 
 export const steps = ({

+ 15 - 11
static/app/gettingStartedDocs/kotlin/kotlin.tsx

@@ -7,17 +7,21 @@ import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
 import {t, tct} from 'sentry/locale';
 
 // Configuration Start
-const introduction = tct(
-  "Sentry supports Kotlin for both JVM and [Android. This wizard guides you through set up in the JVM scenario. If you're interested in [strong:Android], head over to the [gettingStartedWithAndroidLink:Getting Started] for that SDK instead. At its core, Sentry for Java provides a raw client for sending events to Sentry. If you use [strong:Spring Boot, Spring, Logback, JUL, or Log4j2], head over to our [gettingStartedWithJavaLink:Getting Started for Sentry Java].",
-  {
-    gettingStartedWithAndroidLink: (
-      <ExternalLink href="https://docs.sentry.io/platforms/android/" />
-    ),
-    gettingStartedWithJavaLink: (
-      <ExternalLink href="https://docs.sentry.io/platforms/java/" />
-    ),
-    strong: <strong />,
-  }
+const introduction = (
+  <p>
+    {tct(
+      "Sentry supports Kotlin for both JVM and [Android. This wizard guides you through set up in the JVM scenario. If you're interested in [strong:Android], head over to the [gettingStartedWithAndroidLink:Getting Started] for that SDK instead. At its core, Sentry for Java provides a raw client for sending events to Sentry. If you use [strong:Spring Boot, Spring, Logback, JUL, or Log4j2], head over to our [gettingStartedWithJavaLink:Getting Started for Sentry Java].",
+      {
+        gettingStartedWithAndroidLink: (
+          <ExternalLink href="https://docs.sentry.io/platforms/android/" />
+        ),
+        gettingStartedWithJavaLink: (
+          <ExternalLink href="https://docs.sentry.io/platforms/java/" />
+        ),
+        strong: <strong />,
+      }
+    )}
+  </p>
 );
 
 export const steps = ({

+ 7 - 3
static/app/gettingStartedDocs/php/symfony.tsx

@@ -7,9 +7,13 @@ import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
 import {t, tct} from 'sentry/locale';
 
 // Configuration Start
-const introduction = tct(
-  'Symfony is supported via the [code:sentry-symfony] package as a native bundle.',
-  {code: <code />}
+const introduction = (
+  <p>
+    {tct(
+      'Symfony is supported via the [code:sentry-symfony] package as a native bundle.',
+      {code: <code />}
+    )}
+  </p>
 );
 
 export const steps = ({

+ 20 - 0
static/app/gettingStartedDocs/python/celery.spec.tsx

@@ -0,0 +1,20 @@
+import {render, screen} from 'sentry-test/reactTestingLibrary';
+
+import {StepTitle} from 'sentry/components/onboarding/gettingStartedDoc/step';
+
+import {GettingStartedWithCelery, steps} from './celery';
+
+describe('GettingStartedWithCelery', function () {
+  it('renders doc correctly', function () {
+    const {container} = render(<GettingStartedWithCelery dsn="test-dsn" />);
+
+    // Steps
+    for (const step of steps()) {
+      expect(
+        screen.getByRole('heading', {name: step.title ?? StepTitle[step.type]})
+      ).toBeInTheDocument();
+    }
+
+    expect(container).toSnapshot();
+  });
+});

Some files were not shown because too many files changed in this diff