Browse Source

ref(onboarding): polish solidstart docs (#78013)

Ogi 5 months ago
parent
commit
6c6c903a8c
1 changed files with 30 additions and 2 deletions
  1. 30 2
      static/app/gettingStartedDocs/javascript/solidstart.tsx

+ 30 - 2
static/app/gettingStartedDocs/javascript/solidstart.tsx

@@ -130,6 +130,16 @@ export default createMiddleware({
 });
 `;
 
+const getSdkMiddlewareLinkSetup = () => `
+import { defineConfig } from "@solidjs/start/config";
+
+export default defineConfig({
+  middleware: "./src/middleware.ts"
+  // Other configuration options
+  // ...
+});
+`;
+
 const getSdkRouterWrappingSetup = () => `
 import { Router } from "@solidjs/router";
 import { FileRoutes } from "@solidjs/start/router";
@@ -251,8 +261,13 @@ const onboarding: OnboardingConfig = {
           ? [
               {
                 description: tct(
-                  'Complete the setup by adding the Sentry middleware to your [code:src/middleware.ts] file',
-                  {code: <code />}
+                  'Complete the setup by adding the Sentry [solidStartMiddlewareLink: middleware] to your [code:src/middleware.ts] file',
+                  {
+                    code: <code />,
+                    solidStartMiddlewareLink: (
+                      <ExternalLink href="https://docs.solidjs.com/solid-start/advanced/middleware" />
+                    ),
+                  }
                 ),
                 code: [
                   {
@@ -266,6 +281,19 @@ const onboarding: OnboardingConfig = {
                   },
                 ],
               },
+              {
+                description: tct('And including it in the [code:app.config.ts] file', {
+                  code: <code />,
+                }),
+                code: [
+                  {
+                    label: 'TypeScript',
+                    value: 'javascript',
+                    language: 'javascript',
+                    code: getSdkMiddlewareLinkSetup(),
+                  },
+                ],
+              },
               {
                 description: tct(
                   "If you're using [solidRouterLink:Solid Router], wrap your [codeRouter:Router] with [codeRouterWrapping:withSentryRouterRouting]. This creates a higher order component, which will enable Sentry to collect navigation spans.",