Skip to content

Commit

Permalink
Merge branch 'main' into v6
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich committed Aug 14, 2024
2 parents 643c544 + 7b891b1 commit 4cd26bd
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 22 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@
});
```

- Add `spotlight` option ([#4023](https://github.com/getsentry/sentry-react-native/pull/4023))
- Deprecating `enableSpotlight` and `spotlightSidecarUrl`

### Dependencies

- Bump JavaScript SDK from v7.118.0 to v8.11.0 ([#3910](https://github.com/getsentry/sentry-react-native/pull/3910))
- [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#8110)
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.118.0...8.11.0)

## 5.29.0

### Features

- `TimeToInitialDisplay` and `TimeToFullDisplay` start the time to display spans on mount ([#4020](https://github.com/getsentry/sentry-react-native/pull/4020))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions samples/expo/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -19,15 +19,15 @@
"ios": {
"supportsTablet": true,
"bundleIdentifier": "io.sentry.expo.sample",
"buildNumber": "16"
"buildNumber": "17"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "io.sentry.expo.sample",
"versionCode": 16
"versionCode": 17
},
"web": {
"bundler": "metro",
Expand Down
2 changes: 1 addition & 1 deletion samples/expo/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ process.env.EXPO_SKIP_DURING_EXPORT !== 'true' && Sentry.init({
// replaysOnErrorSampleRate: 1.0,
replaysSessionSampleRate: 1.0,
},
enableSpotlight: true,
spotlight: true,
});

function RootLayout() {
Expand Down
2 changes: 1 addition & 1 deletion samples/expo/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions samples/react-native/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions samples/react-native/ios/sentryreactnativesample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.28.0</string>
<string>5.29.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>23</string>
<string>24</string>
<key>LSRequiresIPhoneOS</key>
<true />
<key>NSAppTransportSecurity</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>5.28.0</string>
<string>5.29.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>23</string>
<string>24</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion samples/react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sentry-react-native-sample",
"version": "5.28.0",
"version": "5.29.0",
"private": true,
"scripts": {
"postinstall": "patch-package",
Expand Down
2 changes: 1 addition & 1 deletion samples/react-native/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,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,
Expand Down
9 changes: 3 additions & 6 deletions src/js/integrations/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,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 (
Expand Down
16 changes: 16 additions & 0 deletions src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/js/version.ts
Original file line number Diff line number Diff line change
@@ -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';
22 changes: 21 additions & 1 deletion test/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ describe('Tests the SDK functionality', () => {
expectNotIntegration('Spotlight');
});

it('adds spotlight integration', () => {
it('adds spotlight integration with enableSpotlight', () => {
init({
enableSpotlight: true,
});
Expand Down Expand Up @@ -516,6 +516,26 @@ describe('Tests the SDK functionality', () => {
});
});

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,
Expand Down

0 comments on commit 4cd26bd

Please sign in to comment.