Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into kw-add-replay-v0
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich committed May 9, 2024
2 parents 592f513 + d6eb796 commit e293d5f
Show file tree
Hide file tree
Showing 49 changed files with 2,190 additions and 177 deletions.
38 changes: 33 additions & 5 deletions .github/workflows/sample-application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,26 @@ jobs:
matrix:
rn-architecture: ['legacy', 'new']
ios-use-frameworks: ['no-frameworks', 'dynamic-frameworks']
platform: ['android', 'ios']
platform: ['android', 'ios', 'macos']
build-type: ['dev', 'production']
include:
- platform: ios
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
runtime: 'latest'
device: 'iPhone 14'
- platform: macos
runs-on: macos-14
- platform: android
runs-on: ubuntu-latest
exclude:
- platform: 'android'
ios-use-frameworks: 'dynamic-frameworks'
- rn-architecture: 'new'
ios-use-frameworks: 'dynamic-frameworks'
- rn-architecture: 'new'
platform: 'macos'
- ios-use-frameworks: 'dynamic-frameworks'
platform: 'macos'
steps:
- uses: actions/checkout@v4

Expand All @@ -66,7 +72,7 @@ jobs:
samples/react-native/yarn.lock
- uses: ruby/setup-ruby@v1
if: ${{ matrix.platform == 'ios' }}
if: ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
with:
working-directory: samples/react-native
ruby-version: '3.3.0' # based on what is used in the sample
Expand Down Expand Up @@ -96,9 +102,12 @@ jobs:
run: yarn install --frozen-lockfile

- name: Install App Pods
if: ${{ matrix.platform == 'ios' }}
working-directory: samples/react-native/ios
if: ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
working-directory: samples/react-native
run: |
[[ "${{ matrix.platform }}" == "ios" ]] && cd ios
[[ "${{ matrix.platform }}" == "macos" ]] && cd macos
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
[[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
[[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic && export NO_FLIPPER=1
Expand Down Expand Up @@ -138,9 +147,28 @@ jobs:
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Build macOS App
if: ${{ matrix.platform == 'macos' }}
working-directory: samples/react-native/macos
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
set -o pipefail && xcodebuild \
-workspace sentry-react-native-sample.xcworkspace \
-configuration "$CONFIG" \
-scheme sentry-react-native-sample-macOS \
-destination 'platform=macOS' \
ONLY_ACTIVE_ARCH=yes \
-derivedDataPath "$derivedData" \
build \
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs
path: samples/react-native/ios/*.log
path: samples/react-native/${{ matrix.platform }}/*.log
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "node",
"request": "launch",
"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/jest/bin/jest.js"],
"args": ["--runInBand", "-t", ""],
"args": ["--runInBand", "-t", "gesture cancel previous interaction transaction"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@

Access to Mobile Replay is limited to early access orgs on Sentry. If you're interested, [sign up for the waitlist](https://sentry.io/lp/mobile-replay-beta/)

### Dependencies

- Bump CLI from v2.30.4 to v2.31.2 ([#3719](https://github.com/getsentry/sentry-react-native/pull/3719))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2312)
- [diff](https://github.com/getsentry/sentry-cli/compare/2.30.4...2.31.2)
- Bump Cocoa SDK from v8.25.0 to v8.25.2 ([#3802](https://github.com/getsentry/sentry-react-native/pull/3802))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8252)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.25.0...8.25.2)

## 5.22.2

### Fixes

- Remove `tunnel` from SDK Options ([#3787](https://github.com/getsentry/sentry-react-native/pull/3787))
- Fix Apple non UIKit builds ([#3784](https://github.com/getsentry/sentry-react-native/pull/3784))

### Dependencies

- Bump JavaScript SDK from v7.110.1 to v7.113.0 ([#3768](https://github.com/getsentry/sentry-react-native/pull/3768))
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#71130)
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.110.1...7.113.0)

## 5.22.1

### Dependencies
Expand Down
15 changes: 13 additions & 2 deletions ios/RNSentry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@

#import "RNSentryEvents.h"
#import "RNSentryDependencyContainer.h"
#import "RNSentryFramesTrackerListener.h"

#if SENTRY_HAS_UIKIT
#import "RNSentryRNSScreen.h"
#import "RNSentryFramesTrackerListener.h"
#endif

@interface SentryTraceContext : NSObject
- (nullable instancetype)initWithDict:(NSDictionary<NSString *, id> *)dictionary;
Expand Down Expand Up @@ -213,6 +216,7 @@ - (void)setEventEnvironmentTag:(SentryEvent *)event
RCT_EXPORT_METHOD(initNativeReactNavigationNewFrameTracking:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
#if SENTRY_HAS_UIKIT
if ([[NSThread currentThread] isMainThread]) {
[RNSentryRNSScreen swizzleViewDidAppear];
} else {
Expand All @@ -222,16 +226,20 @@ - (void)setEventEnvironmentTag:(SentryEvent *)event
}

[self initFramesTracking];
#endif
resolve(nil);
}

- (void)initFramesTracking {
#if SENTRY_HAS_UIKIT

RNSentryEmitNewFrameEvent emitNewFrameEvent = ^(NSNumber *newFrameTimestampInSeconds) {
if (self->hasListeners) {
[self sendEventWithName:RNSentryNewFrameEvent body:@{ @"newFrameTimestampInSeconds": newFrameTimestampInSeconds }];
}
};
[[RNSentryDependencyContainer sharedInstance] initializeFramesTrackerListenerWith: emitNewFrameEvent];
#endif
}

// Will be called when this module's first listener is added.
Expand Down Expand Up @@ -391,7 +399,7 @@ - (NSDictionary*) fetchNativeStackFramesBy: (NSArray<NSNumber*>*)instructionsAdd
RCT_EXPORT_METHOD(fetchNativeAppStart:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{

#if SENTRY_HAS_UIKIT
SentryAppStartMeasurement *appStartMeasurement = PrivateSentrySDKOnly.appStartMeasurement;

if (appStartMeasurement == nil) {
Expand All @@ -410,6 +418,9 @@ - (NSDictionary*) fetchNativeStackFramesBy: (NSArray<NSNumber*>*)instructionsAdd
// This is always set to true, as we would only allow an app start fetch to only happen once
// in the case of a JS bundle reload, we do not want it to be instrumented again.
didFetchAppStart = true;
#else
resolve(nil);
#endif
}

RCT_EXPORT_METHOD(fetchNativeFrames:(RCTPromiseResolveBlock)resolve
Expand Down
5 changes: 4 additions & 1 deletion ios/RNSentryDependencyContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ SENTRY_NO_INIT

@property (class, readonly, strong) RNSentryDependencyContainer* sharedInstance;

#if SENTRY_HAS_UIKIT

@property (nonatomic, strong) RNSentryFramesTrackerListener *framesTrackerListener;

- (void)initializeFramesTrackerListenerWith:(RNSentryEmitNewFrameEvent) eventEmitter;

@end
#endif

@end
4 changes: 4 additions & 0 deletions ios/RNSentryDependencyContainer.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ - (instancetype)init
return self;
}

#if SENTRY_HAS_UIKIT

- (void)initializeFramesTrackerListenerWith:(RNSentryEmitNewFrameEvent)eventEmitter
{
@synchronized(sentryDependencyContainerLock) {
Expand All @@ -29,4 +31,6 @@ - (void)initializeFramesTrackerListenerWith:(RNSentryEmitNewFrameEvent)eventEmit
}
}

#endif

@end
6 changes: 6 additions & 0 deletions ios/RNSentryFramesTrackerListener.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#import <Sentry/SentryDefines.h>

#if SENTRY_HAS_UIKIT

#import <Foundation/Foundation.h>
#import <React/RCTEventEmitter.h>
#import <Sentry/SentryFramesTracker.h>
Expand All @@ -15,3 +19,5 @@ typedef void (^RNSentryEmitNewFrameEvent)(NSNumber *newFrameTimestampInSeconds);
@property (strong, nonatomic) RNSentryEmitNewFrameEvent emitNewFrameEvent;

@end

#endif
4 changes: 4 additions & 0 deletions ios/RNSentryFramesTrackerListener.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#import "RNSentryFramesTrackerListener.h"

#if SENTRY_HAS_UIKIT

@implementation RNSentryFramesTrackerListener

- (instancetype)initWithSentryFramesTracker:(SentryFramesTracker *)framesTracker
Expand Down Expand Up @@ -28,3 +30,5 @@ - (void)startListening {
}

@end

#endif
4 changes: 4 additions & 0 deletions ios/RNSentryOnDrawReporter.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#if SENTRY_HAS_UIKIT

#import <UIKit/UIKit.h>
#import <React/RCTViewManager.h>
#import "RNSentryFramesTrackerListener.h"
Expand Down Expand Up @@ -68,3 +70,5 @@ - (void)didSetProps:(NSArray<NSString *> *)changedProps
}

@end

#endif
6 changes: 6 additions & 0 deletions ios/RNSentryRNSScreen.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#import <Sentry/SentryDefines.h>

#if SENTRY_HAS_UIKIT

#import <Foundation/Foundation.h>

@interface RNSentryRNSScreen : NSObject

+ (void)swizzleViewDidAppear;

@end

#endif
7 changes: 6 additions & 1 deletion ios/RNSentryRNSScreen.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#import "RNSentryRNSScreen.h"

#if SENTRY_HAS_UIKIT

#import <Sentry/SentryFramesTracker.h>
#import <Sentry/SentryDependencyContainer.h>
#import <Sentry/SentrySwizzle.h>

#import "RNSentryRNSScreen.h"
#import "RNSentryDependencyContainer.h"

@implementation RNSentryRNSScreen
Expand All @@ -24,3 +27,5 @@ + (void)swizzleViewDidAppear {
}

@end

#endif
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,22 @@
"react-native": ">=0.65.0"
},
"dependencies": {
"@sentry/browser": "7.110.1",
"@sentry/cli": "2.30.4",
"@sentry/core": "7.110.1",
"@sentry/hub": "7.110.1",
"@sentry/integrations": "7.110.1",
"@sentry/react": "7.110.1",
"@sentry/types": "7.110.1",
"@sentry/utils": "7.110.1"
"@sentry/browser": "7.113.0",
"@sentry/cli": "2.31.2",
"@sentry/core": "7.113.0",
"@sentry/hub": "7.113.0",
"@sentry/integrations": "7.113.0",
"@sentry/react": "7.113.0",
"@sentry/types": "7.113.0",
"@sentry/utils": "7.113.0"
},
"devDependencies": {
"@babel/core": "^7.23.5",
"@expo/metro-config": "0.17.5",
"@mswjs/interceptors": "^0.25.15",
"@sentry-internal/eslint-config-sdk": "7.110.1",
"@sentry-internal/eslint-plugin-sdk": "7.110.1",
"@sentry-internal/typescript": "7.110.1",
"@sentry-internal/eslint-config-sdk": "7.113.0",
"@sentry-internal/eslint-plugin-sdk": "7.113.0",
"@sentry-internal/typescript": "7.113.0",
"@sentry/wizard": "3.16.3",
"@types/jest": "^29.5.3",
"@types/node": "^20.9.3",
Expand Down
4 changes: 2 additions & 2 deletions samples/expo/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"ios": {
"supportsTablet": true,
"bundleIdentifier": "io.sentry.expo.sample",
"buildNumber": "5"
"buildNumber": "6"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "io.sentry.expo.sample",
"versionCode": 5
"versionCode": 6
},
"web": {
"bundler": "metro",
Expand Down
2 changes: 1 addition & 1 deletion samples/react-native/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local
*.xcode.env.local

# Android/IntelliJ
#
Expand Down
2 changes: 1 addition & 1 deletion samples/react-native/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ android {
applicationId "io.sentry.reactnative.sample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 12
versionCode 13
versionName "5.23.0-alpha.0"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>12</string>
<string>13</string>
<key>LSRequiresIPhoneOS</key>
<true />
<key>NSAppTransportSecurity</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>12</string>
<string>13</string>
</dict>
</plist>
2 changes: 2 additions & 0 deletions samples/react-native/macos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# CocoaPods
Pods/
1 change: 1 addition & 0 deletions samples/react-native/macos/.xcode.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export NODE_BINARY=$(command -v node)

0 comments on commit e293d5f

Please sign in to comment.