From 6f0ca6dba9534760b5b83ef60da04b34e8de4c9c Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Fri, 18 Aug 2023 14:58:37 +0200 Subject: [PATCH] feat(getting-started-docs): Source SDK version from sentry release registry (#54943) --- .../gettingStartedDoc/sdkDocumentation.tsx | 6 ++ .../onboarding/gettingStartedDoc/step.tsx | 7 ++ .../useSourcePackageRegistries.tsx | 40 ++++++++++ .../gettingStartedDocs/android/android.tsx | 29 +++++-- .../gettingStartedDocs/apple/apple-ios.tsx | 28 +++++-- .../gettingStartedDocs/apple/apple-macos.tsx | 28 +++++-- static/app/gettingStartedDocs/apple/apple.tsx | 28 +++++-- .../capacitor/capacitor.tsx | 4 +- .../gettingStartedDocs/cordova/cordova.tsx | 4 +- static/app/gettingStartedDocs/dart/dart.tsx | 22 ++++-- .../app/gettingStartedDocs/dotnet/aspnet.tsx | 29 +++++-- .../gettingStartedDocs/dotnet/aspnetcore.tsx | 31 ++++++-- .../gettingStartedDocs/dotnet/awslambda.tsx | 37 +++++++-- .../app/gettingStartedDocs/dotnet/dotnet.tsx | 34 ++++++-- .../dotnet/gcpfunctions.tsx | 39 +++++++-- static/app/gettingStartedDocs/dotnet/maui.tsx | 29 +++++-- static/app/gettingStartedDocs/dotnet/uwp.tsx | 28 +++++-- .../gettingStartedDocs/dotnet/winforms.tsx | 28 +++++-- static/app/gettingStartedDocs/dotnet/wpf.tsx | 28 +++++-- .../app/gettingStartedDocs/dotnet/xamarin.tsx | 29 +++++-- .../app/gettingStartedDocs/elixir/elixir.tsx | 4 +- .../gettingStartedDocs/flutter/flutter.tsx | 22 ++++-- static/app/gettingStartedDocs/go/echo.tsx | 4 +- static/app/gettingStartedDocs/go/fasthttp.tsx | 4 +- static/app/gettingStartedDocs/go/gin.tsx | 4 +- static/app/gettingStartedDocs/go/go.tsx | 4 +- static/app/gettingStartedDocs/go/http.tsx | 4 +- static/app/gettingStartedDocs/go/iris.tsx | 4 +- static/app/gettingStartedDocs/go/martini.tsx | 4 +- static/app/gettingStartedDocs/go/negroni.tsx | 4 +- static/app/gettingStartedDocs/ionic/ionic.tsx | 4 +- static/app/gettingStartedDocs/java/java.tsx | 57 ++++++++++--- static/app/gettingStartedDocs/java/log4j2.tsx | 50 +++++++++--- .../app/gettingStartedDocs/java/logback.tsx | 51 +++++++++--- .../gettingStartedDocs/java/spring-boot.tsx | 79 ++++++++++++++++--- static/app/gettingStartedDocs/java/spring.tsx | 79 ++++++++++++++++--- .../app/gettingStartedDocs/kotlin/kotlin.tsx | 35 ++++++-- .../gettingStartedDocs/minidump/minidump.tsx | 4 +- .../gettingStartedDocs/native/native-qt.tsx | 4 +- .../app/gettingStartedDocs/native/native.tsx | 4 +- static/app/gettingStartedDocs/php/laravel.tsx | 4 +- static/app/gettingStartedDocs/php/php.tsx | 4 +- static/app/gettingStartedDocs/php/symfony.tsx | 4 +- .../app/gettingStartedDocs/python/aiohttp.tsx | 4 +- static/app/gettingStartedDocs/python/asgi.tsx | 4 +- .../gettingStartedDocs/python/awslambda.tsx | 4 +- .../app/gettingStartedDocs/python/bottle.tsx | 4 +- .../app/gettingStartedDocs/python/celery.tsx | 4 +- .../app/gettingStartedDocs/python/chalice.tsx | 4 +- .../app/gettingStartedDocs/python/falcon.tsx | 4 +- .../app/gettingStartedDocs/python/fastapi.tsx | 4 +- .../app/gettingStartedDocs/python/flask.tsx | 4 +- .../python/gcpfunctions.tsx | 4 +- .../app/gettingStartedDocs/python/mongo.tsx | 4 +- .../app/gettingStartedDocs/python/pylons.tsx | 4 +- .../app/gettingStartedDocs/python/pyramid.tsx | 4 +- .../app/gettingStartedDocs/python/python.tsx | 4 +- .../app/gettingStartedDocs/python/quart.tsx | 4 +- static/app/gettingStartedDocs/python/rq.tsx | 4 +- .../app/gettingStartedDocs/python/sanic.tsx | 4 +- .../gettingStartedDocs/python/serverless.tsx | 4 +- .../gettingStartedDocs/python/starlette.tsx | 4 +- .../app/gettingStartedDocs/python/tornado.tsx | 4 +- .../app/gettingStartedDocs/python/tryton.tsx | 4 +- static/app/gettingStartedDocs/python/wsgi.tsx | 4 +- .../react-native/react-native.tsx | 4 +- static/app/gettingStartedDocs/ruby/rack.tsx | 4 +- static/app/gettingStartedDocs/ruby/rails.tsx | 4 +- static/app/gettingStartedDocs/ruby/ruby.tsx | 4 +- static/app/gettingStartedDocs/rust/rust.tsx | 22 ++++-- static/app/gettingStartedDocs/unity/unity.tsx | 22 ++++-- .../app/gettingStartedDocs/unreal/unreal.tsx | 4 +- .../app/views/onboarding/onboarding.spec.tsx | 15 ++++ .../app/views/onboarding/setupDocs.spec.tsx | 56 +++++++++++++ 74 files changed, 853 insertions(+), 315 deletions(-) create mode 100644 static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx diff --git a/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx b/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx index 0f82c09b7ea82..7c5a92b98fb7c 100644 --- a/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx @@ -1,6 +1,7 @@ import {useEffect, useState} from 'react'; import LoadingIndicator from 'sentry/components/loadingIndicator'; +import {useSourcePackageRegistries} from 'sentry/components/onboarding/gettingStartedDoc/useSourcePackageRegistries'; import {ProductSolution} from 'sentry/components/onboarding/productSelection'; import {PlatformKey} from 'sentry/data/platformCategories'; import type {Organization, PlatformIntegration, Project, ProjectKey} from 'sentry/types'; @@ -22,6 +23,7 @@ export type ModuleProps = { organization?: Organization; platformKey?: PlatformKey; projectId?: Project['id']; + sourcePackageRegistries?: ReturnType; }; // Loads the component containing the documentation for the specified platform @@ -33,6 +35,8 @@ export function SdkDocumentation({ organization, projectId, }: SdkDocumentationProps) { + const sourcePackageRegistries = useSourcePackageRegistries(organization); + const [module, setModule] = useState; }>(null); @@ -95,6 +99,7 @@ export function SdkDocumentation({ } const {default: GettingStartedDoc} = module; + return ( ); } diff --git a/static/app/components/onboarding/gettingStartedDoc/step.tsx b/static/app/components/onboarding/gettingStartedDoc/step.tsx index d8368aa117fdc..5142aa3693376 100644 --- a/static/app/components/onboarding/gettingStartedDoc/step.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/step.tsx @@ -47,6 +47,10 @@ type ConfigurationType = { * A callback to be invoked when the configuration is selected and copied to the clipboard */ onSelectAndCopy?: () => void; + /** + * Whether or not the configuration or parts of it are currently being loaded + */ + partialLoading?: boolean; }; interface BaseStepProps { @@ -79,6 +83,7 @@ function getConfiguration({ additionalInfo, onCopy, onSelectAndCopy, + partialLoading, }: ConfigurationType) { return ( @@ -89,6 +94,8 @@ function getConfiguration({ language={language} onCopy={onCopy} onSelectAndCopy={onSelectAndCopy} + hideCopyButton={partialLoading} + disableUserSelection={partialLoading} > {language === 'javascript' ? beautify.js(code, {indent_size: 2, e4x: true}) diff --git a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx new file mode 100644 index 0000000000000..6f21e1d996c5c --- /dev/null +++ b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx @@ -0,0 +1,40 @@ +import {useEffect} from 'react'; + +import {Organization} from 'sentry/types'; +import {handleXhrErrorResponse} from 'sentry/utils/handleXhrErrorResponse'; +import {useApiQuery} from 'sentry/utils/queryClient'; + +type ReleaseRegistrySdk = Record< + string, + { + canonical: string; + main_docs_url: string; + name: string; + package_url: string; + repo_url: string; + version: string; + } +>; + +/** + * Fetches the release registry list for SDKs + */ +export function useSourcePackageRegistries(organization: Organization) { + const releaseRegistrySdk = useApiQuery( + [`/organizations/${organization.slug}/sdks/`], + { + staleTime: Infinity, + } + ); + + useEffect(() => { + if (releaseRegistrySdk.error) { + handleXhrErrorResponse( + 'Failed to fetch sentry release registry', + releaseRegistrySdk.error + ); + } + }, [releaseRegistrySdk.error]); + + return releaseRegistrySdk; +} diff --git a/static/app/gettingStartedDocs/android/android.tsx b/static/app/gettingStartedDocs/android/android.tsx index 39270cd927d77..42db27c336599 100644 --- a/static/app/gettingStartedDocs/android/android.tsx +++ b/static/app/gettingStartedDocs/android/android.tsx @@ -7,9 +7,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -28,10 +29,16 @@ export const steps = ({ configurations: [ { language: 'groovy', + partialLoading: sourcePackageRegistries?.isLoading, code: ` plugins { id "com.android.application" // should be in the same module - id "io.sentry.android.gradle" version "3.12.0" + id "io.sentry.android.gradle" version "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.12.0' + }" } `, }, @@ -139,8 +146,18 @@ export const nextSteps = [ ]; // Configuration End -export function GettingStartedWithAndroid({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithAndroid({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithAndroid; diff --git a/static/app/gettingStartedDocs/apple/apple-ios.tsx b/static/app/gettingStartedDocs/apple/apple-ios.tsx index 99df9c4c38d86..2af24193e090c 100644 --- a/static/app/gettingStartedDocs/apple/apple-ios.tsx +++ b/static/app/gettingStartedDocs/apple/apple-ios.tsx @@ -7,9 +7,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -44,8 +45,13 @@ https://github.com/getsentry/sentry-cocoa.git

), language: 'swift', + partialLoading: sourcePackageRegistries?.isLoading, code: ` -.package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.9.3"), +.package(url: "https://github.com/getsentry/sentry-cocoa", from: "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.cocoa']?.version ?? '8.9.3' + }"), `, }, ], @@ -231,8 +237,18 @@ export const nextSteps = [ ]; // Configuration End -export function GettingStartedWithIos({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithIos({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithIos; diff --git a/static/app/gettingStartedDocs/apple/apple-macos.tsx b/static/app/gettingStartedDocs/apple/apple-macos.tsx index 6682bd74c1024..71772ec9f0b92 100644 --- a/static/app/gettingStartedDocs/apple/apple-macos.tsx +++ b/static/app/gettingStartedDocs/apple/apple-macos.tsx @@ -7,9 +7,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -44,8 +45,13 @@ https://github.com/getsentry/sentry-cocoa.git

), language: 'swift', + partialLoading: sourcePackageRegistries?.isLoading, code: ` -.package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.9.3"), +.package(url: "https://github.com/getsentry/sentry-cocoa", from: "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.cocoa']?.version ?? '8.9.3' + }"), `, }, ], @@ -183,8 +189,18 @@ export const nextSteps = [ ]; // Configuration End -export function GettingStartedWithMacos({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithMacos({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithMacos; diff --git a/static/app/gettingStartedDocs/apple/apple.tsx b/static/app/gettingStartedDocs/apple/apple.tsx index 0eb650fee4472..6c87618736441 100644 --- a/static/app/gettingStartedDocs/apple/apple.tsx +++ b/static/app/gettingStartedDocs/apple/apple.tsx @@ -7,9 +7,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -44,8 +45,13 @@ https://github.com/getsentry/sentry-cocoa.git

), language: 'swift', + partialLoading: sourcePackageRegistries?.isLoading, code: ` -.package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.9.3"), +.package(url: "https://github.com/getsentry/sentry-cocoa", from: "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.cocoa']?.version ?? '8.9.3' + }"), `, }, ], @@ -183,8 +189,18 @@ export const nextSteps = [ ]; // Configuration End -export function GettingStartedWithApple({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithApple({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithApple; diff --git a/static/app/gettingStartedDocs/capacitor/capacitor.tsx b/static/app/gettingStartedDocs/capacitor/capacitor.tsx index 53d4d52aed5fb..100bbc68c4bdf 100644 --- a/static/app/gettingStartedDocs/capacitor/capacitor.tsx +++ b/static/app/gettingStartedDocs/capacitor/capacitor.tsx @@ -8,9 +8,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: t( diff --git a/static/app/gettingStartedDocs/cordova/cordova.tsx b/static/app/gettingStartedDocs/cordova/cordova.tsx index ce2d20142e618..dca421017c1f9 100644 --- a/static/app/gettingStartedDocs/cordova/cordova.tsx +++ b/static/app/gettingStartedDocs/cordova/cordova.tsx @@ -9,9 +9,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: t('Install our SDK using the cordova command:'), diff --git a/static/app/gettingStartedDocs/dart/dart.tsx b/static/app/gettingStartedDocs/dart/dart.tsx index b4b85ee768e5b..a3f7ccfde6866 100644 --- a/static/app/gettingStartedDocs/dart/dart.tsx +++ b/static/app/gettingStartedDocs/dart/dart.tsx @@ -7,9 +7,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -25,9 +26,14 @@ export const steps = ({ configurations: [ { language: 'yml', + partialLoading: sourcePackageRegistries?.isLoading, code: ` dependencies: - sentry: ^7.8.0 + sentry: ^${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dart']?.version ?? '7.8.0' + } `, }, ], @@ -162,8 +168,12 @@ Future processOrderBatch(ISentrySpan span) async { ]; // Configuration End -export function GettingStartedWithDart({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithDart({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithDart; diff --git a/static/app/gettingStartedDocs/dotnet/aspnet.tsx b/static/app/gettingStartedDocs/dotnet/aspnet.tsx index 0b809f3b7bf7f..995b1deedb978 100644 --- a/static/app/gettingStartedDocs/dotnet/aspnet.tsx +++ b/static/app/gettingStartedDocs/dotnet/aspnet.tsx @@ -13,9 +13,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -28,13 +29,23 @@ export const steps = ({ configurations: [ { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, description: t('Package Manager:'), - code: 'Install-Package Sentry.AspNet -Version 3.34.0', + code: `Install-Package Sentry.AspNet -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.aspnet']?.version ?? '3.34.0' + }`, }, { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, description: t('Using Entity Framework 6?'), - code: 'Install-Package Sentry.EntityFramework -Version 3.34.0', + code: `Install-Package Sentry.EntityFramework -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.ef']?.version ?? '3.34.0' + }`, }, ], additionalInfo: ( @@ -164,8 +175,12 @@ public class MvcApplication : HttpApplication ]; // Configuration End -export function GettingStartedWithAspnet({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithAspnet({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithAspnet; diff --git a/static/app/gettingStartedDocs/dotnet/aspnetcore.tsx b/static/app/gettingStartedDocs/dotnet/aspnetcore.tsx index 9b391728a2f26..5208096ee2cfe 100644 --- a/static/app/gettingStartedDocs/dotnet/aspnetcore.tsx +++ b/static/app/gettingStartedDocs/dotnet/aspnetcore.tsx @@ -11,9 +11,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -26,13 +27,25 @@ export const steps = ({ configurations: [ { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, description: t('Package Manager:'), - code: 'Install-Package Sentry.AspNetCore -Version 3.34.0', + code: `Install-Package Sentry.AspNetCore -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? + '3.34.0' + }`, }, { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, description: t('Or .NET Core CLI:'), - code: 'dotnet add package Sentry.AspNetCore -v 3.34.0', + code: `dotnet add package Sentry.AspNetCore -v ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? + '3.34.0' + }`, }, ], }, @@ -215,8 +228,12 @@ public class HomeController : Controller ]; // Configuration End -export function GettingStartedWithAspnetcore({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithAspnetcore({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithAspnetcore; diff --git a/static/app/gettingStartedDocs/dotnet/awslambda.tsx b/static/app/gettingStartedDocs/dotnet/awslambda.tsx index e3f669abe40ec..c90df049f2c77 100644 --- a/static/app/gettingStartedDocs/dotnet/awslambda.tsx +++ b/static/app/gettingStartedDocs/dotnet/awslambda.tsx @@ -19,20 +19,33 @@ const introduction = ( ); export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: t('Add the Sentry dependency:'), configurations: [ { language: 'powershell', - code: 'Install-Package Sentry.AspNetCore -Version 3.34.0', + partialLoading: sourcePackageRegistries?.isLoading, + code: `Install-Package Sentry.AspNetCore -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? + '3.34.0' + }`, }, { language: 'shell', - code: 'dotnet add package Sentry.AspNetCore -v 3.34.0', + partialLoading: sourcePackageRegistries?.isLoading, + code: `dotnet add package Sentry.AspNetCore -v ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? + '3.34.0' + }`, }, ], additionalInfo: ( @@ -131,8 +144,18 @@ public class BadController ]; // Configuration End -export function GettingStartedAwsLambda({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedAwsLambda({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedAwsLambda; diff --git a/static/app/gettingStartedDocs/dotnet/dotnet.tsx b/static/app/gettingStartedDocs/dotnet/dotnet.tsx index a0b9432b93743..0daaff0e5cefa 100644 --- a/static/app/gettingStartedDocs/dotnet/dotnet.tsx +++ b/static/app/gettingStartedDocs/dotnet/dotnet.tsx @@ -22,9 +22,10 @@ const introduction = ( ); export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -37,12 +38,21 @@ export const steps = ({ configurations: [ { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager -Install-Package Sentry -Version 3.34.0 +Install-Package Sentry -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } # Or using .NET Core CLI -dotnet add package Sentry -v 3.34.0 +dotnet add package Sentry -v ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } `, }, ], @@ -186,8 +196,18 @@ transaction.Finish(); // Mark the transaction as finished and send it to Sentry ]; // Configuration End -export function GettingStartedWithDotnet({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithDotnet({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithDotnet; diff --git a/static/app/gettingStartedDocs/dotnet/gcpfunctions.tsx b/static/app/gettingStartedDocs/dotnet/gcpfunctions.tsx index a8b86279de247..db15671d332d4 100644 --- a/static/app/gettingStartedDocs/dotnet/gcpfunctions.tsx +++ b/static/app/gettingStartedDocs/dotnet/gcpfunctions.tsx @@ -11,9 +11,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -26,20 +27,38 @@ export const steps = ({ configurations: [ { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, description: t('Package Manager:'), - code: 'Install-Package Sentry.Google.Cloud.Functions -Version 3.34.0', + code: `Install-Package Sentry.Google.Cloud.Functions -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.google-cloud-function'] + ?.version ?? '3.34.0' + }`, }, { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, description: t('Or .NET Core CLI:'), - code: 'dotnet add package Sentry.Google.Cloud.Functions -v 3.34.0', + code: `dotnet add package Sentry.Google.Cloud.Functions -v ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.google-cloud-function'] + ?.version ?? '3.34.0' + }`, }, { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: t('Or, manually add the Sentry dependency into your csproj file:'), code: ` - + `, }, @@ -162,8 +181,12 @@ public Task HandleAsync(HttpContext context) ]; // Configuration End -export function GettingStartedWithGCPFunctions({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithGCPFunctions({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithGCPFunctions; diff --git a/static/app/gettingStartedDocs/dotnet/maui.tsx b/static/app/gettingStartedDocs/dotnet/maui.tsx index ddaf7cc626df6..5b6427ce03fcb 100644 --- a/static/app/gettingStartedDocs/dotnet/maui.tsx +++ b/static/app/gettingStartedDocs/dotnet/maui.tsx @@ -9,9 +9,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -24,11 +25,21 @@ export const steps = ({ configurations: [ { language: 'shell', - code: 'dotnet add package Sentry.Maui -v 3.34.0', + partialLoading: sourcePackageRegistries?.isLoading, + code: `dotnet add package Sentry.Maui -v ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.maui']?.version ?? '3.34.0' + }`, }, { language: 'powershell', - code: 'Install-Package Sentry.Maui -Version 3.34.0', + partialLoading: sourcePackageRegistries?.isLoading, + code: `Install-Package Sentry.Maui -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.maui']?.version ?? '3.34.0' + }`, }, ], }, @@ -186,8 +197,12 @@ transaction.Finish(); // Mark the transaction as finished and send it to Sentry ]; // Configuration End -export function GettingStartedWithMaui({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithMaui({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithMaui; diff --git a/static/app/gettingStartedDocs/dotnet/uwp.tsx b/static/app/gettingStartedDocs/dotnet/uwp.tsx index df795aa405a38..e3b5d661d9e20 100644 --- a/static/app/gettingStartedDocs/dotnet/uwp.tsx +++ b/static/app/gettingStartedDocs/dotnet/uwp.tsx @@ -13,9 +13,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -28,12 +29,21 @@ export const steps = ({ configurations: [ { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager -Install-Package Sentry -Version 3.34.0 +Install-Package Sentry -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } # Or using .NET Core CLI -dotnet add package Sentry -v 3.34.0 +dotnet add package Sentry -v ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } `, }, ], @@ -224,8 +234,12 @@ transaction.Finish(); // Mark the transaction as finished and send it to Sentry ]; // Configuration End -export function GettingStartedWithUwp({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithUwp({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithUwp; diff --git a/static/app/gettingStartedDocs/dotnet/winforms.tsx b/static/app/gettingStartedDocs/dotnet/winforms.tsx index 258a6595f1105..d604ac4582679 100644 --- a/static/app/gettingStartedDocs/dotnet/winforms.tsx +++ b/static/app/gettingStartedDocs/dotnet/winforms.tsx @@ -13,9 +13,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -28,12 +29,21 @@ export const steps = ({ configurations: [ { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager -Install-Package Sentry -Version 3.34.0 +Install-Package Sentry -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } # Or using .NET Core CLI -dotnet add package Sentry -v 3.34.0 +dotnet add package Sentry -v ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } `, }, ], @@ -192,8 +202,12 @@ transaction.Finish(); // Mark the transaction as finished and send it to Sentry ]; // Configuration End -export function GettingStartedWithWinForms({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithWinForms({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithWinForms; diff --git a/static/app/gettingStartedDocs/dotnet/wpf.tsx b/static/app/gettingStartedDocs/dotnet/wpf.tsx index 0d222e9771c7e..189de96a88297 100644 --- a/static/app/gettingStartedDocs/dotnet/wpf.tsx +++ b/static/app/gettingStartedDocs/dotnet/wpf.tsx @@ -13,9 +13,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -28,12 +29,21 @@ export const steps = ({ configurations: [ { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager -Install-Package Sentry -Version 3.34.0 +Install-Package Sentry -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } # Or using .NET Core CLI -dotnet add package Sentry -v 3.34.0 +dotnet add package Sentry -v ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } `, }, ], @@ -192,8 +202,12 @@ transaction.Finish(); // Mark the transaction as finished and send it to Sentry ]; // Configuration End -export function GettingStartedWithWpf({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithWpf({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithWpf; diff --git a/static/app/gettingStartedDocs/dotnet/xamarin.tsx b/static/app/gettingStartedDocs/dotnet/xamarin.tsx index 964c333571ea0..567384f4a2937 100644 --- a/static/app/gettingStartedDocs/dotnet/xamarin.tsx +++ b/static/app/gettingStartedDocs/dotnet/xamarin.tsx @@ -9,9 +9,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -24,12 +25,22 @@ export const steps = ({ configurations: [ { language: 'shell', + partialLoading: sourcePackageRegistries?.isLoading, code: ` # For Xamarin.Forms -Install-Package Sentry.Xamarin.Forms -Version 1.5.2 +Install-Package Sentry.Xamarin.Forms -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.xamarin-forms']?.version ?? + '1.5.2' + } # If you are not using Xamarin.Forms, but only Xamarin: -Install-Package Sentry.Xamarin -Version 1.5.2 +Install-Package Sentry.Xamarin -Version ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.xamarin']?.version ?? '1.5.2' + } `, }, ], @@ -239,8 +250,12 @@ transaction.Finish(); // Mark the transaction as finished and send it to Sentry ]; // Configuration End -export function GettingStartedWithXamarin({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithXamarin({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithXamarin; diff --git a/static/app/gettingStartedDocs/elixir/elixir.tsx b/static/app/gettingStartedDocs/elixir/elixir.tsx index 126c913d20700..9909e9ba3800a 100644 --- a/static/app/gettingStartedDocs/elixir/elixir.tsx +++ b/static/app/gettingStartedDocs/elixir/elixir.tsx @@ -9,9 +9,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/flutter/flutter.tsx b/static/app/gettingStartedDocs/flutter/flutter.tsx index 484c5ab83452e..d918228688ebf 100644 --- a/static/app/gettingStartedDocs/flutter/flutter.tsx +++ b/static/app/gettingStartedDocs/flutter/flutter.tsx @@ -7,9 +7,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -25,9 +26,14 @@ export const steps = ({ configurations: [ { language: 'yml', + partialLoading: sourcePackageRegistries?.isLoading, code: ` dependencies: - sentry_flutter: ^7.8.0 + sentry_flutter: ^${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dart.flutter']?.version ?? '7.8.0' + } `, }, ], @@ -239,8 +245,12 @@ Future processOrderBatch(ISentrySpan span) async { ]; // Configuration End -export function GettingStartedWithFlutter({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithFlutter({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithFlutter; diff --git a/static/app/gettingStartedDocs/go/echo.tsx b/static/app/gettingStartedDocs/go/echo.tsx index 140dd39168c7c..a3cc8c80549f4 100644 --- a/static/app/gettingStartedDocs/go/echo.tsx +++ b/static/app/gettingStartedDocs/go/echo.tsx @@ -11,9 +11,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/go/fasthttp.tsx b/static/app/gettingStartedDocs/go/fasthttp.tsx index f86b77edb1e32..552bce38f66c2 100644 --- a/static/app/gettingStartedDocs/go/fasthttp.tsx +++ b/static/app/gettingStartedDocs/go/fasthttp.tsx @@ -11,9 +11,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/go/gin.tsx b/static/app/gettingStartedDocs/go/gin.tsx index 0e739d76a7759..bade7bcb0b1f9 100644 --- a/static/app/gettingStartedDocs/go/gin.tsx +++ b/static/app/gettingStartedDocs/go/gin.tsx @@ -11,9 +11,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/go/go.tsx b/static/app/gettingStartedDocs/go/go.tsx index ca03c435b8e9b..f8e55ef8dc51f 100644 --- a/static/app/gettingStartedDocs/go/go.tsx +++ b/static/app/gettingStartedDocs/go/go.tsx @@ -6,9 +6,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/go/http.tsx b/static/app/gettingStartedDocs/go/http.tsx index bfcf188fe3b79..5b27124b7f48d 100644 --- a/static/app/gettingStartedDocs/go/http.tsx +++ b/static/app/gettingStartedDocs/go/http.tsx @@ -11,9 +11,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/go/iris.tsx b/static/app/gettingStartedDocs/go/iris.tsx index 724a74ade4f19..c6cc724b179f7 100644 --- a/static/app/gettingStartedDocs/go/iris.tsx +++ b/static/app/gettingStartedDocs/go/iris.tsx @@ -11,9 +11,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/go/martini.tsx b/static/app/gettingStartedDocs/go/martini.tsx index 430815811d9f2..9f7c7c3fc5a52 100644 --- a/static/app/gettingStartedDocs/go/martini.tsx +++ b/static/app/gettingStartedDocs/go/martini.tsx @@ -11,9 +11,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/go/negroni.tsx b/static/app/gettingStartedDocs/go/negroni.tsx index ff36ad84ab4b4..ae002acd00eb3 100644 --- a/static/app/gettingStartedDocs/go/negroni.tsx +++ b/static/app/gettingStartedDocs/go/negroni.tsx @@ -11,9 +11,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/ionic/ionic.tsx b/static/app/gettingStartedDocs/ionic/ionic.tsx index 5a293443d884e..a821acb071838 100644 --- a/static/app/gettingStartedDocs/ionic/ionic.tsx +++ b/static/app/gettingStartedDocs/ionic/ionic.tsx @@ -8,9 +8,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/java/java.tsx b/static/app/gettingStartedDocs/java/java.tsx index 4ea52b022049d..360e6db16276c 100644 --- a/static/app/gettingStartedDocs/java/java.tsx +++ b/static/app/gettingStartedDocs/java/java.tsx @@ -21,9 +21,10 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: t('Install the SDK via Gradle, Maven, or SBT:'), @@ -33,6 +34,7 @@ export const steps = ({ configurations: [ { language: 'groovy', + partialLoading: sourcePackageRegistries?.isLoading, description: (

{tct('For Gradle, add to your [code:build.gradle] file:', { @@ -48,12 +50,17 @@ repositories { // Add Sentry's SDK as a dependency. dependencies { - implementation 'io.sentry:sentry:6.27.0' + implementation 'io.sentry:sentry:${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' + }' } `, }, { language: 'groovy', + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Gradle plugin.' ), @@ -65,7 +72,12 @@ buildscript { } plugins { - id "io.sentry.jvm.gradle" version "3.11.1" + id "io.sentry.jvm.gradle" version "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' + }" } sentry { @@ -87,6 +99,7 @@ sentry { configurations: [ { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: (

{tct('For Maven, add to your [code:pom.xml] file:', {code: })} @@ -96,12 +109,17 @@ sentry { io.sentry sentry - 6.27.0 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' + } `, }, { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Maven plugin.' ), @@ -111,7 +129,11 @@ sentry { io.sentry sentry-maven-plugin - 0.0.3 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + } true @@ -154,7 +176,12 @@ sentry { { description:

{tct('For [strong:SBT]:', {strong: })}

, language: 'scala', - code: `libraryDependencies += "io.sentry" % "sentry" % "6.27.0"`, + partialLoading: sourcePackageRegistries?.isLoading, + code: `libraryDependencies += "io.sentry" % "sentry" % "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' + }"`, }, ], }, @@ -276,8 +303,18 @@ transaction.finish(); ]; // Configuration End -export function GettingStartedWithJava({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithJava({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithJava; diff --git a/static/app/gettingStartedDocs/java/log4j2.tsx b/static/app/gettingStartedDocs/java/log4j2.tsx index 12ec2ee1062b6..a34e47ca4de5d 100644 --- a/static/app/gettingStartedDocs/java/log4j2.tsx +++ b/static/app/gettingStartedDocs/java/log4j2.tsx @@ -24,9 +24,10 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: t( @@ -38,16 +39,22 @@ export const steps = ({ configurations: [ { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, code: ` io.sentry sentry-log4j2 - 6.27.0 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.log4j2']?.version ?? '6.27.0' + } `, }, { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Maven plugin.' ), @@ -57,7 +64,11 @@ export const steps = ({ io.sentry sentry-maven-plugin - 0.0.3 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + } true @@ -99,7 +110,13 @@ export const steps = ({ configurations: [ { language: 'groovy', - code: "implementation 'io.sentry:sentry-log4j2:6.27.0'", + partialLoading: sourcePackageRegistries?.isLoading, + code: `implementation 'io.sentry:sentry-log4j2:${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.log4j2']?.version ?? + '6.27.0' + }'`, }, { description: t( @@ -114,7 +131,12 @@ buildscript { } plugins { - id "io.sentry.jvm.gradle" version "3.11.1" + id "io.sentry.jvm.gradle" version "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' + }" } sentry { @@ -268,8 +290,18 @@ try { ]; // Configuration End -export function GettingStartedWithLog4j2({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithLog4j2({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithLog4j2; diff --git a/static/app/gettingStartedDocs/java/logback.tsx b/static/app/gettingStartedDocs/java/logback.tsx index cbf6ab2711416..93ac2e1dd7898 100644 --- a/static/app/gettingStartedDocs/java/logback.tsx +++ b/static/app/gettingStartedDocs/java/logback.tsx @@ -22,9 +22,10 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: t( @@ -36,16 +37,22 @@ export const steps = ({ configurations: [ { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, code: ` io.sentry sentry-logback - 6.27.0 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' + } `, }, { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Maven plugin.' ), @@ -55,7 +62,11 @@ export const steps = ({ io.sentry sentry-maven-plugin - 0.0.3 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + } true @@ -97,13 +108,20 @@ export const steps = ({ configurations: [ { language: 'groovy', - code: "implementation 'io.sentry:sentry-logback:6.27.0'", + partialLoading: sourcePackageRegistries?.isLoading, + code: `implementation 'io.sentry:sentry-logback:${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? + '6.27.0' + }'`, }, { description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Maven plugin.' ), language: 'groovy', + partialLoading: sourcePackageRegistries?.isLoading, code: ` buildscript { repositories { @@ -112,7 +130,12 @@ buildscript { } plugins { - id "io.sentry.jvm.gradle" version "3.11.1" + id "io.sentry.jvm.gradle" version "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' + }" } sentry { @@ -274,8 +297,18 @@ try { ]; // Configuration End -export function GettingStartedWithLogBack({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithLogBack({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithLogBack; diff --git a/static/app/gettingStartedDocs/java/spring-boot.tsx b/static/app/gettingStartedDocs/java/spring-boot.tsx index 716b919563e48..03ed39e529cd5 100644 --- a/static/app/gettingStartedDocs/java/spring-boot.tsx +++ b/static/app/gettingStartedDocs/java/spring-boot.tsx @@ -29,9 +29,10 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: t('Install using either Maven or Gradle:'), @@ -41,23 +42,34 @@ export const steps = ({ configurations: [ { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring Boot 2')}, code: ` io.sentry sentry-spring-boot-starter - 6.27.0 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring-boot']?.version ?? '6.27.0' + } `, }, { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring Boot 3')}, code: ` io.sentry sentry-spring-boot-starter-jakarta - 6.27.0 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring-boot.jakarta']?.version ?? + '6.27.0' + } `, }, @@ -69,12 +81,24 @@ export const steps = ({ { language: 'properties', description: {t('Spring Boot 2')}, - code: "implementation 'io.sentry:sentry-spring-boot-starter:6.27.0'", + partialLoading: sourcePackageRegistries?.isLoading, + code: `implementation 'io.sentry:sentry-spring-boot-starter:${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring-boot']?.version ?? + '6.27.0' + }'`, }, { language: 'properties', + partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring Boot 3')}, - code: "implementation 'io.sentry:sentry-spring-boot-starter-jakarta:6.27.0'", + code: `implementation 'io.sentry:sentry-spring-boot-starter-jakarta:${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring-boot.jakarta'] + ?.version ?? '6.27.0' + }'`, }, ], }, @@ -136,7 +160,11 @@ sentry: io.sentry sentry-logback - 6.27.0 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' + } `, }, @@ -151,7 +179,11 @@ sentry: io.sentry sentry-maven-plugin - 0.0.3 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + } true @@ -193,7 +225,13 @@ sentry: configurations: [ { language: 'properties', - code: "implementation 'io.sentry:sentry-logback:6.27.0'", + partialLoading: sourcePackageRegistries?.isLoading, + code: `implementation 'io.sentry:sentry-logback:${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? + '6.27.0' + }'`, }, { language: 'javascript', // TODO: This shouldn't be javascript but because of better formatting we use it for now @@ -208,7 +246,12 @@ buildscript { } plugins { - id "io.sentry.jvm.gradle" version "3.11.1" + id "io.sentry.jvm.gradle" version "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' + }" } sentry { @@ -383,8 +426,18 @@ class PersonService { ]; // Configuration End -export function GettingStartedWithSpringBoot({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithSpringBoot({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithSpringBoot; diff --git a/static/app/gettingStartedDocs/java/spring.tsx b/static/app/gettingStartedDocs/java/spring.tsx index d2273f41f8240..1db921c506ac1 100644 --- a/static/app/gettingStartedDocs/java/spring.tsx +++ b/static/app/gettingStartedDocs/java/spring.tsx @@ -28,9 +28,10 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: t( @@ -42,23 +43,33 @@ export const steps = ({ configurations: [ { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring 5')}, code: ` io.sentry sentry-spring - 6.27.0 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring']?.version ?? '6.27.0' + } `, }, { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring 6')}, code: ` io.sentry sentry-spring-jakarta - 6.27.0 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring.jakarta']?.version ?? '6.27.0' + } `, }, @@ -155,6 +166,7 @@ import org.springframework.core.Ordered configurations: [ { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Maven plugin.' ), @@ -164,7 +176,11 @@ import org.springframework.core.Ordered io.sentry sentry-maven-plugin - 0.0.3 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + } true @@ -206,12 +222,23 @@ import org.springframework.core.Ordered { description: {t('Spring 5')}, language: 'groovy', - code: `implementation 'io.sentry:sentry-spring:6.27.0'`, + partialLoading: sourcePackageRegistries?.isLoading, + code: `implementation 'io.sentry:sentry-spring:${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring']?.version ?? + '6.27.0' + }'`, }, { description: {t('Spring 6')}, language: 'groovy', - code: `implementation 'io.sentry:sentry-spring-jakarta:6.27.0'`, + code: `implementation 'io.sentry:sentry-spring-jakarta:${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring.jakarta'] + ?.version ?? '6.27.0' + }'`, }, ], }, @@ -272,6 +299,7 @@ try { configurations: [ { language: 'groovy', + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Gradle plugin.' ), @@ -283,7 +311,12 @@ repositories { } plugins { -id "io.sentry.jvm.gradle" version "3.11.1" +id "io.sentry.jvm.gradle" version "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin'] + ?.version ?? '3.11.1' + }" } sentry { @@ -306,10 +339,20 @@ authToken = "your-sentry-auth-token" 'For other dependency managers see the [mavenRepositorySpring5Link:central Maven repository (Spring 5)] and [mavenRepositorySpring6Link:central Maven repository (Spring 6)].', { mavenRepositorySpring5Link: ( - + ), mavenRepositorySpring6Link: ( - + ), } )} @@ -334,8 +377,18 @@ authToken = "your-sentry-auth-token" ]; // Configuration End -export function GettingStartedWithSpring({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithSpring({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithSpring; diff --git a/static/app/gettingStartedDocs/kotlin/kotlin.tsx b/static/app/gettingStartedDocs/kotlin/kotlin.tsx index abf6b8fd0edd2..ee13cf141fc34 100644 --- a/static/app/gettingStartedDocs/kotlin/kotlin.tsx +++ b/static/app/gettingStartedDocs/kotlin/kotlin.tsx @@ -26,9 +26,10 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: t('Install the SDK via Gradle or Maven:'), @@ -43,6 +44,7 @@ export const steps = ({ })}

), + partialLoading: sourcePackageRegistries?.isLoading, code: ` // Make sure mavenCentral is there. repositories { @@ -50,12 +52,17 @@ repositories { } dependencies { - implementation 'io.sentry:sentry:{{@inject packages.version('sentry.java', '4.0.0') }}' + implementation 'io.sentry:sentry:${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java']?.version ?? '4.0.0' + }' } `, }, { language: 'xml', + partialLoading: sourcePackageRegistries?.isLoading, description: (

{tct('For [strong:Maven], add to your [code:pom.xml] file:', { @@ -68,7 +75,11 @@ dependencies { io.sentry sentry - 6.25.0 + ${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.25.0' + } `, }, @@ -175,8 +186,18 @@ throw e ]; // Configuration End -export function GettingStartedWithKotlin({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithKotlin({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ( + + ); } export default GettingStartedWithKotlin; diff --git a/static/app/gettingStartedDocs/minidump/minidump.tsx b/static/app/gettingStartedDocs/minidump/minidump.tsx index f17f6f877338c..976f1847cfd3a 100644 --- a/static/app/gettingStartedDocs/minidump/minidump.tsx +++ b/static/app/gettingStartedDocs/minidump/minidump.tsx @@ -10,9 +10,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { title: t('Creating and Uploading Minidumps'), description: ( diff --git a/static/app/gettingStartedDocs/native/native-qt.tsx b/static/app/gettingStartedDocs/native/native-qt.tsx index 3ed24a76068f5..0cc964de8d79d 100644 --- a/static/app/gettingStartedDocs/native/native-qt.tsx +++ b/static/app/gettingStartedDocs/native/native-qt.tsx @@ -9,9 +9,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/native/native.tsx b/static/app/gettingStartedDocs/native/native.tsx index 62422470ded7e..3f1be795fd342 100644 --- a/static/app/gettingStartedDocs/native/native.tsx +++ b/static/app/gettingStartedDocs/native/native.tsx @@ -9,9 +9,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/php/laravel.tsx b/static/app/gettingStartedDocs/php/laravel.tsx index 135856a11394f..667b1a66f7b8b 100644 --- a/static/app/gettingStartedDocs/php/laravel.tsx +++ b/static/app/gettingStartedDocs/php/laravel.tsx @@ -25,9 +25,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, configurations: [ diff --git a/static/app/gettingStartedDocs/php/php.tsx b/static/app/gettingStartedDocs/php/php.tsx index a0e430f050c09..db838002c3a0f 100644 --- a/static/app/gettingStartedDocs/php/php.tsx +++ b/static/app/gettingStartedDocs/php/php.tsx @@ -7,9 +7,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/php/symfony.tsx b/static/app/gettingStartedDocs/php/symfony.tsx index 512490ef56ed0..23cfae05b7dac 100644 --- a/static/app/gettingStartedDocs/php/symfony.tsx +++ b/static/app/gettingStartedDocs/php/symfony.tsx @@ -18,9 +18,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, configurations: [ diff --git a/static/app/gettingStartedDocs/python/aiohttp.tsx b/static/app/gettingStartedDocs/python/aiohttp.tsx index 63ffc829fa01b..acea5ca5c2cf7 100644 --- a/static/app/gettingStartedDocs/python/aiohttp.tsx +++ b/static/app/gettingStartedDocs/python/aiohttp.tsx @@ -18,9 +18,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/asgi.tsx b/static/app/gettingStartedDocs/python/asgi.tsx index 182a031121635..d4449607d6841 100644 --- a/static/app/gettingStartedDocs/python/asgi.tsx +++ b/static/app/gettingStartedDocs/python/asgi.tsx @@ -18,9 +18,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.CONFIGURE, description: ( diff --git a/static/app/gettingStartedDocs/python/awslambda.tsx b/static/app/gettingStartedDocs/python/awslambda.tsx index 14773afe92eeb..f2563efc65639 100644 --- a/static/app/gettingStartedDocs/python/awslambda.tsx +++ b/static/app/gettingStartedDocs/python/awslambda.tsx @@ -25,9 +25,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/bottle.tsx b/static/app/gettingStartedDocs/python/bottle.tsx index 7ee4a4a08fd90..bab134199e265 100644 --- a/static/app/gettingStartedDocs/python/bottle.tsx +++ b/static/app/gettingStartedDocs/python/bottle.tsx @@ -18,9 +18,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/celery.tsx b/static/app/gettingStartedDocs/python/celery.tsx index 5648d294157d6..53ebe57dea3e0 100644 --- a/static/app/gettingStartedDocs/python/celery.tsx +++ b/static/app/gettingStartedDocs/python/celery.tsx @@ -17,9 +17,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.CONFIGURE, description: ( diff --git a/static/app/gettingStartedDocs/python/chalice.tsx b/static/app/gettingStartedDocs/python/chalice.tsx index dca8949a2c084..24c1c97a6ec99 100644 --- a/static/app/gettingStartedDocs/python/chalice.tsx +++ b/static/app/gettingStartedDocs/python/chalice.tsx @@ -7,9 +7,7 @@ import {tct} from 'sentry/locale'; export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/falcon.tsx b/static/app/gettingStartedDocs/python/falcon.tsx index 4b2b913ca8be1..e3fa713c34eeb 100644 --- a/static/app/gettingStartedDocs/python/falcon.tsx +++ b/static/app/gettingStartedDocs/python/falcon.tsx @@ -18,9 +18,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/fastapi.tsx b/static/app/gettingStartedDocs/python/fastapi.tsx index 965bc32ba58a0..c8a8c3c7f0af0 100644 --- a/static/app/gettingStartedDocs/python/fastapi.tsx +++ b/static/app/gettingStartedDocs/python/fastapi.tsx @@ -15,9 +15,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/flask.tsx b/static/app/gettingStartedDocs/python/flask.tsx index 339986c359adc..83ad6ba926c97 100644 --- a/static/app/gettingStartedDocs/python/flask.tsx +++ b/static/app/gettingStartedDocs/python/flask.tsx @@ -7,9 +7,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/gcpfunctions.tsx b/static/app/gettingStartedDocs/python/gcpfunctions.tsx index fc0a73a466cc8..31a165a0698c1 100644 --- a/static/app/gettingStartedDocs/python/gcpfunctions.tsx +++ b/static/app/gettingStartedDocs/python/gcpfunctions.tsx @@ -12,9 +12,7 @@ import {space} from 'sentry/styles/space'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/mongo.tsx b/static/app/gettingStartedDocs/python/mongo.tsx index 93cdd46182d8b..30057b6ea7b36 100644 --- a/static/app/gettingStartedDocs/python/mongo.tsx +++ b/static/app/gettingStartedDocs/python/mongo.tsx @@ -18,9 +18,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/pylons.tsx b/static/app/gettingStartedDocs/python/pylons.tsx index 394e3bb815a5f..a775da153d8ed 100644 --- a/static/app/gettingStartedDocs/python/pylons.tsx +++ b/static/app/gettingStartedDocs/python/pylons.tsx @@ -6,9 +6,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/pyramid.tsx b/static/app/gettingStartedDocs/python/pyramid.tsx index 71d389a4cbfe0..7fb8994f8d849 100644 --- a/static/app/gettingStartedDocs/python/pyramid.tsx +++ b/static/app/gettingStartedDocs/python/pyramid.tsx @@ -18,9 +18,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description:

{tct('Install [code:sentry-sdk] from PyPI:', {code: })}

, diff --git a/static/app/gettingStartedDocs/python/python.tsx b/static/app/gettingStartedDocs/python/python.tsx index 63e6db6332e1a..ddc3e23134993 100644 --- a/static/app/gettingStartedDocs/python/python.tsx +++ b/static/app/gettingStartedDocs/python/python.tsx @@ -6,9 +6,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/quart.tsx b/static/app/gettingStartedDocs/python/quart.tsx index d5408f0d2b47d..9295db403c08d 100644 --- a/static/app/gettingStartedDocs/python/quart.tsx +++ b/static/app/gettingStartedDocs/python/quart.tsx @@ -23,9 +23,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description:

{tct('Install [code:sentry-sdk] from PyPI:', {code: })}

, diff --git a/static/app/gettingStartedDocs/python/rq.tsx b/static/app/gettingStartedDocs/python/rq.tsx index 3075e4f9448b1..53beac47fbf50 100644 --- a/static/app/gettingStartedDocs/python/rq.tsx +++ b/static/app/gettingStartedDocs/python/rq.tsx @@ -15,9 +15,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.CONFIGURE, description: ( diff --git a/static/app/gettingStartedDocs/python/sanic.tsx b/static/app/gettingStartedDocs/python/sanic.tsx index c6ae52492be39..632b287b39442 100644 --- a/static/app/gettingStartedDocs/python/sanic.tsx +++ b/static/app/gettingStartedDocs/python/sanic.tsx @@ -41,9 +41,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description:

{tct('Install [code:sentry-sdk] from PyPI:', {code: })}

, diff --git a/static/app/gettingStartedDocs/python/serverless.tsx b/static/app/gettingStartedDocs/python/serverless.tsx index 8fbe79a6c057c..e8ee834185a06 100644 --- a/static/app/gettingStartedDocs/python/serverless.tsx +++ b/static/app/gettingStartedDocs/python/serverless.tsx @@ -14,9 +14,7 @@ import {t, tct} from 'sentry/locale'; export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/starlette.tsx b/static/app/gettingStartedDocs/python/starlette.tsx index 857b250c4a325..fbcfc06f7cee7 100644 --- a/static/app/gettingStartedDocs/python/starlette.tsx +++ b/static/app/gettingStartedDocs/python/starlette.tsx @@ -13,9 +13,7 @@ const introduction = tct( ); export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/python/tornado.tsx b/static/app/gettingStartedDocs/python/tornado.tsx index 423d85a5d98d8..3c8fa7779bce9 100644 --- a/static/app/gettingStartedDocs/python/tornado.tsx +++ b/static/app/gettingStartedDocs/python/tornado.tsx @@ -18,9 +18,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description:

{tct('Install [code:sentry-sdk] from PyPI:', {code: })}

, diff --git a/static/app/gettingStartedDocs/python/tryton.tsx b/static/app/gettingStartedDocs/python/tryton.tsx index 27853d836e996..b090a14bdb4b8 100644 --- a/static/app/gettingStartedDocs/python/tryton.tsx +++ b/static/app/gettingStartedDocs/python/tryton.tsx @@ -15,9 +15,7 @@ const introduction = ( export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.CONFIGURE, description: ( diff --git a/static/app/gettingStartedDocs/python/wsgi.tsx b/static/app/gettingStartedDocs/python/wsgi.tsx index 3cb90fc32f21d..7fe3b4a7f000c 100644 --- a/static/app/gettingStartedDocs/python/wsgi.tsx +++ b/static/app/gettingStartedDocs/python/wsgi.tsx @@ -9,9 +9,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/react-native/react-native.tsx b/static/app/gettingStartedDocs/react-native/react-native.tsx index 7a01a14c5ce7c..da2983fd845f7 100644 --- a/static/app/gettingStartedDocs/react-native/react-native.tsx +++ b/static/app/gettingStartedDocs/react-native/react-native.tsx @@ -11,9 +11,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/ruby/rack.tsx b/static/app/gettingStartedDocs/ruby/rack.tsx index eaa7d72cea2bf..b6b1e53fd1a82 100644 --- a/static/app/gettingStartedDocs/ruby/rack.tsx +++ b/static/app/gettingStartedDocs/ruby/rack.tsx @@ -6,9 +6,7 @@ import {tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/ruby/rails.tsx b/static/app/gettingStartedDocs/ruby/rails.tsx index 896b402b7fd74..99fa49bb75892 100644 --- a/static/app/gettingStartedDocs/ruby/rails.tsx +++ b/static/app/gettingStartedDocs/ruby/rails.tsx @@ -14,9 +14,7 @@ const introduction = ( ); export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/ruby/ruby.tsx b/static/app/gettingStartedDocs/ruby/ruby.tsx index ca47af80ab46b..ad028f6beb5df 100644 --- a/static/app/gettingStartedDocs/ruby/ruby.tsx +++ b/static/app/gettingStartedDocs/ruby/ruby.tsx @@ -6,9 +6,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/gettingStartedDocs/rust/rust.tsx b/static/app/gettingStartedDocs/rust/rust.tsx index 006d344539bf2..d68643da4d540 100644 --- a/static/app/gettingStartedDocs/rust/rust.tsx +++ b/static/app/gettingStartedDocs/rust/rust.tsx @@ -6,9 +6,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -22,9 +23,14 @@ export const steps = ({ configurations: [ { language: 'toml', + partialLoading: sourcePackageRegistries?.isLoading, code: ` [dependencies] -sentry = "0.31.5" +sentry = "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.rust'] ?? '0.31.5' + }" `, }, ], @@ -76,8 +82,12 @@ fn main() { ]; // Configuration End -export function GettingStartedWithRust({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithRust({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithRust; diff --git a/static/app/gettingStartedDocs/unity/unity.tsx b/static/app/gettingStartedDocs/unity/unity.tsx index ed45d80806e48..f04a9376322c2 100644 --- a/static/app/gettingStartedDocs/unity/unity.tsx +++ b/static/app/gettingStartedDocs/unity/unity.tsx @@ -11,9 +11,10 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ + sourcePackageRegistries, +}: Partial< + Pick +> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( @@ -31,7 +32,12 @@ export const steps = ({ configurations: [ { language: 'bash', - code: 'https://github.com/getsentry/unity.git#1.5.0', + partialLoading: sourcePackageRegistries?.isLoading, + code: `https://github.com/getsentry/unity.git#${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.unity']?.version ?? '1.5.0' + }`, }, ], additionalInfo: ( @@ -120,8 +126,12 @@ SentrySdk.CaptureMessage("Test event"); ]; // Configuration End -export function GettingStartedWithUnity({dsn, ...props}: ModuleProps) { - return ; +export function GettingStartedWithUnity({ + dsn, + sourcePackageRegistries, + ...props +}: ModuleProps) { + return ; } export default GettingStartedWithUnity; diff --git a/static/app/gettingStartedDocs/unreal/unreal.tsx b/static/app/gettingStartedDocs/unreal/unreal.tsx index 212bf731b48f3..474068b6cf96a 100644 --- a/static/app/gettingStartedDocs/unreal/unreal.tsx +++ b/static/app/gettingStartedDocs/unreal/unreal.tsx @@ -11,9 +11,7 @@ import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, -}: { - dsn?: string; -} = {}): LayoutProps['steps'] => [ +}: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: ( diff --git a/static/app/views/onboarding/onboarding.spec.tsx b/static/app/views/onboarding/onboarding.spec.tsx index ca13169f3454d..b129f79429c84 100644 --- a/static/app/views/onboarding/onboarding.spec.tsx +++ b/static/app/views/onboarding/onboarding.spec.tsx @@ -85,6 +85,11 @@ describe('Onboarding', function () { }, }); + MockApiClient.addMockResponse({ + url: `/organizations/${organization.slug}/sdks/`, + body: {}, + }); + MockApiClient.addMockResponse({ url: `/projects/${organization.slug}/${nextJsProject.slug}/docs/javascript-nextjs-with-error-monitoring/`, body: null, @@ -170,6 +175,11 @@ describe('Onboarding', function () { }, }); + MockApiClient.addMockResponse({ + url: `/organizations/${organization.slug}/sdks/`, + body: {}, + }); + MockApiClient.addMockResponse({ url: `/projects/org-slug/${reactProject.slug}/`, body: [reactProject], @@ -260,6 +270,11 @@ describe('Onboarding', function () { }, }); + MockApiClient.addMockResponse({ + url: `/organizations/${organization.slug}/sdks/`, + body: {}, + }); + MockApiClient.addMockResponse({ url: `/projects/org-slug/${reactProject.slug}/`, body: [reactProject], diff --git a/static/app/views/onboarding/setupDocs.spec.tsx b/static/app/views/onboarding/setupDocs.spec.tsx index 7cc01ffac444d..d7c4d5cddb165 100644 --- a/static/app/views/onboarding/setupDocs.spec.tsx +++ b/static/app/views/onboarding/setupDocs.spec.tsx @@ -31,6 +31,20 @@ function renderMockRequests({ body: [], }); + MockApiClient.addMockResponse({ + url: `/organizations/${orgSlug}/sdks/`, + body: { + 'sentry.java': { + canonical: 'maven:io.sentry:sentry', + main_docs_url: 'https://docs.sentry.io/platforms/java', + name: 'io.sentry:sentry', + package_url: 'https://search.maven.org/artifact/io.sentry/sentry', + repo_url: 'https://github.com/getsentry/sentry-java', + version: '6.28.0', + }, + }, + }); + if (project.slug !== 'javascript-react') { MockApiClient.addMockResponse({ url: `/projects/${orgSlug}/${project.slug}/docs/${project.platform}/`, @@ -88,6 +102,48 @@ describe('Onboarding Setup Docs', function () { ).not.toBeInTheDocument(); }); + it('renders SDK version from the sentry release registry', async function () { + const {router, route, routerContext, organization, project} = initializeOrg({ + projects: [ + { + ...initializeOrg().project, + slug: 'java', + platform: 'java', + }, + ], + }); + + ProjectsStore.init(); + ProjectsStore.loadInitialData([project]); + + renderMockRequests({project, orgSlug: organization.slug}); + + render( + + {}} + stepIndex={2} + router={router} + route={route} + location={router.location} + genSkipOnboardingLink={() => ''} + orgId={organization.slug} + search="" + recentCreatedProject={project} + /> + , + { + context: routerContext, + organization, + } + ); + + expect( + await screen.findByText(/implementation 'io.sentry:sentry:6.28.0'/) + ).toBeInTheDocument(); + }); + describe('renders Product Selection', function () { it('all products checked', async function () { const {router, route, routerContext, organization, project} = initializeOrg({