From 48b3f3614d39d6ffef137d0c6c1541c1a77d8fb9 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 14 Aug 2023 13:37:15 +0200 Subject: [PATCH 01/19] ref(getting-started-docs): Source sdks version from sentry release registry --- static/app/api.tsx | 9 ++- static/app/components/codeSnippet.tsx | 25 ++++++++- .../gettingStartedDoc/sdkDocumentation.tsx | 5 ++ .../onboarding/gettingStartedDoc/step.tsx | 6 ++ .../useSourcePackageRegistries.tsx | 33 +++++++++++ .../gettingStartedDocs/android/android.tsx | 27 +++++++-- .../gettingStartedDocs/apple/apple-ios.tsx | 26 +++++++-- .../gettingStartedDocs/apple/apple-macos.tsx | 26 +++++++-- static/app/gettingStartedDocs/apple/apple.tsx | 26 +++++++-- .../capacitor/capacitor.tsx | 4 +- .../gettingStartedDocs/cordova/cordova.tsx | 4 +- static/app/gettingStartedDocs/dart/dart.tsx | 18 ++++-- .../app/gettingStartedDocs/dotnet/aspnet.tsx | 25 ++++++--- .../gettingStartedDocs/dotnet/aspnetcore.tsx | 25 ++++++--- .../gettingStartedDocs/dotnet/awslambda.tsx | 31 +++++++--- .../app/gettingStartedDocs/dotnet/dotnet.tsx | 30 +++++++--- .../dotnet/gcpfunctions.tsx | 33 ++++++++--- static/app/gettingStartedDocs/dotnet/maui.tsx | 25 ++++++--- static/app/gettingStartedDocs/dotnet/uwp.tsx | 24 +++++--- .../gettingStartedDocs/dotnet/winforms.tsx | 24 +++++--- static/app/gettingStartedDocs/dotnet/wpf.tsx | 24 +++++--- .../app/gettingStartedDocs/dotnet/xamarin.tsx | 25 ++++++--- .../app/gettingStartedDocs/elixir/elixir.tsx | 4 +- .../gettingStartedDocs/flutter/flutter.tsx | 20 +++++-- 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 | 47 ++++++++++++---- static/app/gettingStartedDocs/java/log4j2.tsx | 41 +++++++++++--- .../app/gettingStartedDocs/java/logback.tsx | 42 +++++++++++--- .../gettingStartedDocs/java/spring-boot.tsx | 48 ++++++++++++---- static/app/gettingStartedDocs/java/spring.tsx | 52 +++++++++++++---- .../app/gettingStartedDocs/kotlin/kotlin.tsx | 31 +++++++--- .../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/django.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 | 18 ++++-- static/app/gettingStartedDocs/unity/unity.tsx | 20 +++++-- .../app/gettingStartedDocs/unreal/unreal.tsx | 4 +- static/app/utils/queryClient.tsx | 12 +++- .../app/views/onboarding/onboarding.spec.tsx | 15 +++++ .../app/views/onboarding/setupDocs.spec.tsx | 56 +++++++++++++++++++ 78 files changed, 732 insertions(+), 321 deletions(-) create mode 100644 static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx diff --git a/static/app/api.tsx b/static/app/api.tsx index 246a676e5689e3..620cc417ee6ade 100644 --- a/static/app/api.tsx +++ b/static/app/api.tsx @@ -243,7 +243,10 @@ type ClientOptions = { * The base URL path to prepend to API request URIs. */ baseUrl?: string; - + /** + * Credentials policy to apply to each request + */ + credentials?: RequestCredentials; /** * Base set of headers to apply to each request */ @@ -265,6 +268,7 @@ export class Client { baseUrl: string; activeRequests: Record; headers: HeadersInit; + credentials?: RequestCredentials; static JSON_HEADERS = { Accept: 'application/json; charset=utf-8', @@ -275,6 +279,7 @@ export class Client { this.baseUrl = options.baseUrl ?? '/api/0'; this.headers = options.headers ?? Client.JSON_HEADERS; this.activeRequests = {}; + this.credentials = options.credentials ?? 'include'; } wrapCallback( @@ -459,7 +464,7 @@ export class Client { method, body, headers, - credentials: 'include', + credentials: this.credentials, signal: aborter?.signal, }); diff --git a/static/app/components/codeSnippet.tsx b/static/app/components/codeSnippet.tsx index e3cfadd704c0d9..fdc69f5706e02a 100644 --- a/static/app/components/codeSnippet.tsx +++ b/static/app/components/codeSnippet.tsx @@ -3,6 +3,7 @@ import styled from '@emotion/styled'; import Prism from 'prismjs'; import {Button} from 'sentry/components/button'; +import LoadingIndicator from 'sentry/components/loadingIndicator'; import {IconCopy} from 'sentry/icons'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; @@ -15,6 +16,10 @@ interface CodeSnippetProps { dark?: boolean; filename?: string; hideCopyButton?: boolean; + /** + * Weather the code snippet or parts of it, it is currently being loaded + */ + loading?: boolean; onCopy?: (copiedCode: string) => void; /** * Fired when the user selects and copies code snippet manually @@ -31,6 +36,7 @@ export function CodeSnippet({ onCopy, className, onSelectAndCopy, + loading, }: CodeSnippetProps) { const ref = useRef(null); @@ -73,7 +79,7 @@ export function CodeSnippet({
{filename && {filename}} - {!hideCopyButton && ( + {!hideCopyButton && !loading && (
-        
           {children}
-        
+        
+        {loading && }
       
); @@ -159,3 +167,14 @@ const CopyButton = styled(Button)` opacity: 1; } `; + +const Code = styled('code')<{isLoading?: boolean}>` + visibility: ${p => (p.isLoading ? 'hidden' : 'visible')}; +`; + +const Loading = styled(LoadingIndicator)` + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + position: absolute; +`; diff --git a/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx b/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx index 0f82c09b7ea826..55a8743c90092e 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'; @@ -17,6 +18,7 @@ type SdkDocumentationProps = { export type ModuleProps = { dsn: string; + sourcePackageRegistries: ReturnType; activeProductSelection?: ProductSolution[]; newOrg?: boolean; organization?: Organization; @@ -33,6 +35,8 @@ export function SdkDocumentation({ organization, projectId, }: SdkDocumentationProps) { + const sourcePackageRegistries = useSourcePackageRegistries(); + const [module, setModule] = useState; }>(null); @@ -103,6 +107,7 @@ export function SdkDocumentation({ platformKey={platform?.id} organization={organization} projectId={projectId} + sourcePackageRegistries={sourcePackageRegistries} /> ); } diff --git a/static/app/components/onboarding/gettingStartedDoc/step.tsx b/static/app/components/onboarding/gettingStartedDoc/step.tsx index d8368aa117fdc1..2d6a5af30df3db 100644 --- a/static/app/components/onboarding/gettingStartedDoc/step.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/step.tsx @@ -39,6 +39,10 @@ type ConfigurationType = { * The language of the code to be rendered (python, javascript, etc) */ language?: string; + /** + * Whether or not the configuration is currently being loaded + */ + loading?: boolean; /** * A callback to be invoked when the configuration is copied to the clipboard */ @@ -79,6 +83,7 @@ function getConfiguration({ additionalInfo, onCopy, onSelectAndCopy, + loading, }: ConfigurationType) { return ( @@ -89,6 +94,7 @@ function getConfiguration({ language={language} onCopy={onCopy} onSelectAndCopy={onSelectAndCopy} + loading={loading} > {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 00000000000000..a88f1be04755ba --- /dev/null +++ b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx @@ -0,0 +1,33 @@ +import {Client} from 'sentry/api'; +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; + } +>; + +// This exists because /extensions/type/search API is not prefixed with +// /api/0/, but the default API client on the abstract issue form is... +const API_CLIENT = new Client({baseUrl: '', headers: {}, credentials: 'omit'}); + +export function useSourcePackageRegistries() { + const {isLoading, data} = useApiQuery( + ['https://release-registry.services.sentry.io/sdks'], + { + staleTime: Infinity, + }, + API_CLIENT + ); + + return { + isLoading, + data, + }; +} diff --git a/static/app/gettingStartedDocs/android/android.tsx b/static/app/gettingStartedDocs/android/android.tsx index 874528b62d79c9..06c43b5d9246c0 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,14 @@ export const steps = ({ configurations: [ { language: 'groovy', + loading: sourcePackageRegistries?.isLoading, code: ` plugins { id "com.android.application" // should be in the same module - id "io.sentry.android.gradle" version "3.11.1" + id "io.sentry.android.gradle" version "${ + sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' + }" } `, }, @@ -139,8 +144,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 99df9c4c38d860..c7ada4afb68f63 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,11 @@ https://github.com/getsentry/sentry-cocoa.git

), language: 'swift', + loading: 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?.data?.['sentry.cocoa']?.version ?? '8.9.3' + }"), `, }, ], @@ -231,8 +235,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 6682bd74c1024a..e5a9c6d03f0cdd 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,11 @@ https://github.com/getsentry/sentry-cocoa.git

), language: 'swift', + loading: 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?.data?.['sentry.cocoa']?.version ?? '8.9.3' + }"), `, }, ], @@ -183,8 +187,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 0eb650fee44729..e74b53c24e919d 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,11 @@ https://github.com/getsentry/sentry-cocoa.git

), language: 'swift', + loading: 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?.data?.['sentry.cocoa']?.version ?? '8.9.3' + }"), `, }, ], @@ -183,8 +187,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 53d4d52aed5fb2..100bbc68c4bdf3 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 ce2d20142e618a..dca421017c1f9a 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 b4b85ee768e5b1..6c937c756c582b 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,10 @@ export const steps = ({ configurations: [ { language: 'yml', + loading: sourcePackageRegistries?.isLoading, code: ` dependencies: - sentry: ^7.8.0 + sentry: ^${sourcePackageRegistries?.data?.['sentry.dart']?.version ?? '7.8.0'} `, }, ], @@ -162,8 +164,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 0b809f3b7bf7fb..9f2a357a5106a6 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,19 @@ export const steps = ({ configurations: [ { language: 'shell', + loading: sourcePackageRegistries?.isLoading, description: t('Package Manager:'), - code: 'Install-Package Sentry.AspNet -Version 3.34.0', + code: `Install-Package Sentry.AspNet -Version ${ + sourcePackageRegistries?.data?.['sentry.dotnet.aspnet']?.version ?? '3.34.0' + }`, }, { language: 'shell', + loading: sourcePackageRegistries?.isLoading, description: t('Using Entity Framework 6?'), - code: 'Install-Package Sentry.EntityFramework -Version 3.34.0', + code: `Install-Package Sentry.EntityFramework -Version ${ + sourcePackageRegistries?.data?.['sentry.dotnet.ef']?.version ?? '3.34.0' + }`, }, ], additionalInfo: ( @@ -164,8 +171,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 9b391728a2f265..59bbb9bc7e5dce 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,19 @@ export const steps = ({ configurations: [ { language: 'shell', + loading: sourcePackageRegistries?.isLoading, description: t('Package Manager:'), - code: 'Install-Package Sentry.AspNetCore -Version 3.34.0', + code: `Install-Package Sentry.AspNetCore -Version ${ + sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? '3.34.0' + }`, }, { language: 'shell', + loading: 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?.data?.['sentry.dotnet.aspnetcore']?.version ?? '3.34.0' + }`, }, ], }, @@ -215,8 +222,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 e3f669abe40ecf..85c090c41c4270 100644 --- a/static/app/gettingStartedDocs/dotnet/awslambda.tsx +++ b/static/app/gettingStartedDocs/dotnet/awslambda.tsx @@ -19,20 +19,27 @@ 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', + loading: sourcePackageRegistries?.isLoading, + code: `Install-Package Sentry.AspNetCore -Version ${ + sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? '3.34.0' + }`, }, { language: 'shell', - code: 'dotnet add package Sentry.AspNetCore -v 3.34.0', + loading: sourcePackageRegistries?.isLoading, + code: `dotnet add package Sentry.AspNetCore -v ${ + sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? '3.34.0' + }`, }, ], additionalInfo: ( @@ -131,8 +138,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 a0b9432b937434..7a655cc363c5c3 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,17 @@ export const steps = ({ configurations: [ { language: 'shell', + loading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager -Install-Package Sentry -Version 3.34.0 +Install-Package Sentry -Version ${ + 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?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } `, }, ], @@ -186,8 +192,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 a8b86279de2473..490629bf550ba4 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,32 @@ export const steps = ({ configurations: [ { language: 'shell', + loading: 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?.data?.['sentry.dotnet.google-cloud-function'] + ?.version ?? '3.34.0' + }`, }, { language: 'shell', + loading: 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?.data?.['sentry.dotnet.google-cloud-function'] + ?.version ?? '3.34.0' + }`, }, { language: 'xml', + loading: sourcePackageRegistries?.isLoading, description: t('Or, manually add the Sentry dependency into your csproj file:'), code: ` - + `, }, @@ -162,8 +175,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 ddaf7cc626df63..98c857d900e301 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,17 @@ export const steps = ({ configurations: [ { language: 'shell', - code: 'dotnet add package Sentry.Maui -v 3.34.0', + loading: sourcePackageRegistries?.isLoading, + code: `dotnet add package Sentry.Maui -v ${ + sourcePackageRegistries?.data?.['sentry.dotnet.maui']?.version ?? '3.34.0' + }`, }, { language: 'powershell', - code: 'Install-Package Sentry.Maui -Version 3.34.0', + loading: sourcePackageRegistries?.isLoading, + code: `Install-Package Sentry.Maui -Version ${ + sourcePackageRegistries?.data?.['sentry.dotnet.maui']?.version ?? '3.34.0' + }`, }, ], }, @@ -186,8 +193,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 df795aa405a381..4a3fa67bf069c4 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,17 @@ export const steps = ({ configurations: [ { language: 'shell', + loading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager -Install-Package Sentry -Version 3.34.0 +Install-Package Sentry -Version ${ + 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?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } `, }, ], @@ -224,8 +230,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 258a6595f11055..91749c784dddb5 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,17 @@ export const steps = ({ configurations: [ { language: 'shell', + loading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager -Install-Package Sentry -Version 3.34.0 +Install-Package Sentry -Version ${ + 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?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } `, }, ], @@ -192,8 +198,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 0d222e9771c7e7..d2b659fad57075 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,17 @@ export const steps = ({ configurations: [ { language: 'shell', + loading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager -Install-Package Sentry -Version 3.34.0 +Install-Package Sentry -Version ${ + 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?.data?.['sentry.dotnet']?.version ?? '3.34.0' + } `, }, ], @@ -192,8 +198,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 964c333571ea00..b06385f2b733ee 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,18 @@ export const steps = ({ configurations: [ { language: 'shell', + loading: sourcePackageRegistries?.isLoading, code: ` # For Xamarin.Forms -Install-Package Sentry.Xamarin.Forms -Version 1.5.2 +Install-Package Sentry.Xamarin.Forms -Version ${ + 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?.data?.['sentry.dotnet.xamarin']?.version ?? '1.5.2' + } `, }, ], @@ -239,8 +246,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 126c913d20700c..9909e9ba3800ae 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 484c5ab83452e7..c62f0f7a906740 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,12 @@ export const steps = ({ configurations: [ { language: 'yml', + loading: sourcePackageRegistries?.isLoading, code: ` dependencies: - sentry_flutter: ^7.8.0 + sentry_flutter: ^${ + sourcePackageRegistries?.data?.['sentry.dart.flutter']?.version ?? '7.8.0' + } `, }, ], @@ -239,8 +243,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 140dd39168c7c7..a3cc8c80549f43 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 f86b77edb1e325..552bce38f66c26 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 0e739d76a77599..bade7bcb0b1f90 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 ca03c435b8e9bc..f8e55ef8dc51f4 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 bfcf188fe3b791..5b27124b7f48da 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 724a74ade4f19a..c6cc724b179f74 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 430815811d9f27..9f7c7c3fc5a52e 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 ff36ad84ab4b4d..ae002acd00eb36 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 5a293443d884e1..a821acb0718384 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 4ea52b022049de..726e14a8096959 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', + loading: sourcePackageRegistries?.isLoading, description: (

{tct('For Gradle, add to your [code:build.gradle] file:', { @@ -48,12 +50,15 @@ repositories { // Add Sentry's SDK as a dependency. dependencies { - implementation 'io.sentry:sentry:6.27.0' + implementation 'io.sentry:sentry:${ + sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' + }' } `, }, { language: 'groovy', + loading: 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 +70,10 @@ buildscript { } plugins { - id "io.sentry.jvm.gradle" version "3.11.1" + id "io.sentry.jvm.gradle" version "${ + sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' + }" } sentry { @@ -87,6 +95,7 @@ sentry { configurations: [ { language: 'xml', + loading: sourcePackageRegistries?.isLoading, description: (

{tct('For Maven, add to your [code:pom.xml] file:', {code: })} @@ -96,12 +105,15 @@ sentry { io.sentry sentry - 6.27.0 + ${ + sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' + } `, }, { language: 'xml', + loading: 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 +123,9 @@ sentry { io.sentry sentry-maven-plugin - 0.0.3 + ${ + sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + } true @@ -154,7 +168,10 @@ sentry { { description:

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

, language: 'scala', - code: `libraryDependencies += "io.sentry" % "sentry" % "6.27.0"`, + loading: sourcePackageRegistries?.isLoading, + code: `libraryDependencies += "io.sentry" % "sentry" % "${ + sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' + }"`, }, ], }, @@ -276,8 +293,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 12ec2ee1062b68..9dfc4087a365b1 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,20 @@ export const steps = ({ configurations: [ { language: 'xml', + loading: sourcePackageRegistries?.isLoading, code: ` io.sentry sentry-log4j2 - 6.27.0 + ${ + sourcePackageRegistries?.data?.['sentry.java.log4j2']?.version ?? '6.27.0' + } `, }, { language: 'xml', + loading: 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 +62,9 @@ export const steps = ({ io.sentry sentry-maven-plugin - 0.0.3 + ${ + sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + } true @@ -99,7 +106,10 @@ export const steps = ({ configurations: [ { language: 'groovy', - code: "implementation 'io.sentry:sentry-log4j2:6.27.0'", + loading: sourcePackageRegistries?.isLoading, + code: `implementation 'io.sentry:sentry-log4j2:${ + sourcePackageRegistries?.data?.['sentry.java.log4j2']?.version ?? '6.27.0' + }'`, }, { description: t( @@ -114,7 +124,10 @@ buildscript { } plugins { - id "io.sentry.jvm.gradle" version "3.11.1" + id "io.sentry.jvm.gradle" version "${ + sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' + }" } sentry { @@ -268,8 +281,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 cbf6ab2711416f..5dd5cf795a0e12 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,20 @@ export const steps = ({ configurations: [ { language: 'xml', + loading: sourcePackageRegistries?.isLoading, code: ` io.sentry sentry-logback - 6.27.0 + ${ + sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' + } `, }, { language: 'xml', + loading: 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 +60,9 @@ export const steps = ({ io.sentry sentry-maven-plugin - 0.0.3 + ${ + sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + } true @@ -97,13 +104,17 @@ export const steps = ({ configurations: [ { language: 'groovy', - code: "implementation 'io.sentry:sentry-logback:6.27.0'", + loading: sourcePackageRegistries?.isLoading, + code: `implementation 'io.sentry:sentry-logback:${ + 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', + loading: sourcePackageRegistries?.isLoading, code: ` buildscript { repositories { @@ -112,7 +123,10 @@ buildscript { } plugins { - id "io.sentry.jvm.gradle" version "3.11.1" + id "io.sentry.jvm.gradle" version "${ + sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' + }" } sentry { @@ -274,8 +288,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 716b919563e486..ca5d9f7eb251e9 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,30 @@ export const steps = ({ configurations: [ { language: 'xml', + loading: sourcePackageRegistries?.isLoading, description: {t('Spring Boot 2')}, code: ` io.sentry sentry-spring-boot-starter - 6.27.0 + ${ + sourcePackageRegistries?.data?.['sentry.java.spring-boot']?.version ?? '6.27.0' + } `, }, { language: 'xml', + loading: sourcePackageRegistries?.isLoading, description: {t('Spring Boot 3')}, code: ` io.sentry sentry-spring-boot-starter-jakarta - 6.27.0 + ${ + sourcePackageRegistries?.data?.['sentry.java.spring-boot.jakarta']?.version ?? + '6.27.0' + } `, }, @@ -69,12 +77,20 @@ export const steps = ({ { language: 'properties', description: {t('Spring Boot 2')}, - code: "implementation 'io.sentry:sentry-spring-boot-starter:6.27.0'", + loading: sourcePackageRegistries?.isLoading, + code: `implementation 'io.sentry:sentry-spring-boot-starter:${ + sourcePackageRegistries?.data?.['sentry.java.spring-boot']?.version ?? + '6.27.0' + }'`, }, { language: 'properties', + loading: 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?.data?.['sentry.java.spring-boot.jakarta'] + ?.version ?? '6.27.0' + }'`, }, ], }, @@ -136,7 +152,9 @@ sentry: io.sentry sentry-logback - 6.27.0 + ${ + sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' + } `, }, @@ -151,7 +169,9 @@ sentry: io.sentry sentry-maven-plugin - 0.0.3 + ${ + sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + } true @@ -193,7 +213,10 @@ sentry: configurations: [ { language: 'properties', - code: "implementation 'io.sentry:sentry-logback:6.27.0'", + loading: sourcePackageRegistries?.isLoading, + code: `implementation 'io.sentry:sentry-logback:${ + 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 +231,10 @@ buildscript { } plugins { - id "io.sentry.jvm.gradle" version "3.11.1" + id "io.sentry.jvm.gradle" version "${ + sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' + }" } sentry { diff --git a/static/app/gettingStartedDocs/java/spring.tsx b/static/app/gettingStartedDocs/java/spring.tsx index d2273f41f82408..1434f67100825a 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,29 @@ export const steps = ({ configurations: [ { language: 'xml', + loading: sourcePackageRegistries?.isLoading, description: {t('Spring 5')}, code: ` io.sentry sentry-spring - 6.27.0 + ${ + sourcePackageRegistries?.data?.['sentry.java.spring']?.version ?? '6.27.0' + } `, }, { language: 'xml', + loading: sourcePackageRegistries?.isLoading, description: {t('Spring 6')}, code: ` io.sentry sentry-spring-jakarta - 6.27.0 + ${ + sourcePackageRegistries?.data?.['sentry.java.spring.jakarta']?.version ?? '6.27.0' + } `, }, @@ -155,6 +162,7 @@ import org.springframework.core.Ordered configurations: [ { language: 'xml', + loading: 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 +172,9 @@ import org.springframework.core.Ordered io.sentry sentry-maven-plugin - 0.0.3 + ${ + sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + } true @@ -206,12 +216,18 @@ import org.springframework.core.Ordered { description: {t('Spring 5')}, language: 'groovy', - code: `implementation 'io.sentry:sentry-spring:6.27.0'`, + loading: sourcePackageRegistries?.isLoading, + code: `implementation 'io.sentry:sentry-spring:${ + 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?.data?.['sentry.java.spring.jakarta']?.version ?? + '6.27.0' + }'`, }, ], }, @@ -272,6 +288,7 @@ try { configurations: [ { language: 'groovy', + loading: 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 +300,10 @@ repositories { } plugins { -id "io.sentry.jvm.gradle" version "3.11.1" +id "io.sentry.jvm.gradle" version "${ + sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' + }" } sentry { @@ -334,8 +354,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 abf6b8fd0edd2e..5843db48349c67 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 = ({ })}

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

{tct('For [strong:Maven], add to your [code:pom.xml] file:', { @@ -68,7 +73,9 @@ dependencies { io.sentry sentry - 6.25.0 + ${ + sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.25.0' + } `, }, @@ -175,8 +182,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 f17f6f877338cd..976f1847cfd3a1 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 3ed24a76068f5a..0cc964de8d79d4 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 62422470ded7e1..3f1be795fd3423 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 135856a11394f0..667b1a66f7b8b9 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 a0e430f050c098..db838002c3a0fd 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 512490ef56ed01..23cfae05b7dac4 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 63ffc829fa01b2..acea5ca5c2cf7f 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 182a0311216359..d4449607d68413 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 14773afe92eeb5..f2563efc656390 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 7ee4a4a08fd902..bab134199e265e 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 5648d294157d60..53ebe57dea3e0a 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 dca8949a2c0846..24c1c97a6ec997 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/django.tsx b/static/app/gettingStartedDocs/python/django.tsx index 58d9c58e8fbbbf..5d350db763893a 100644 --- a/static/app/gettingStartedDocs/python/django.tsx +++ b/static/app/gettingStartedDocs/python/django.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/falcon.tsx b/static/app/gettingStartedDocs/python/falcon.tsx index 4b2b913ca8be17..e3fa713c34eebd 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 965bc32ba58a0b..c8a8c3c7f0af0f 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 339986c359adca..83ad6ba926c975 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 fc0a73a466cc84..31a165a0698c12 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 93cdd46182d8bd..30057b6ea7b36d 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 394e3bb815a5f4..a775da153d8ede 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 71d389a4cbfe0f..7fb8994f8d8491 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 63e6db6332e1a7..ddc3e231349933 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 d5408f0d2b47d0..9295db403c08da 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 3075e4f9448b1e..53beac47fbf502 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 c6ae52492be394..632b287b39442a 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 8fbe79a6c057cf..e8ee834185a065 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 857b250c4a325a..fbcfc06f7cee78 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 423d85a5d98d80..3c8fa7779bce9d 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 27853d836e9963..b090a14bdb4b86 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 3cb90fc32f21d4..7fe3b4a7f000c4 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 7a01a14c5ce7c4..da2983fd845f77 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 eaa7d72cea2bfc..b6b1e53fd1a82e 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 896b402b7fd74a..99fa49bb758923 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 ca47af80ab46b3..ad028f6beb5dfe 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 006d344539bf26..ec800aaf138b5e 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,10 @@ export const steps = ({ configurations: [ { language: 'toml', + loading: sourcePackageRegistries?.isLoading, code: ` [dependencies] -sentry = "0.31.5" +sentry = "${sourcePackageRegistries?.data?.['sentry.rust'] ?? '0.30.0'}" `, }, ], @@ -76,8 +78,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 ed45d80806e485..ed0cd1258806a2 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,10 @@ export const steps = ({ configurations: [ { language: 'bash', - code: 'https://github.com/getsentry/unity.git#1.5.0', + loading: sourcePackageRegistries?.isLoading, + code: `https://github.com/getsentry/unity.git#${ + sourcePackageRegistries?.data?.['sentry.dotnet.unity']?.version ?? '1.5.0' + }`, }, ], additionalInfo: ( @@ -120,8 +124,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 212bf731b48f38..474068b6cf96a3 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/utils/queryClient.tsx b/static/app/utils/queryClient.tsx index 0c88b80e1d0372..20a0e34aa11255 100644 --- a/static/app/utils/queryClient.tsx +++ b/static/app/utils/queryClient.tsx @@ -1,7 +1,7 @@ import * as reactQuery from '@tanstack/react-query'; import {QueryClientConfig} from '@tanstack/react-query'; -import {ApiResult, ResponseMeta} from 'sentry/api'; +import {ApiResult, Client, ResponseMeta} from 'sentry/api'; import RequestError from 'sentry/utils/requestError/requestError'; import useApi from 'sentry/utils/useApi'; @@ -81,7 +81,14 @@ type UseApiQueryResult = reactQuery.UseQueryResult */ function useApiQuery( queryKey: ApiQueryKey, - options: UseApiQueryOptions + options: UseApiQueryOptions, + /** + * An existing API client may be provided. + * + * This is a continent way to re-use clients and still inherit the + * persistInFlight configuration. + */ + providedApi?: Client ): UseApiQueryResult { const api = useApi({ // XXX: We need to set persistInFlight to disable query cancellation on @@ -98,6 +105,7 @@ function useApiQuery( // // [0]: https://tanstack.com/query/v4/docs/guides/query-cancellation#default-behavior persistInFlight: true, + api: providedApi, }); const [path, endpointOptions] = queryKey; diff --git a/static/app/views/onboarding/onboarding.spec.tsx b/static/app/views/onboarding/onboarding.spec.tsx index ca13169f3454d1..9cea1f977ac2d3 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: 'https://release-registry.services.sentry.io/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: 'https://release-registry.services.sentry.io/sdks', + body: {}, + }); + MockApiClient.addMockResponse({ url: `/projects/org-slug/${reactProject.slug}/`, body: [reactProject], @@ -260,6 +270,11 @@ describe('Onboarding', function () { }, }); + MockApiClient.addMockResponse({ + url: 'https://release-registry.services.sentry.io/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 7cc01ffac444d3..86d4369f3eabe9 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: 'https://release-registry.services.sentry.io/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({ From f2d7b9f5ad96bd1462c14b8324dfd51fc9c750e9 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 14 Aug 2023 13:52:08 +0200 Subject: [PATCH 02/19] make prop optional --- .../onboarding/gettingStartedDoc/sdkDocumentation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx b/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx index 55a8743c90092e..7295c75de4d3aa 100644 --- a/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx @@ -18,12 +18,12 @@ type SdkDocumentationProps = { export type ModuleProps = { dsn: string; - sourcePackageRegistries: ReturnType; activeProductSelection?: ProductSolution[]; newOrg?: boolean; organization?: Organization; platformKey?: PlatformKey; projectId?: Project['id']; + sourcePackageRegistries?: ReturnType; }; // Loads the component containing the documentation for the specified platform From 7a9d4288ea76baa24719ef43deecd5bd7d0f1072 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 14 Aug 2023 13:56:10 +0200 Subject: [PATCH 03/19] add description to hook --- .../gettingStartedDoc/useSourcePackageRegistries.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx index a88f1be04755ba..34145a30deb8a0 100644 --- a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx @@ -17,6 +17,9 @@ type ReleaseRegistrySdk = Record< // /api/0/, but the default API client on the abstract issue form is... const API_CLIENT = new Client({baseUrl: '', headers: {}, credentials: 'omit'}); +/** + * Fetches the release registry list for SDKs + */ export function useSourcePackageRegistries() { const {isLoading, data} = useApiQuery( ['https://release-registry.services.sentry.io/sdks'], From 51a106fd2b83961db8f87e44688f9b979c97b1fb Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 14 Aug 2023 15:28:54 +0200 Subject: [PATCH 04/19] Update static/app/gettingStartedDocs/rust/rust.tsx --- static/app/gettingStartedDocs/rust/rust.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/gettingStartedDocs/rust/rust.tsx b/static/app/gettingStartedDocs/rust/rust.tsx index ec800aaf138b5e..c7f75345dddd61 100644 --- a/static/app/gettingStartedDocs/rust/rust.tsx +++ b/static/app/gettingStartedDocs/rust/rust.tsx @@ -26,7 +26,7 @@ export const steps = ({ loading: sourcePackageRegistries?.isLoading, code: ` [dependencies] -sentry = "${sourcePackageRegistries?.data?.['sentry.rust'] ?? '0.30.0'}" +sentry = "${sourcePackageRegistries?.data?.['sentry.rust'] ?? '0.31.5'}" `, }, ], From b77a11627e02b91d6b4cca32f5e2c551a85a4437 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 14 Aug 2023 19:31:03 +0200 Subject: [PATCH 05/19] cr feedback --- .../useSourcePackageRegistries.tsx | 11 ++++++++++- static/app/utils/handleXhrErrorResponse.tsx | 13 ++++++++++++- static/app/views/onboarding/setupDocs.tsx | 13 +++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx index 34145a30deb8a0..eff6f0e09bb68a 100644 --- a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx @@ -1,4 +1,7 @@ +import {useEffect} from 'react'; + import {Client} from 'sentry/api'; +import {handleXhrErrorResponse} from 'sentry/utils/handleXhrErrorResponse'; import {useApiQuery} from 'sentry/utils/queryClient'; type ReleaseRegistrySdk = Record< @@ -21,7 +24,7 @@ const API_CLIENT = new Client({baseUrl: '', headers: {}, credentials: 'omit'}); * Fetches the release registry list for SDKs */ export function useSourcePackageRegistries() { - const {isLoading, data} = useApiQuery( + const {isLoading, data, error} = useApiQuery( ['https://release-registry.services.sentry.io/sdks'], { staleTime: Infinity, @@ -29,6 +32,12 @@ export function useSourcePackageRegistries() { API_CLIENT ); + useEffect(() => { + if (error) { + handleXhrErrorResponse('Failed to fetch sentry release registry', error); + } + }, [error]); + return { isLoading, data, diff --git a/static/app/utils/handleXhrErrorResponse.tsx b/static/app/utils/handleXhrErrorResponse.tsx index 2c086114ac1325..684f1e6683d74c 100644 --- a/static/app/utils/handleXhrErrorResponse.tsx +++ b/static/app/utils/handleXhrErrorResponse.tsx @@ -32,7 +32,18 @@ export function handleXhrErrorResponse(message: string, err: RequestError): void Sentry.captureException( // We need to typecheck here even though `err` is typed in the function // signature because TS doesn't type thrown or rejected errors - err instanceof Error ? new Error(message, {cause: err}) : new Error(message) + err instanceof Error + ? new Error(message, { + cause: { + responseText: err.responseText, + responseJSON: err.responseJSON, + status: err.status, + statusText: err.statusText, + name: err.name, + stack: err.stack, + }, + }) + : new Error(message) ); }); } diff --git a/static/app/views/onboarding/setupDocs.tsx b/static/app/views/onboarding/setupDocs.tsx index f7a74d8153a6df..2f74f0b297c9a1 100644 --- a/static/app/views/onboarding/setupDocs.tsx +++ b/static/app/views/onboarding/setupDocs.tsx @@ -1,6 +1,7 @@ import {Fragment, useCallback, useEffect, useMemo, useState} from 'react'; import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import {motion} from 'framer-motion'; import {SdkDocumentation} from 'sentry/components/onboarding/gettingStartedDoc/sdkDocumentation'; @@ -75,6 +76,18 @@ function SetupDocs({location, recentCreatedProject: project}: StepProps) { /> ) : ( + Date: Thu, 17 Aug 2023 11:59:09 +0200 Subject: [PATCH 06/19] cr feedback --- static/app/components/codeSnippet.tsx | 4 ---- .../onboarding/gettingStartedDoc/step.tsx | 13 +++++++------ static/app/gettingStartedDocs/android/android.tsx | 2 +- static/app/gettingStartedDocs/apple/apple-ios.tsx | 2 +- static/app/gettingStartedDocs/apple/apple-macos.tsx | 2 +- static/app/gettingStartedDocs/apple/apple.tsx | 2 +- static/app/gettingStartedDocs/dart/dart.tsx | 2 +- static/app/gettingStartedDocs/dotnet/aspnet.tsx | 4 ++-- static/app/gettingStartedDocs/dotnet/aspnetcore.tsx | 4 ++-- static/app/gettingStartedDocs/dotnet/awslambda.tsx | 4 ++-- static/app/gettingStartedDocs/dotnet/dotnet.tsx | 2 +- .../app/gettingStartedDocs/dotnet/gcpfunctions.tsx | 6 +++--- static/app/gettingStartedDocs/dotnet/maui.tsx | 4 ++-- static/app/gettingStartedDocs/dotnet/uwp.tsx | 2 +- static/app/gettingStartedDocs/dotnet/winforms.tsx | 2 +- static/app/gettingStartedDocs/dotnet/wpf.tsx | 2 +- static/app/gettingStartedDocs/dotnet/xamarin.tsx | 2 +- static/app/gettingStartedDocs/flutter/flutter.tsx | 2 +- static/app/gettingStartedDocs/java/java.tsx | 10 +++++----- static/app/gettingStartedDocs/java/log4j2.tsx | 6 +++--- static/app/gettingStartedDocs/java/logback.tsx | 8 ++++---- static/app/gettingStartedDocs/java/spring-boot.tsx | 10 +++++----- static/app/gettingStartedDocs/java/spring.tsx | 10 +++++----- static/app/gettingStartedDocs/kotlin/kotlin.tsx | 4 ++-- static/app/gettingStartedDocs/rust/rust.tsx | 2 +- static/app/gettingStartedDocs/unity/unity.tsx | 2 +- 26 files changed, 55 insertions(+), 58 deletions(-) diff --git a/static/app/components/codeSnippet.tsx b/static/app/components/codeSnippet.tsx index cae9ff80d6cf88..8fa50be79c530c 100644 --- a/static/app/components/codeSnippet.tsx +++ b/static/app/components/codeSnippet.tsx @@ -21,10 +21,6 @@ interface CodeSnippetProps { disableUserSelection?: boolean; filename?: string; hideCopyButton?: boolean; - /** - * Weather the code snippet or parts of it, it is currently being loaded - */ - loading?: boolean; onCopy?: (copiedCode: string) => void; /** * Fired when the user selects and copies code snippet manually diff --git a/static/app/components/onboarding/gettingStartedDoc/step.tsx b/static/app/components/onboarding/gettingStartedDoc/step.tsx index 2d6a5af30df3db..5142aa36933762 100644 --- a/static/app/components/onboarding/gettingStartedDoc/step.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/step.tsx @@ -39,10 +39,6 @@ type ConfigurationType = { * The language of the code to be rendered (python, javascript, etc) */ language?: string; - /** - * Whether or not the configuration is currently being loaded - */ - loading?: boolean; /** * A callback to be invoked when the configuration is copied to the clipboard */ @@ -51,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 { @@ -83,7 +83,7 @@ function getConfiguration({ additionalInfo, onCopy, onSelectAndCopy, - loading, + partialLoading, }: ConfigurationType) { return ( @@ -94,7 +94,8 @@ function getConfiguration({ language={language} onCopy={onCopy} onSelectAndCopy={onSelectAndCopy} - loading={loading} + hideCopyButton={partialLoading} + disableUserSelection={partialLoading} > {language === 'javascript' ? beautify.js(code, {indent_size: 2, e4x: true}) diff --git a/static/app/gettingStartedDocs/android/android.tsx b/static/app/gettingStartedDocs/android/android.tsx index fee41fbfc9c20a..cebd0402ce3879 100644 --- a/static/app/gettingStartedDocs/android/android.tsx +++ b/static/app/gettingStartedDocs/android/android.tsx @@ -29,7 +29,7 @@ export const steps = ({ configurations: [ { language: 'groovy', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` plugins { id "com.android.application" // should be in the same module diff --git a/static/app/gettingStartedDocs/apple/apple-ios.tsx b/static/app/gettingStartedDocs/apple/apple-ios.tsx index c7ada4afb68f63..129bd5e581c39e 100644 --- a/static/app/gettingStartedDocs/apple/apple-ios.tsx +++ b/static/app/gettingStartedDocs/apple/apple-ios.tsx @@ -45,7 +45,7 @@ https://github.com/getsentry/sentry-cocoa.git

), language: 'swift', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` .package(url: "https://github.com/getsentry/sentry-cocoa", from: "${ sourcePackageRegistries?.data?.['sentry.cocoa']?.version ?? '8.9.3' diff --git a/static/app/gettingStartedDocs/apple/apple-macos.tsx b/static/app/gettingStartedDocs/apple/apple-macos.tsx index e5a9c6d03f0cdd..ae83272f4dc0d1 100644 --- a/static/app/gettingStartedDocs/apple/apple-macos.tsx +++ b/static/app/gettingStartedDocs/apple/apple-macos.tsx @@ -45,7 +45,7 @@ https://github.com/getsentry/sentry-cocoa.git

), language: 'swift', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` .package(url: "https://github.com/getsentry/sentry-cocoa", from: "${ sourcePackageRegistries?.data?.['sentry.cocoa']?.version ?? '8.9.3' diff --git a/static/app/gettingStartedDocs/apple/apple.tsx b/static/app/gettingStartedDocs/apple/apple.tsx index e74b53c24e919d..36f87646fb952c 100644 --- a/static/app/gettingStartedDocs/apple/apple.tsx +++ b/static/app/gettingStartedDocs/apple/apple.tsx @@ -45,7 +45,7 @@ https://github.com/getsentry/sentry-cocoa.git

), language: 'swift', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` .package(url: "https://github.com/getsentry/sentry-cocoa", from: "${ sourcePackageRegistries?.data?.['sentry.cocoa']?.version ?? '8.9.3' diff --git a/static/app/gettingStartedDocs/dart/dart.tsx b/static/app/gettingStartedDocs/dart/dart.tsx index 6c937c756c582b..03ece85420dec5 100644 --- a/static/app/gettingStartedDocs/dart/dart.tsx +++ b/static/app/gettingStartedDocs/dart/dart.tsx @@ -26,7 +26,7 @@ export const steps = ({ configurations: [ { language: 'yml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` dependencies: sentry: ^${sourcePackageRegistries?.data?.['sentry.dart']?.version ?? '7.8.0'} diff --git a/static/app/gettingStartedDocs/dotnet/aspnet.tsx b/static/app/gettingStartedDocs/dotnet/aspnet.tsx index 9f2a357a5106a6..543c85f7fc30b4 100644 --- a/static/app/gettingStartedDocs/dotnet/aspnet.tsx +++ b/static/app/gettingStartedDocs/dotnet/aspnet.tsx @@ -29,7 +29,7 @@ export const steps = ({ configurations: [ { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t('Package Manager:'), code: `Install-Package Sentry.AspNet -Version ${ sourcePackageRegistries?.data?.['sentry.dotnet.aspnet']?.version ?? '3.34.0' @@ -37,7 +37,7 @@ export const steps = ({ }, { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t('Using Entity Framework 6?'), code: `Install-Package Sentry.EntityFramework -Version ${ sourcePackageRegistries?.data?.['sentry.dotnet.ef']?.version ?? '3.34.0' diff --git a/static/app/gettingStartedDocs/dotnet/aspnetcore.tsx b/static/app/gettingStartedDocs/dotnet/aspnetcore.tsx index 59bbb9bc7e5dce..15093037933374 100644 --- a/static/app/gettingStartedDocs/dotnet/aspnetcore.tsx +++ b/static/app/gettingStartedDocs/dotnet/aspnetcore.tsx @@ -27,7 +27,7 @@ export const steps = ({ configurations: [ { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t('Package Manager:'), code: `Install-Package Sentry.AspNetCore -Version ${ sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? '3.34.0' @@ -35,7 +35,7 @@ export const steps = ({ }, { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t('Or .NET Core CLI:'), code: `dotnet add package Sentry.AspNetCore -v ${ sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? '3.34.0' diff --git a/static/app/gettingStartedDocs/dotnet/awslambda.tsx b/static/app/gettingStartedDocs/dotnet/awslambda.tsx index 85c090c41c4270..1bac7c66d3431a 100644 --- a/static/app/gettingStartedDocs/dotnet/awslambda.tsx +++ b/static/app/gettingStartedDocs/dotnet/awslambda.tsx @@ -29,14 +29,14 @@ export const steps = ({ configurations: [ { language: 'powershell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `Install-Package Sentry.AspNetCore -Version ${ sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? '3.34.0' }`, }, { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `dotnet add package Sentry.AspNetCore -v ${ sourcePackageRegistries?.data?.['sentry.dotnet.aspnetcore']?.version ?? '3.34.0' }`, diff --git a/static/app/gettingStartedDocs/dotnet/dotnet.tsx b/static/app/gettingStartedDocs/dotnet/dotnet.tsx index 7a655cc363c5c3..e5d9a74928e3d8 100644 --- a/static/app/gettingStartedDocs/dotnet/dotnet.tsx +++ b/static/app/gettingStartedDocs/dotnet/dotnet.tsx @@ -38,7 +38,7 @@ export const steps = ({ configurations: [ { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager Install-Package Sentry -Version ${ diff --git a/static/app/gettingStartedDocs/dotnet/gcpfunctions.tsx b/static/app/gettingStartedDocs/dotnet/gcpfunctions.tsx index 490629bf550ba4..30cfa56753ad49 100644 --- a/static/app/gettingStartedDocs/dotnet/gcpfunctions.tsx +++ b/static/app/gettingStartedDocs/dotnet/gcpfunctions.tsx @@ -27,7 +27,7 @@ export const steps = ({ configurations: [ { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t('Package Manager:'), code: `Install-Package Sentry.Google.Cloud.Functions -Version ${ sourcePackageRegistries?.data?.['sentry.dotnet.google-cloud-function'] @@ -36,7 +36,7 @@ export const steps = ({ }, { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t('Or .NET Core CLI:'), code: `dotnet add package Sentry.Google.Cloud.Functions -v ${ sourcePackageRegistries?.data?.['sentry.dotnet.google-cloud-function'] @@ -45,7 +45,7 @@ export const steps = ({ }, { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t('Or, manually add the Sentry dependency into your csproj file:'), code: ` diff --git a/static/app/gettingStartedDocs/dotnet/maui.tsx b/static/app/gettingStartedDocs/dotnet/maui.tsx index 98c857d900e301..e9fcd966405c85 100644 --- a/static/app/gettingStartedDocs/dotnet/maui.tsx +++ b/static/app/gettingStartedDocs/dotnet/maui.tsx @@ -25,14 +25,14 @@ export const steps = ({ configurations: [ { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `dotnet add package Sentry.Maui -v ${ sourcePackageRegistries?.data?.['sentry.dotnet.maui']?.version ?? '3.34.0' }`, }, { language: 'powershell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `Install-Package Sentry.Maui -Version ${ sourcePackageRegistries?.data?.['sentry.dotnet.maui']?.version ?? '3.34.0' }`, diff --git a/static/app/gettingStartedDocs/dotnet/uwp.tsx b/static/app/gettingStartedDocs/dotnet/uwp.tsx index 4a3fa67bf069c4..c13a77bbc81528 100644 --- a/static/app/gettingStartedDocs/dotnet/uwp.tsx +++ b/static/app/gettingStartedDocs/dotnet/uwp.tsx @@ -29,7 +29,7 @@ export const steps = ({ configurations: [ { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager Install-Package Sentry -Version ${ diff --git a/static/app/gettingStartedDocs/dotnet/winforms.tsx b/static/app/gettingStartedDocs/dotnet/winforms.tsx index 91749c784dddb5..d520b543125a19 100644 --- a/static/app/gettingStartedDocs/dotnet/winforms.tsx +++ b/static/app/gettingStartedDocs/dotnet/winforms.tsx @@ -29,7 +29,7 @@ export const steps = ({ configurations: [ { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager Install-Package Sentry -Version ${ diff --git a/static/app/gettingStartedDocs/dotnet/wpf.tsx b/static/app/gettingStartedDocs/dotnet/wpf.tsx index d2b659fad57075..158119a3440a12 100644 --- a/static/app/gettingStartedDocs/dotnet/wpf.tsx +++ b/static/app/gettingStartedDocs/dotnet/wpf.tsx @@ -29,7 +29,7 @@ export const steps = ({ configurations: [ { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` # Using Package Manager Install-Package Sentry -Version ${ diff --git a/static/app/gettingStartedDocs/dotnet/xamarin.tsx b/static/app/gettingStartedDocs/dotnet/xamarin.tsx index b06385f2b733ee..9df261091ab17f 100644 --- a/static/app/gettingStartedDocs/dotnet/xamarin.tsx +++ b/static/app/gettingStartedDocs/dotnet/xamarin.tsx @@ -25,7 +25,7 @@ export const steps = ({ configurations: [ { language: 'shell', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` # For Xamarin.Forms Install-Package Sentry.Xamarin.Forms -Version ${ diff --git a/static/app/gettingStartedDocs/flutter/flutter.tsx b/static/app/gettingStartedDocs/flutter/flutter.tsx index c62f0f7a906740..0b20f59efb2911 100644 --- a/static/app/gettingStartedDocs/flutter/flutter.tsx +++ b/static/app/gettingStartedDocs/flutter/flutter.tsx @@ -26,7 +26,7 @@ export const steps = ({ configurations: [ { language: 'yml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` dependencies: sentry_flutter: ^${ diff --git a/static/app/gettingStartedDocs/java/java.tsx b/static/app/gettingStartedDocs/java/java.tsx index 726e14a8096959..0a5a91ab9240a0 100644 --- a/static/app/gettingStartedDocs/java/java.tsx +++ b/static/app/gettingStartedDocs/java/java.tsx @@ -34,7 +34,7 @@ export const steps = ({ configurations: [ { language: 'groovy', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: (

{tct('For Gradle, add to your [code:build.gradle] file:', { @@ -58,7 +58,7 @@ dependencies { }, { language: 'groovy', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Gradle plugin.' ), @@ -95,7 +95,7 @@ sentry { configurations: [ { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: (

{tct('For Maven, add to your [code:pom.xml] file:', {code: })} @@ -113,7 +113,7 @@ sentry { }, { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Maven plugin.' ), @@ -168,7 +168,7 @@ sentry { { description:

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

, language: 'scala', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `libraryDependencies += "io.sentry" % "sentry" % "${ sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' }"`, diff --git a/static/app/gettingStartedDocs/java/log4j2.tsx b/static/app/gettingStartedDocs/java/log4j2.tsx index 9dfc4087a365b1..035813ba113925 100644 --- a/static/app/gettingStartedDocs/java/log4j2.tsx +++ b/static/app/gettingStartedDocs/java/log4j2.tsx @@ -39,7 +39,7 @@ export const steps = ({ configurations: [ { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` io.sentry @@ -52,7 +52,7 @@ export const steps = ({ }, { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Maven plugin.' ), @@ -106,7 +106,7 @@ export const steps = ({ configurations: [ { language: 'groovy', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `implementation 'io.sentry:sentry-log4j2:${ sourcePackageRegistries?.data?.['sentry.java.log4j2']?.version ?? '6.27.0' }'`, diff --git a/static/app/gettingStartedDocs/java/logback.tsx b/static/app/gettingStartedDocs/java/logback.tsx index 5dd5cf795a0e12..11f1b8b794f121 100644 --- a/static/app/gettingStartedDocs/java/logback.tsx +++ b/static/app/gettingStartedDocs/java/logback.tsx @@ -37,7 +37,7 @@ export const steps = ({ configurations: [ { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` io.sentry @@ -50,7 +50,7 @@ export const steps = ({ }, { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Maven plugin.' ), @@ -104,7 +104,7 @@ export const steps = ({ configurations: [ { language: 'groovy', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `implementation 'io.sentry:sentry-logback:${ sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' }'`, @@ -114,7 +114,7 @@ export const steps = ({ 'To upload your source code to Sentry so it can be shown in stack traces, use our Maven plugin.' ), language: 'groovy', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` buildscript { repositories { diff --git a/static/app/gettingStartedDocs/java/spring-boot.tsx b/static/app/gettingStartedDocs/java/spring-boot.tsx index ca5d9f7eb251e9..ec717b69d1c7c9 100644 --- a/static/app/gettingStartedDocs/java/spring-boot.tsx +++ b/static/app/gettingStartedDocs/java/spring-boot.tsx @@ -42,7 +42,7 @@ export const steps = ({ configurations: [ { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring Boot 2')}, code: ` @@ -56,7 +56,7 @@ export const steps = ({ }, { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring Boot 3')}, code: ` @@ -77,7 +77,7 @@ export const steps = ({ { language: 'properties', description: {t('Spring Boot 2')}, - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `implementation 'io.sentry:sentry-spring-boot-starter:${ sourcePackageRegistries?.data?.['sentry.java.spring-boot']?.version ?? '6.27.0' @@ -85,7 +85,7 @@ export const steps = ({ }, { language: 'properties', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring Boot 3')}, code: `implementation 'io.sentry:sentry-spring-boot-starter-jakarta:${ sourcePackageRegistries?.data?.['sentry.java.spring-boot.jakarta'] @@ -213,7 +213,7 @@ sentry: configurations: [ { language: 'properties', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `implementation 'io.sentry:sentry-logback:${ sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' }'`, diff --git a/static/app/gettingStartedDocs/java/spring.tsx b/static/app/gettingStartedDocs/java/spring.tsx index 1434f67100825a..950b977d3e71af 100644 --- a/static/app/gettingStartedDocs/java/spring.tsx +++ b/static/app/gettingStartedDocs/java/spring.tsx @@ -43,7 +43,7 @@ export const steps = ({ configurations: [ { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring 5')}, code: ` @@ -57,7 +57,7 @@ export const steps = ({ }, { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring 6')}, code: ` @@ -162,7 +162,7 @@ import org.springframework.core.Ordered configurations: [ { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Maven plugin.' ), @@ -216,7 +216,7 @@ import org.springframework.core.Ordered { description: {t('Spring 5')}, language: 'groovy', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `implementation 'io.sentry:sentry-spring:${ sourcePackageRegistries?.data?.['sentry.java.spring']?.version ?? '6.27.0' }'`, @@ -288,7 +288,7 @@ try { configurations: [ { language: 'groovy', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: t( 'To upload your source code to Sentry so it can be shown in stack traces, use our Gradle plugin.' ), diff --git a/static/app/gettingStartedDocs/kotlin/kotlin.tsx b/static/app/gettingStartedDocs/kotlin/kotlin.tsx index 5843db48349c67..f4ab645d85e49d 100644 --- a/static/app/gettingStartedDocs/kotlin/kotlin.tsx +++ b/static/app/gettingStartedDocs/kotlin/kotlin.tsx @@ -44,7 +44,7 @@ export const steps = ({ })}

), - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` // Make sure mavenCentral is there. repositories { @@ -60,7 +60,7 @@ dependencies { }, { language: 'xml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, description: (

{tct('For [strong:Maven], add to your [code:pom.xml] file:', { diff --git a/static/app/gettingStartedDocs/rust/rust.tsx b/static/app/gettingStartedDocs/rust/rust.tsx index c7f75345dddd61..293b55d3722c0b 100644 --- a/static/app/gettingStartedDocs/rust/rust.tsx +++ b/static/app/gettingStartedDocs/rust/rust.tsx @@ -23,7 +23,7 @@ export const steps = ({ configurations: [ { language: 'toml', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: ` [dependencies] sentry = "${sourcePackageRegistries?.data?.['sentry.rust'] ?? '0.31.5'}" diff --git a/static/app/gettingStartedDocs/unity/unity.tsx b/static/app/gettingStartedDocs/unity/unity.tsx index ed0cd1258806a2..38fa7a0db9d908 100644 --- a/static/app/gettingStartedDocs/unity/unity.tsx +++ b/static/app/gettingStartedDocs/unity/unity.tsx @@ -32,7 +32,7 @@ export const steps = ({ configurations: [ { language: 'bash', - loading: sourcePackageRegistries?.isLoading, + partialLoading: sourcePackageRegistries?.isLoading, code: `https://github.com/getsentry/unity.git#${ sourcePackageRegistries?.data?.['sentry.dotnet.unity']?.version ?? '1.5.0' }`, From ec5d7c74ba95c4613d324f185a960c494939efff Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Thu, 17 Aug 2023 12:02:11 +0200 Subject: [PATCH 07/19] cr feedback --- .../gettingStartedDoc/useSourcePackageRegistries.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx index eff6f0e09bb68a..1fb87fe4300c65 100644 --- a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx @@ -24,7 +24,7 @@ const API_CLIENT = new Client({baseUrl: '', headers: {}, credentials: 'omit'}); * Fetches the release registry list for SDKs */ export function useSourcePackageRegistries() { - const {isLoading, data, error} = useApiQuery( + const releaseRegistrySdk = useApiQuery( ['https://release-registry.services.sentry.io/sdks'], { staleTime: Infinity, @@ -33,13 +33,10 @@ export function useSourcePackageRegistries() { ); useEffect(() => { - if (error) { + if (releaseRegistrySdk.error) { handleXhrErrorResponse('Failed to fetch sentry release registry', error); } - }, [error]); + }, [releaseRegistrySdk.error]); - return { - isLoading, - data, - }; + return releaseRegistrySdk; } From 0f05f3c7eac77bfa023dc3667807eccb7199a352 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Thu, 17 Aug 2023 12:03:26 +0200 Subject: [PATCH 08/19] remove test code --- static/app/views/onboarding/setupDocs.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/static/app/views/onboarding/setupDocs.tsx b/static/app/views/onboarding/setupDocs.tsx index 2f74f0b297c9a1..f7a74d8153a6df 100644 --- a/static/app/views/onboarding/setupDocs.tsx +++ b/static/app/views/onboarding/setupDocs.tsx @@ -1,7 +1,6 @@ import {Fragment, useCallback, useEffect, useMemo, useState} from 'react'; import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/react'; import {motion} from 'framer-motion'; import {SdkDocumentation} from 'sentry/components/onboarding/gettingStartedDoc/sdkDocumentation'; @@ -76,18 +75,6 @@ function SetupDocs({location, recentCreatedProject: project}: StepProps) { /> ) : ( - Date: Thu, 17 Aug 2023 13:14:40 +0200 Subject: [PATCH 09/19] fix tsc error --- .../gettingStartedDoc/useSourcePackageRegistries.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx index 1fb87fe4300c65..6ca38666436d90 100644 --- a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx @@ -34,7 +34,10 @@ export function useSourcePackageRegistries() { useEffect(() => { if (releaseRegistrySdk.error) { - handleXhrErrorResponse('Failed to fetch sentry release registry', error); + handleXhrErrorResponse( + 'Failed to fetch sentry release registry', + releaseRegistrySdk.error + ); } }, [releaseRegistrySdk.error]); From 1f34c19e9de5c952a79c124098da94522aff1572 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Thu, 17 Aug 2023 14:58:06 +0200 Subject: [PATCH 10/19] cr feedback --- .../gettingStartedDoc/sdkDocumentation.tsx | 1 + .../useSourcePackageRegistries.tsx | 2 +- .../gettingStartedDocs/android/android.tsx | 6 ++- .../gettingStartedDocs/apple/apple-ios.tsx | 4 +- .../gettingStartedDocs/apple/apple-macos.tsx | 4 +- static/app/gettingStartedDocs/apple/apple.tsx | 4 +- static/app/gettingStartedDocs/dart/dart.tsx | 6 ++- .../app/gettingStartedDocs/dotnet/aspnet.tsx | 8 +++- .../gettingStartedDocs/dotnet/aspnetcore.tsx | 10 ++++- .../gettingStartedDocs/dotnet/awslambda.tsx | 10 ++++- .../app/gettingStartedDocs/dotnet/dotnet.tsx | 8 +++- .../dotnet/gcpfunctions.tsx | 18 +++++--- static/app/gettingStartedDocs/dotnet/maui.tsx | 8 +++- static/app/gettingStartedDocs/dotnet/uwp.tsx | 8 +++- .../gettingStartedDocs/dotnet/winforms.tsx | 8 +++- static/app/gettingStartedDocs/dotnet/wpf.tsx | 8 +++- .../app/gettingStartedDocs/dotnet/xamarin.tsx | 10 +++-- .../gettingStartedDocs/flutter/flutter.tsx | 4 +- static/app/gettingStartedDocs/java/java.tsx | 22 +++++++--- static/app/gettingStartedDocs/java/log4j2.tsx | 19 ++++++--- .../app/gettingStartedDocs/java/logback.tsx | 19 ++++++--- .../gettingStartedDocs/java/spring-boot.tsx | 41 +++++++++++++------ static/app/gettingStartedDocs/java/spring.tsx | 29 +++++++++---- .../app/gettingStartedDocs/kotlin/kotlin.tsx | 8 +++- static/app/gettingStartedDocs/rust/rust.tsx | 6 ++- static/app/gettingStartedDocs/unity/unity.tsx | 4 +- 26 files changed, 202 insertions(+), 73 deletions(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx b/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx index 7295c75de4d3aa..6262eb9f405748 100644 --- a/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx @@ -99,6 +99,7 @@ export function SdkDocumentation({ } const {default: GettingStartedDoc} = module; + return ( `, diff --git a/static/app/gettingStartedDocs/dotnet/maui.tsx b/static/app/gettingStartedDocs/dotnet/maui.tsx index e9fcd966405c85..5b6427ce03fcb2 100644 --- a/static/app/gettingStartedDocs/dotnet/maui.tsx +++ b/static/app/gettingStartedDocs/dotnet/maui.tsx @@ -27,14 +27,18 @@ export const steps = ({ language: 'shell', partialLoading: sourcePackageRegistries?.isLoading, code: `dotnet add package Sentry.Maui -v ${ - sourcePackageRegistries?.data?.['sentry.dotnet.maui']?.version ?? '3.34.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.maui']?.version ?? '3.34.0' }`, }, { language: 'powershell', partialLoading: sourcePackageRegistries?.isLoading, code: `Install-Package Sentry.Maui -Version ${ - sourcePackageRegistries?.data?.['sentry.dotnet.maui']?.version ?? '3.34.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.maui']?.version ?? '3.34.0' }`, }, ], diff --git a/static/app/gettingStartedDocs/dotnet/uwp.tsx b/static/app/gettingStartedDocs/dotnet/uwp.tsx index c13a77bbc81528..e3b5d661d9e20f 100644 --- a/static/app/gettingStartedDocs/dotnet/uwp.tsx +++ b/static/app/gettingStartedDocs/dotnet/uwp.tsx @@ -33,12 +33,16 @@ export const steps = ({ code: ` # Using Package Manager Install-Package Sentry -Version ${ - sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' } # Or using .NET Core CLI dotnet add package Sentry -v ${ - sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' } `, }, diff --git a/static/app/gettingStartedDocs/dotnet/winforms.tsx b/static/app/gettingStartedDocs/dotnet/winforms.tsx index d520b543125a19..d604ac45826794 100644 --- a/static/app/gettingStartedDocs/dotnet/winforms.tsx +++ b/static/app/gettingStartedDocs/dotnet/winforms.tsx @@ -33,12 +33,16 @@ export const steps = ({ code: ` # Using Package Manager Install-Package Sentry -Version ${ - sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' } # Or using .NET Core CLI dotnet add package Sentry -v ${ - sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' } `, }, diff --git a/static/app/gettingStartedDocs/dotnet/wpf.tsx b/static/app/gettingStartedDocs/dotnet/wpf.tsx index 158119a3440a12..189de96a882978 100644 --- a/static/app/gettingStartedDocs/dotnet/wpf.tsx +++ b/static/app/gettingStartedDocs/dotnet/wpf.tsx @@ -33,12 +33,16 @@ export const steps = ({ code: ` # Using Package Manager Install-Package Sentry -Version ${ - sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' } # Or using .NET Core CLI dotnet add package Sentry -v ${ - sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet']?.version ?? '3.34.0' } `, }, diff --git a/static/app/gettingStartedDocs/dotnet/xamarin.tsx b/static/app/gettingStartedDocs/dotnet/xamarin.tsx index 9df261091ab17f..567384f4a29370 100644 --- a/static/app/gettingStartedDocs/dotnet/xamarin.tsx +++ b/static/app/gettingStartedDocs/dotnet/xamarin.tsx @@ -29,13 +29,17 @@ export const steps = ({ code: ` # For Xamarin.Forms Install-Package Sentry.Xamarin.Forms -Version ${ - sourcePackageRegistries?.data?.['sentry.dotnet.xamarin-forms']?.version ?? - '1.5.2' + 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 ${ - sourcePackageRegistries?.data?.['sentry.dotnet.xamarin']?.version ?? '1.5.2' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.xamarin']?.version ?? '1.5.2' } `, }, diff --git a/static/app/gettingStartedDocs/flutter/flutter.tsx b/static/app/gettingStartedDocs/flutter/flutter.tsx index 0b20f59efb2911..d918228688ebfb 100644 --- a/static/app/gettingStartedDocs/flutter/flutter.tsx +++ b/static/app/gettingStartedDocs/flutter/flutter.tsx @@ -30,7 +30,9 @@ export const steps = ({ code: ` dependencies: sentry_flutter: ^${ - sourcePackageRegistries?.data?.['sentry.dart.flutter']?.version ?? '7.8.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dart.flutter']?.version ?? '7.8.0' } `, }, diff --git a/static/app/gettingStartedDocs/java/java.tsx b/static/app/gettingStartedDocs/java/java.tsx index 0a5a91ab9240a0..360e6db16276ce 100644 --- a/static/app/gettingStartedDocs/java/java.tsx +++ b/static/app/gettingStartedDocs/java/java.tsx @@ -51,7 +51,9 @@ repositories { // Add Sentry's SDK as a dependency. dependencies { implementation 'io.sentry:sentry:${ - sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' }' } `, @@ -71,8 +73,10 @@ buildscript { plugins { id "io.sentry.jvm.gradle" version "${ - sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? - '3.11.1' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' }" } @@ -106,7 +110,9 @@ sentry { io.sentry sentry ${ - sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' } `, @@ -124,7 +130,9 @@ sentry { io.sentry sentry-maven-plugin ${ - sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' } @@ -170,7 +178,9 @@ sentry { language: 'scala', partialLoading: sourcePackageRegistries?.isLoading, code: `libraryDependencies += "io.sentry" % "sentry" % "${ - sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.27.0' }"`, }, ], diff --git a/static/app/gettingStartedDocs/java/log4j2.tsx b/static/app/gettingStartedDocs/java/log4j2.tsx index 035813ba113925..a34e47ca4de5d5 100644 --- a/static/app/gettingStartedDocs/java/log4j2.tsx +++ b/static/app/gettingStartedDocs/java/log4j2.tsx @@ -45,7 +45,9 @@ export const steps = ({ io.sentry sentry-log4j2 ${ - sourcePackageRegistries?.data?.['sentry.java.log4j2']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.log4j2']?.version ?? '6.27.0' } `, @@ -63,7 +65,9 @@ export const steps = ({ io.sentry sentry-maven-plugin ${ - sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' } @@ -108,7 +112,10 @@ export const steps = ({ language: 'groovy', partialLoading: sourcePackageRegistries?.isLoading, code: `implementation 'io.sentry:sentry-log4j2:${ - sourcePackageRegistries?.data?.['sentry.java.log4j2']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.log4j2']?.version ?? + '6.27.0' }'`, }, { @@ -125,8 +132,10 @@ buildscript { plugins { id "io.sentry.jvm.gradle" version "${ - sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? - '3.11.1' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' }" } diff --git a/static/app/gettingStartedDocs/java/logback.tsx b/static/app/gettingStartedDocs/java/logback.tsx index 11f1b8b794f121..93ac2e1dd78983 100644 --- a/static/app/gettingStartedDocs/java/logback.tsx +++ b/static/app/gettingStartedDocs/java/logback.tsx @@ -43,7 +43,9 @@ export const steps = ({ io.sentry sentry-logback ${ - sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' } `, @@ -61,7 +63,9 @@ export const steps = ({ io.sentry sentry-maven-plugin ${ - sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' } @@ -106,7 +110,10 @@ export const steps = ({ language: 'groovy', partialLoading: sourcePackageRegistries?.isLoading, code: `implementation 'io.sentry:sentry-logback:${ - sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? + '6.27.0' }'`, }, { @@ -124,8 +131,10 @@ buildscript { plugins { id "io.sentry.jvm.gradle" version "${ - sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? - '3.11.1' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' }" } diff --git a/static/app/gettingStartedDocs/java/spring-boot.tsx b/static/app/gettingStartedDocs/java/spring-boot.tsx index ec717b69d1c7c9..dfbbd13da47402 100644 --- a/static/app/gettingStartedDocs/java/spring-boot.tsx +++ b/static/app/gettingStartedDocs/java/spring-boot.tsx @@ -49,7 +49,9 @@ export const steps = ({ io.sentry sentry-spring-boot-starter ${ - sourcePackageRegistries?.data?.['sentry.java.spring-boot']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring-boot']?.version ?? '6.27.0' } `, @@ -63,8 +65,10 @@ export const steps = ({ io.sentry sentry-spring-boot-starter-jakarta ${ - sourcePackageRegistries?.data?.['sentry.java.spring-boot.jakarta']?.version ?? - '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring-boot.jakarta']?.version ?? + '6.27.0' } `, @@ -79,8 +83,10 @@ export const steps = ({ description: {t('Spring Boot 2')}, partialLoading: sourcePackageRegistries?.isLoading, code: `implementation 'io.sentry:sentry-spring-boot-starter:${ - sourcePackageRegistries?.data?.['sentry.java.spring-boot']?.version ?? - '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring-boot']?.version ?? + '6.27.0' }'`, }, { @@ -88,8 +94,10 @@ export const steps = ({ partialLoading: sourcePackageRegistries?.isLoading, description: {t('Spring Boot 3')}, code: `implementation 'io.sentry:sentry-spring-boot-starter-jakarta:${ - sourcePackageRegistries?.data?.['sentry.java.spring-boot.jakarta'] - ?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring-boot.jakarta'] + ?.version ?? '6.27.0' }'`, }, ], @@ -153,7 +161,9 @@ sentry: io.sentry sentry-logback ${ - sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' } `, @@ -170,7 +180,9 @@ sentry: io.sentry sentry-maven-plugin ${ - sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' } @@ -215,7 +227,10 @@ sentry: language: 'properties', partialLoading: sourcePackageRegistries?.isLoading, code: `implementation 'io.sentry:sentry-logback:${ - sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.logback']?.version ?? + '6.27.0' }'`, }, { @@ -232,8 +247,10 @@ buildscript { plugins { id "io.sentry.jvm.gradle" version "${ - sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? - '3.11.1' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? + '3.11.1' }" } diff --git a/static/app/gettingStartedDocs/java/spring.tsx b/static/app/gettingStartedDocs/java/spring.tsx index 950b977d3e71af..dcf16d23944b72 100644 --- a/static/app/gettingStartedDocs/java/spring.tsx +++ b/static/app/gettingStartedDocs/java/spring.tsx @@ -50,7 +50,9 @@ export const steps = ({ io.sentry sentry-spring ${ - sourcePackageRegistries?.data?.['sentry.java.spring']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring']?.version ?? '6.27.0' } `, @@ -64,7 +66,9 @@ export const steps = ({ io.sentry sentry-spring-jakarta ${ - sourcePackageRegistries?.data?.['sentry.java.spring.jakarta']?.version ?? '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring.jakarta']?.version ?? '6.27.0' } `, @@ -173,7 +177,9 @@ import org.springframework.core.Ordered io.sentry sentry-maven-plugin ${ - sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.mavenplugin']?.version ?? '0.0.3' } @@ -218,15 +224,20 @@ import org.springframework.core.Ordered language: 'groovy', partialLoading: sourcePackageRegistries?.isLoading, code: `implementation 'io.sentry:sentry-spring:${ - sourcePackageRegistries?.data?.['sentry.java.spring']?.version ?? '6.27.0' + 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:${ - sourcePackageRegistries?.data?.['sentry.java.spring.jakarta']?.version ?? - '6.27.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.spring.jakarta'] + ?.version ?? '6.27.0' }'`, }, ], @@ -301,8 +312,10 @@ repositories { plugins { id "io.sentry.jvm.gradle" version "${ - sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin']?.version ?? - '3.11.1' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java.android.gradle-plugin'] + ?.version ?? '3.11.1' }" } diff --git a/static/app/gettingStartedDocs/kotlin/kotlin.tsx b/static/app/gettingStartedDocs/kotlin/kotlin.tsx index f4ab645d85e49d..ee13cf141fc342 100644 --- a/static/app/gettingStartedDocs/kotlin/kotlin.tsx +++ b/static/app/gettingStartedDocs/kotlin/kotlin.tsx @@ -53,7 +53,9 @@ repositories { dependencies { implementation 'io.sentry:sentry:${ - sourcePackageRegistries?.data?.['sentry.java']?.version ?? '4.0.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java']?.version ?? '4.0.0' }' } `, @@ -74,7 +76,9 @@ dependencies { io.sentry sentry ${ - sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.25.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.java']?.version ?? '6.25.0' } `, diff --git a/static/app/gettingStartedDocs/rust/rust.tsx b/static/app/gettingStartedDocs/rust/rust.tsx index 293b55d3722c0b..d68643da4d5400 100644 --- a/static/app/gettingStartedDocs/rust/rust.tsx +++ b/static/app/gettingStartedDocs/rust/rust.tsx @@ -26,7 +26,11 @@ export const steps = ({ partialLoading: sourcePackageRegistries?.isLoading, code: ` [dependencies] -sentry = "${sourcePackageRegistries?.data?.['sentry.rust'] ?? '0.31.5'}" +sentry = "${ + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.rust'] ?? '0.31.5' + }" `, }, ], diff --git a/static/app/gettingStartedDocs/unity/unity.tsx b/static/app/gettingStartedDocs/unity/unity.tsx index 38fa7a0db9d908..f04a9376322c2c 100644 --- a/static/app/gettingStartedDocs/unity/unity.tsx +++ b/static/app/gettingStartedDocs/unity/unity.tsx @@ -34,7 +34,9 @@ export const steps = ({ language: 'bash', partialLoading: sourcePackageRegistries?.isLoading, code: `https://github.com/getsentry/unity.git#${ - sourcePackageRegistries?.data?.['sentry.dotnet.unity']?.version ?? '1.5.0' + sourcePackageRegistries?.isLoading + ? t('\u2026loading') + : sourcePackageRegistries?.data?.['sentry.dotnet.unity']?.version ?? '1.5.0' }`, }, ], From eea3f5131b3a6e42ce838ea146735a6ca5f1dc4b Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Thu, 17 Aug 2023 15:04:35 +0200 Subject: [PATCH 11/19] revert new changes --- .../onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx index daf8544182e672..6ca38666436d90 100644 --- a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx @@ -41,5 +41,5 @@ export function useSourcePackageRegistries() { } }, [releaseRegistrySdk.error]); - return {...releaseRegistrySdk, isLoading}; + return releaseRegistrySdk; } From bd3397bdd8bb9879e6fcb113f373661108b73c23 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Thu, 17 Aug 2023 16:07:28 +0200 Subject: [PATCH 12/19] Matej cr feedback --- static/app/utils/handleXhrErrorResponse.tsx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/static/app/utils/handleXhrErrorResponse.tsx b/static/app/utils/handleXhrErrorResponse.tsx index 684f1e6683d74c..2c086114ac1325 100644 --- a/static/app/utils/handleXhrErrorResponse.tsx +++ b/static/app/utils/handleXhrErrorResponse.tsx @@ -32,18 +32,7 @@ export function handleXhrErrorResponse(message: string, err: RequestError): void Sentry.captureException( // We need to typecheck here even though `err` is typed in the function // signature because TS doesn't type thrown or rejected errors - err instanceof Error - ? new Error(message, { - cause: { - responseText: err.responseText, - responseJSON: err.responseJSON, - status: err.status, - statusText: err.statusText, - name: err.name, - stack: err.stack, - }, - }) - : new Error(message) + err instanceof Error ? new Error(message, {cause: err}) : new Error(message) ); }); } From dfe77c2ec2f565bb04c7dbb9d7d9f69f4f9a8ce9 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Thu, 17 Aug 2023 17:26:20 +0200 Subject: [PATCH 13/19] checking cross-origin error --- .../onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx index 6ca38666436d90..8a4f95700794ea 100644 --- a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx @@ -18,7 +18,7 @@ type ReleaseRegistrySdk = Record< // This exists because /extensions/type/search API is not prefixed with // /api/0/, but the default API client on the abstract issue form is... -const API_CLIENT = new Client({baseUrl: '', headers: {}, credentials: 'omit'}); +const API_CLIENT = new Client({baseUrl: '', credentials: 'omit'}); /** * Fetches the release registry list for SDKs From c4f57503c36a6bfe1bef34c6f9b882a6cb1bb623 Mon Sep 17 00:00:00 2001 From: Arthur Knaus Date: Fri, 18 Aug 2023 10:16:51 +0200 Subject: [PATCH 14/19] ref(onboarding-docs): Use api/0/ endpoint for fetching the release registry --- .../gettingStartedDoc/sdkDocumentation.tsx | 2 +- .../useSourcePackageRegistries.tsx | 13 ++++--------- static/app/utils/queryClient.tsx | 12 ++---------- static/app/views/onboarding/onboarding.spec.tsx | 6 +++--- static/app/views/onboarding/setupDocs.spec.tsx | 2 +- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx b/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx index 6262eb9f405748..7c5a92b98fb7cf 100644 --- a/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx @@ -35,7 +35,7 @@ export function SdkDocumentation({ organization, projectId, }: SdkDocumentationProps) { - const sourcePackageRegistries = useSourcePackageRegistries(); + const sourcePackageRegistries = useSourcePackageRegistries(organization); const [module, setModule] = useState; diff --git a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx index 8a4f95700794ea..02d3a6edd53948 100644 --- a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx @@ -1,6 +1,6 @@ import {useEffect} from 'react'; -import {Client} from 'sentry/api'; +import {Organization} from 'sentry/types'; import {handleXhrErrorResponse} from 'sentry/utils/handleXhrErrorResponse'; import {useApiQuery} from 'sentry/utils/queryClient'; @@ -16,20 +16,15 @@ type ReleaseRegistrySdk = Record< } >; -// This exists because /extensions/type/search API is not prefixed with -// /api/0/, but the default API client on the abstract issue form is... -const API_CLIENT = new Client({baseUrl: '', credentials: 'omit'}); - /** * Fetches the release registry list for SDKs */ -export function useSourcePackageRegistries() { +export function useSourcePackageRegistries(organization: Organization) { const releaseRegistrySdk = useApiQuery( - ['https://release-registry.services.sentry.io/sdks'], + [`/${organization.slug}/sdks/`], { staleTime: Infinity, - }, - API_CLIENT + } ); useEffect(() => { diff --git a/static/app/utils/queryClient.tsx b/static/app/utils/queryClient.tsx index 20a0e34aa11255..0c88b80e1d0372 100644 --- a/static/app/utils/queryClient.tsx +++ b/static/app/utils/queryClient.tsx @@ -1,7 +1,7 @@ import * as reactQuery from '@tanstack/react-query'; import {QueryClientConfig} from '@tanstack/react-query'; -import {ApiResult, Client, ResponseMeta} from 'sentry/api'; +import {ApiResult, ResponseMeta} from 'sentry/api'; import RequestError from 'sentry/utils/requestError/requestError'; import useApi from 'sentry/utils/useApi'; @@ -81,14 +81,7 @@ type UseApiQueryResult = reactQuery.UseQueryResult */ function useApiQuery( queryKey: ApiQueryKey, - options: UseApiQueryOptions, - /** - * An existing API client may be provided. - * - * This is a continent way to re-use clients and still inherit the - * persistInFlight configuration. - */ - providedApi?: Client + options: UseApiQueryOptions ): UseApiQueryResult { const api = useApi({ // XXX: We need to set persistInFlight to disable query cancellation on @@ -105,7 +98,6 @@ function useApiQuery( // // [0]: https://tanstack.com/query/v4/docs/guides/query-cancellation#default-behavior persistInFlight: true, - api: providedApi, }); const [path, endpointOptions] = queryKey; diff --git a/static/app/views/onboarding/onboarding.spec.tsx b/static/app/views/onboarding/onboarding.spec.tsx index 9cea1f977ac2d3..3ec869524ecb27 100644 --- a/static/app/views/onboarding/onboarding.spec.tsx +++ b/static/app/views/onboarding/onboarding.spec.tsx @@ -86,7 +86,7 @@ describe('Onboarding', function () { }); MockApiClient.addMockResponse({ - url: 'https://release-registry.services.sentry.io/sdks', + url: `/${organization.slug}/sdks/`, body: {}, }); @@ -176,7 +176,7 @@ describe('Onboarding', function () { }); MockApiClient.addMockResponse({ - url: 'https://release-registry.services.sentry.io/sdks', + url: `/${organization.slug}/sdks/`, body: {}, }); @@ -271,7 +271,7 @@ describe('Onboarding', function () { }); MockApiClient.addMockResponse({ - url: 'https://release-registry.services.sentry.io/sdks', + url: `/${organization.slug}/sdks/`, body: {}, }); diff --git a/static/app/views/onboarding/setupDocs.spec.tsx b/static/app/views/onboarding/setupDocs.spec.tsx index 86d4369f3eabe9..76c4ea60aa78c8 100644 --- a/static/app/views/onboarding/setupDocs.spec.tsx +++ b/static/app/views/onboarding/setupDocs.spec.tsx @@ -32,7 +32,7 @@ function renderMockRequests({ }); MockApiClient.addMockResponse({ - url: 'https://release-registry.services.sentry.io/sdks', + url: `/${orgSlug}/sdks/`, body: { 'sentry.java': { canonical: 'maven:io.sentry:sentry', From 2e267da5b52fd149bfae071ca842d984ccc2e27c Mon Sep 17 00:00:00 2001 From: Arthur Knaus Date: Fri, 18 Aug 2023 10:18:55 +0200 Subject: [PATCH 15/19] fix(onboarding-docs): Use release registry data in spring-boot docs --- static/app/gettingStartedDocs/java/spring-boot.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/static/app/gettingStartedDocs/java/spring-boot.tsx b/static/app/gettingStartedDocs/java/spring-boot.tsx index dfbbd13da47402..03ed39e529cd54 100644 --- a/static/app/gettingStartedDocs/java/spring-boot.tsx +++ b/static/app/gettingStartedDocs/java/spring-boot.tsx @@ -426,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; From 6b71ee2be48c61975b76317c514921608e7a430b Mon Sep 17 00:00:00 2001 From: Arthur Knaus Date: Fri, 18 Aug 2023 13:09:56 +0200 Subject: [PATCH 16/19] fix(onboarding-docs): Use registry package version in spring doc links --- static/app/gettingStartedDocs/java/spring.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/static/app/gettingStartedDocs/java/spring.tsx b/static/app/gettingStartedDocs/java/spring.tsx index dcf16d23944b72..d359b3ba58564b 100644 --- a/static/app/gettingStartedDocs/java/spring.tsx +++ b/static/app/gettingStartedDocs/java/spring.tsx @@ -339,10 +339,24 @@ 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: ( - + ), } )} From 711c511bf84dd301064780a44c5a0a0427b10451 Mon Sep 17 00:00:00 2001 From: Arthur Knaus Date: Fri, 18 Aug 2023 13:12:14 +0200 Subject: [PATCH 17/19] Remove 'loading' state from url --- static/app/gettingStartedDocs/java/spring.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/static/app/gettingStartedDocs/java/spring.tsx b/static/app/gettingStartedDocs/java/spring.tsx index d359b3ba58564b..1db921c506ac1a 100644 --- a/static/app/gettingStartedDocs/java/spring.tsx +++ b/static/app/gettingStartedDocs/java/spring.tsx @@ -341,20 +341,16 @@ authToken = "your-sentry-auth-token" mavenRepositorySpring5Link: ( ), mavenRepositorySpring6Link: ( ), From 1c098b31c878c3bc2f8eeb5018e5f7021386ed6f Mon Sep 17 00:00:00 2001 From: Matej Minar Date: Fri, 18 Aug 2023 14:11:58 +0200 Subject: [PATCH 18/19] Update static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx --- .../onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx index 02d3a6edd53948..6f21e1d996c5c4 100644 --- a/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/useSourcePackageRegistries.tsx @@ -21,7 +21,7 @@ type ReleaseRegistrySdk = Record< */ export function useSourcePackageRegistries(organization: Organization) { const releaseRegistrySdk = useApiQuery( - [`/${organization.slug}/sdks/`], + [`/organizations/${organization.slug}/sdks/`], { staleTime: Infinity, } From 5ec155f1be9c7e361025cf047aace61ecff282c4 Mon Sep 17 00:00:00 2001 From: Matej Minar Date: Fri, 18 Aug 2023 14:27:13 +0200 Subject: [PATCH 19/19] fix test --- static/app/views/onboarding/onboarding.spec.tsx | 6 +++--- static/app/views/onboarding/setupDocs.spec.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/app/views/onboarding/onboarding.spec.tsx b/static/app/views/onboarding/onboarding.spec.tsx index 3ec869524ecb27..b129f79429c84c 100644 --- a/static/app/views/onboarding/onboarding.spec.tsx +++ b/static/app/views/onboarding/onboarding.spec.tsx @@ -86,7 +86,7 @@ describe('Onboarding', function () { }); MockApiClient.addMockResponse({ - url: `/${organization.slug}/sdks/`, + url: `/organizations/${organization.slug}/sdks/`, body: {}, }); @@ -176,7 +176,7 @@ describe('Onboarding', function () { }); MockApiClient.addMockResponse({ - url: `/${organization.slug}/sdks/`, + url: `/organizations/${organization.slug}/sdks/`, body: {}, }); @@ -271,7 +271,7 @@ describe('Onboarding', function () { }); MockApiClient.addMockResponse({ - url: `/${organization.slug}/sdks/`, + url: `/organizations/${organization.slug}/sdks/`, body: {}, }); diff --git a/static/app/views/onboarding/setupDocs.spec.tsx b/static/app/views/onboarding/setupDocs.spec.tsx index 76c4ea60aa78c8..d7c4d5cddb1659 100644 --- a/static/app/views/onboarding/setupDocs.spec.tsx +++ b/static/app/views/onboarding/setupDocs.spec.tsx @@ -32,7 +32,7 @@ function renderMockRequests({ }); MockApiClient.addMockResponse({ - url: `/${orgSlug}/sdks/`, + url: `/organizations/${orgSlug}/sdks/`, body: { 'sentry.java': { canonical: 'maven:io.sentry:sentry',