From 4f69a140c642d7d43f1cd1c4b69be8df633030df Mon Sep 17 00:00:00 2001 From: getsentry-bot Date: Tue, 13 Aug 2024 13:16:20 +0000 Subject: [PATCH 1/2] release: 5.29.0 --- CHANGELOG.md | 2 +- package.json | 2 +- samples/expo/app.json | 6 +++--- samples/expo/package.json | 2 +- samples/react-native/android/app/build.gradle | 4 ++-- samples/react-native/ios/sentryreactnativesample/Info.plist | 4 ++-- .../ios/sentryreactnativesampleTests/Info.plist | 4 ++-- samples/react-native/package.json | 2 +- src/js/version.ts | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b1f1cf5b..3583df05e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 5.29.0 ### Features diff --git a/package.json b/package.json index 8e334d7d9..6779b005d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@sentry/react-native", "homepage": "https://github.com/getsentry/sentry-react-native", "repository": "https://github.com/getsentry/sentry-react-native", - "version": "5.28.0", + "version": "5.29.0", "description": "Official Sentry SDK for react-native", "typings": "dist/js/index.d.ts", "types": "dist/js/index.d.ts", diff --git a/samples/expo/app.json b/samples/expo/app.json index 500710a6a..b852ea20a 100644 --- a/samples/expo/app.json +++ b/samples/expo/app.json @@ -4,7 +4,7 @@ "slug": "sentry-react-native-expo-sample", "jsEngine": "hermes", "scheme": "sentry-expo-sample", - "version": "5.28.0", + "version": "5.29.0", "orientation": "portrait", "icon": "./assets/icon.png", "userInterfaceStyle": "light", @@ -19,7 +19,7 @@ "ios": { "supportsTablet": true, "bundleIdentifier": "io.sentry.expo.sample", - "buildNumber": "16" + "buildNumber": "17" }, "android": { "adaptiveIcon": { @@ -27,7 +27,7 @@ "backgroundColor": "#ffffff" }, "package": "io.sentry.expo.sample", - "versionCode": 16 + "versionCode": 17 }, "web": { "bundler": "metro", diff --git a/samples/expo/package.json b/samples/expo/package.json index 1c3dcbd1c..1645fed67 100644 --- a/samples/expo/package.json +++ b/samples/expo/package.json @@ -1,6 +1,6 @@ { "name": "sentry-react-native-expo-sample", - "version": "5.28.0", + "version": "5.29.0", "main": "expo-router/entry", "scripts": { "start": "expo start", diff --git a/samples/react-native/android/app/build.gradle b/samples/react-native/android/app/build.gradle index 935a3eef4..a7c769eee 100644 --- a/samples/react-native/android/app/build.gradle +++ b/samples/react-native/android/app/build.gradle @@ -134,8 +134,8 @@ android { applicationId "io.sentry.reactnative.sample" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 19 - versionName "5.28.0" + versionCode 20 + versionName "5.29.0" } signingConfigs { diff --git a/samples/react-native/ios/sentryreactnativesample/Info.plist b/samples/react-native/ios/sentryreactnativesample/Info.plist index 38e19166d..54fb4ca44 100644 --- a/samples/react-native/ios/sentryreactnativesample/Info.plist +++ b/samples/react-native/ios/sentryreactnativesample/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.28.0 + 5.29.0 CFBundleSignature ???? CFBundleVersion - 23 + 24 LSRequiresIPhoneOS NSAppTransportSecurity diff --git a/samples/react-native/ios/sentryreactnativesampleTests/Info.plist b/samples/react-native/ios/sentryreactnativesampleTests/Info.plist index ec03f5ea7..5aa239c64 100644 --- a/samples/react-native/ios/sentryreactnativesampleTests/Info.plist +++ b/samples/react-native/ios/sentryreactnativesampleTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 5.28.0 + 5.29.0 CFBundleSignature ???? CFBundleVersion - 23 + 24 diff --git a/samples/react-native/package.json b/samples/react-native/package.json index fe6976020..c7fee1c6a 100644 --- a/samples/react-native/package.json +++ b/samples/react-native/package.json @@ -1,6 +1,6 @@ { "name": "sentry-react-native-sample", - "version": "5.28.0", + "version": "5.29.0", "private": true, "scripts": { "postinstall": "patch-package", diff --git a/src/js/version.ts b/src/js/version.ts index 31fee02f4..5dcfeab5c 100644 --- a/src/js/version.ts +++ b/src/js/version.ts @@ -1,3 +1,3 @@ export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native'; export const SDK_NAME = 'sentry.javascript.react-native'; -export const SDK_VERSION = '5.28.0'; +export const SDK_VERSION = '5.29.0'; From 7b891b1e5a49cc057e1dd657d968f17815b4b22e Mon Sep 17 00:00:00 2001 From: Krystof Woldrich <31292499+krystofwoldrich@users.noreply.github.com> Date: Wed, 14 Aug 2024 11:04:17 +0200 Subject: [PATCH 2/2] feat: Add `spotlight` option (#4023) --- CHANGELOG.md | 5 +++++ samples/expo/app/_layout.tsx | 2 +- samples/react-native/src/App.tsx | 2 +- src/js/integrations/default.ts | 9 +++------ src/js/options.ts | 16 ++++++++++++++++ test/sdk.test.ts | 22 +++++++++++++++++++++- 6 files changed, 47 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3583df05e..159610c1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +- Add `spotlight` option ([#4023](https://github.com/getsentry/sentry-react-native/pull/4023)) + - Deprecating `enableSpotlight` and `spotlightSidecarUrl` + ## 5.29.0 ### Features diff --git a/samples/expo/app/_layout.tsx b/samples/expo/app/_layout.tsx index 094ea7cba..fddab42cf 100644 --- a/samples/expo/app/_layout.tsx +++ b/samples/expo/app/_layout.tsx @@ -84,7 +84,7 @@ process.env.EXPO_SKIP_DURING_EXPORT !== 'true' && Sentry.init({ // replaysOnErrorSampleRate: 1.0, replaysSessionSampleRate: 1.0, }, - enableSpotlight: true, + spotlight: true, }); function RootLayout() { diff --git a/samples/react-native/src/App.tsx b/samples/react-native/src/App.tsx index c60ee4769..191775349 100644 --- a/samples/react-native/src/App.tsx +++ b/samples/react-native/src/App.tsx @@ -123,7 +123,7 @@ Sentry.init({ // replaysSessionSampleRate: 1.0, replaysOnErrorSampleRate: 1.0, }, - enableSpotlight: true, + spotlight: true, // This should be disabled when manually initializing the native SDK // Note that options from JS are not passed to the native SDKs when initialized manually autoInitializeNativeSdk: true, diff --git a/src/js/integrations/default.ts b/src/js/integrations/default.ts index e6efd9078..3aab4cd55 100644 --- a/src/js/integrations/default.ts +++ b/src/js/integrations/default.ts @@ -108,12 +108,9 @@ export function getDefaultIntegrations(options: ReactNativeClientOptions): Integ integrations.push(expoContextIntegration()); } - if (options.enableSpotlight) { - integrations.push( - spotlightIntegration({ - sidecarUrl: options.spotlightSidecarUrl, - }), - ); + if (options.spotlight || options.enableSpotlight) { + const sidecarUrl = (typeof options.spotlight === 'string' && options.spotlight) || options.spotlightSidecarUrl; + integrations.push(spotlightIntegration({ sidecarUrl })); } if ( diff --git a/src/js/options.ts b/src/js/options.ts index d798b4220..07815504c 100644 --- a/src/js/options.ts +++ b/src/js/options.ts @@ -166,6 +166,8 @@ export interface BaseReactNativeOptions { * More details: https://spotlightjs.com/ * * IMPORTANT: Only set this option to `true` while developing, not in production! + * + * @deprecated Use `spotlight` instead. */ enableSpotlight?: boolean; @@ -178,9 +180,23 @@ export interface BaseReactNativeOptions { * More details: https://spotlightjs.com/ * * @default "http://localhost:8969/stream" + * + * @deprecated Use `spotlight` instead. */ spotlightSidecarUrl?: string; + /** + * If you use Spotlight by Sentry during development, use + * this option to forward captured Sentry events to Spotlight. + * + * Either set it to true, or provide a specific Spotlight Sidecar URL. + * + * More details: https://spotlightjs.com/ + * + * IMPORTANT: Only set this option to `true` while developing, not in production! + */ + spotlight?: boolean | string; + /** * Sets a callback which is executed before capturing screenshots. Only * relevant if `attachScreenshot` is set to true. When false is returned diff --git a/test/sdk.test.ts b/test/sdk.test.ts index 00a3d893d..7af0da5b3 100644 --- a/test/sdk.test.ts +++ b/test/sdk.test.ts @@ -432,7 +432,7 @@ describe('Tests the SDK functionality', () => { expect(actualIntegrations).toEqual(expect.not.arrayContaining([expect.objectContaining({ name: 'Spotlight' })])); }); - it('adds spotlight integration', () => { + it('adds spotlight integration with enableSpotlight', () => { init({ enableSpotlight: true, }); @@ -442,6 +442,26 @@ describe('Tests the SDK functionality', () => { expect(actualIntegrations).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'Spotlight' })])); }); + it('adds spotlight integration with spotlight bool', () => { + init({ + spotlight: true, + }); + + const actualOptions = usedOptions(); + const actualIntegrations = actualOptions?.integrations; + expect(actualIntegrations).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'Spotlight' })])); + }); + + it('adds spotlight integration with direct url', () => { + init({ + spotlight: 'http://localhost:8969/stream', + }); + + const actualOptions = usedOptions(); + const actualIntegrations = actualOptions?.integrations; + expect(actualIntegrations).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'Spotlight' })])); + }); + it('no default integrations', () => { init({ defaultIntegrations: false,