Skip to content

Commit e293d5f

Browse files
Merge remote-tracking branch 'origin/main' into kw-add-replay-v0
2 parents 592f513 + d6eb796 commit e293d5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2190
-177
lines changed

.github/workflows/sample-application.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,26 @@ jobs:
4040
matrix:
4141
rn-architecture: ['legacy', 'new']
4242
ios-use-frameworks: ['no-frameworks', 'dynamic-frameworks']
43-
platform: ['android', 'ios']
43+
platform: ['android', 'ios', 'macos']
4444
build-type: ['dev', 'production']
4545
include:
4646
- platform: ios
4747
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
4848
runtime: 'latest'
4949
device: 'iPhone 14'
50+
- platform: macos
51+
runs-on: macos-14
5052
- platform: android
5153
runs-on: ubuntu-latest
5254
exclude:
5355
- platform: 'android'
5456
ios-use-frameworks: 'dynamic-frameworks'
5557
- rn-architecture: 'new'
5658
ios-use-frameworks: 'dynamic-frameworks'
59+
- rn-architecture: 'new'
60+
platform: 'macos'
61+
- ios-use-frameworks: 'dynamic-frameworks'
62+
platform: 'macos'
5763
steps:
5864
- uses: actions/checkout@v4
5965

@@ -66,7 +72,7 @@ jobs:
6672
samples/react-native/yarn.lock
6773
6874
- uses: ruby/setup-ruby@v1
69-
if: ${{ matrix.platform == 'ios' }}
75+
if: ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
7076
with:
7177
working-directory: samples/react-native
7278
ruby-version: '3.3.0' # based on what is used in the sample
@@ -96,9 +102,12 @@ jobs:
96102
run: yarn install --frozen-lockfile
97103

98104
- name: Install App Pods
99-
if: ${{ matrix.platform == 'ios' }}
100-
working-directory: samples/react-native/ios
105+
if: ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
106+
working-directory: samples/react-native
101107
run: |
108+
[[ "${{ matrix.platform }}" == "ios" ]] && cd ios
109+
[[ "${{ matrix.platform }}" == "macos" ]] && cd macos
110+
102111
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
103112
[[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
104113
[[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic && export NO_FLIPPER=1
@@ -138,9 +147,28 @@ jobs:
138147
| tee xcodebuild.log \
139148
| xcbeautify --quieter --is-ci --disable-colored-output
140149
150+
- name: Build macOS App
151+
if: ${{ matrix.platform == 'macos' }}
152+
working-directory: samples/react-native/macos
153+
run: |
154+
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
155+
echo "Building $CONFIG"
156+
mkdir -p "DerivedData"
157+
derivedData="$(cd "DerivedData" ; pwd -P)"
158+
set -o pipefail && xcodebuild \
159+
-workspace sentry-react-native-sample.xcworkspace \
160+
-configuration "$CONFIG" \
161+
-scheme sentry-react-native-sample-macOS \
162+
-destination 'platform=macOS' \
163+
ONLY_ACTIVE_ARCH=yes \
164+
-derivedDataPath "$derivedData" \
165+
build \
166+
| tee xcodebuild.log \
167+
| xcbeautify --quieter --is-ci --disable-colored-output
168+
141169
- name: Upload logs
142170
if: ${{ always() }}
143171
uses: actions/upload-artifact@v4
144172
with:
145173
name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs
146-
path: samples/react-native/ios/*.log
174+
path: samples/react-native/${{ matrix.platform }}/*.log

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "node",
77
"request": "launch",
88
"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/jest/bin/jest.js"],
9-
"args": ["--runInBand", "-t", ""],
9+
"args": ["--runInBand", "-t", "gesture cancel previous interaction transaction"],
1010
"cwd": "${workspaceRoot}",
1111
"console": "integratedTerminal",
1212
"internalConsoleOptions": "neverOpen",

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,28 @@
88

99
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/)
1010

11+
### Dependencies
12+
13+
- Bump CLI from v2.30.4 to v2.31.2 ([#3719](https://github.com/getsentry/sentry-react-native/pull/3719))
14+
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2312)
15+
- [diff](https://github.com/getsentry/sentry-cli/compare/2.30.4...2.31.2)
16+
- Bump Cocoa SDK from v8.25.0 to v8.25.2 ([#3802](https://github.com/getsentry/sentry-react-native/pull/3802))
17+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8252)
18+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.25.0...8.25.2)
19+
20+
## 5.22.2
21+
22+
### Fixes
23+
24+
- Remove `tunnel` from SDK Options ([#3787](https://github.com/getsentry/sentry-react-native/pull/3787))
25+
- Fix Apple non UIKit builds ([#3784](https://github.com/getsentry/sentry-react-native/pull/3784))
26+
27+
### Dependencies
28+
29+
- Bump JavaScript SDK from v7.110.1 to v7.113.0 ([#3768](https://github.com/getsentry/sentry-react-native/pull/3768))
30+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#71130)
31+
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.110.1...7.113.0)
32+
1133
## 5.22.1
1234

1335
### Dependencies

ios/RNSentry.mm

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@
3636

3737
#import "RNSentryEvents.h"
3838
#import "RNSentryDependencyContainer.h"
39-
#import "RNSentryFramesTrackerListener.h"
39+
40+
#if SENTRY_HAS_UIKIT
4041
#import "RNSentryRNSScreen.h"
42+
#import "RNSentryFramesTrackerListener.h"
43+
#endif
4144

4245
@interface SentryTraceContext : NSObject
4346
- (nullable instancetype)initWithDict:(NSDictionary<NSString *, id> *)dictionary;
@@ -213,6 +216,7 @@ - (void)setEventEnvironmentTag:(SentryEvent *)event
213216
RCT_EXPORT_METHOD(initNativeReactNavigationNewFrameTracking:(RCTPromiseResolveBlock)resolve
214217
rejecter:(RCTPromiseRejectBlock)reject)
215218
{
219+
#if SENTRY_HAS_UIKIT
216220
if ([[NSThread currentThread] isMainThread]) {
217221
[RNSentryRNSScreen swizzleViewDidAppear];
218222
} else {
@@ -222,16 +226,20 @@ - (void)setEventEnvironmentTag:(SentryEvent *)event
222226
}
223227

224228
[self initFramesTracking];
229+
#endif
225230
resolve(nil);
226231
}
227232

228233
- (void)initFramesTracking {
234+
#if SENTRY_HAS_UIKIT
235+
229236
RNSentryEmitNewFrameEvent emitNewFrameEvent = ^(NSNumber *newFrameTimestampInSeconds) {
230237
if (self->hasListeners) {
231238
[self sendEventWithName:RNSentryNewFrameEvent body:@{ @"newFrameTimestampInSeconds": newFrameTimestampInSeconds }];
232239
}
233240
};
234241
[[RNSentryDependencyContainer sharedInstance] initializeFramesTrackerListenerWith: emitNewFrameEvent];
242+
#endif
235243
}
236244

237245
// Will be called when this module's first listener is added.
@@ -391,7 +399,7 @@ - (NSDictionary*) fetchNativeStackFramesBy: (NSArray<NSNumber*>*)instructionsAdd
391399
RCT_EXPORT_METHOD(fetchNativeAppStart:(RCTPromiseResolveBlock)resolve
392400
rejecter:(RCTPromiseRejectBlock)reject)
393401
{
394-
402+
#if SENTRY_HAS_UIKIT
395403
SentryAppStartMeasurement *appStartMeasurement = PrivateSentrySDKOnly.appStartMeasurement;
396404

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

415426
RCT_EXPORT_METHOD(fetchNativeFrames:(RCTPromiseResolveBlock)resolve

ios/RNSentryDependencyContainer.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ SENTRY_NO_INIT
77

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

10+
#if SENTRY_HAS_UIKIT
11+
1012
@property (nonatomic, strong) RNSentryFramesTrackerListener *framesTrackerListener;
1113

1214
- (void)initializeFramesTrackerListenerWith:(RNSentryEmitNewFrameEvent) eventEmitter;
1315

14-
@end
16+
#endif
1517

18+
@end

ios/RNSentryDependencyContainer.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ - (instancetype)init
2121
return self;
2222
}
2323

24+
#if SENTRY_HAS_UIKIT
25+
2426
- (void)initializeFramesTrackerListenerWith:(RNSentryEmitNewFrameEvent)eventEmitter
2527
{
2628
@synchronized(sentryDependencyContainerLock) {
@@ -29,4 +31,6 @@ - (void)initializeFramesTrackerListenerWith:(RNSentryEmitNewFrameEvent)eventEmit
2931
}
3032
}
3133

34+
#endif
35+
3236
@end

ios/RNSentryFramesTrackerListener.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#import <Sentry/SentryDefines.h>
2+
3+
#if SENTRY_HAS_UIKIT
4+
15
#import <Foundation/Foundation.h>
26
#import <React/RCTEventEmitter.h>
37
#import <Sentry/SentryFramesTracker.h>
@@ -15,3 +19,5 @@ typedef void (^RNSentryEmitNewFrameEvent)(NSNumber *newFrameTimestampInSeconds);
1519
@property (strong, nonatomic) RNSentryEmitNewFrameEvent emitNewFrameEvent;
1620

1721
@end
22+
23+
#endif

ios/RNSentryFramesTrackerListener.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#import "RNSentryFramesTrackerListener.h"
22

3+
#if SENTRY_HAS_UIKIT
4+
35
@implementation RNSentryFramesTrackerListener
46

57
- (instancetype)initWithSentryFramesTracker:(SentryFramesTracker *)framesTracker
@@ -28,3 +30,5 @@ - (void)startListening {
2830
}
2931

3032
@end
33+
34+
#endif

ios/RNSentryOnDrawReporter.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if SENTRY_HAS_UIKIT
2+
13
#import <UIKit/UIKit.h>
24
#import <React/RCTViewManager.h>
35
#import "RNSentryFramesTrackerListener.h"
@@ -68,3 +70,5 @@ - (void)didSetProps:(NSArray<NSString *> *)changedProps
6870
}
6971

7072
@end
73+
74+
#endif

ios/RNSentryRNSScreen.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
#import <Sentry/SentryDefines.h>
2+
3+
#if SENTRY_HAS_UIKIT
4+
15
#import <Foundation/Foundation.h>
26

37
@interface RNSentryRNSScreen : NSObject
48

59
+ (void)swizzleViewDidAppear;
610

711
@end
12+
13+
#endif

0 commit comments

Comments
 (0)