@bugsnag/plugin-react-native-span-access 3.4.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,30 @@ Pod::Spec.new do |s|
15
15
 
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
17
17
 
18
- s.dependency 'BugsnagPerformance'
18
+ # Supported BugsnagPerformance versions: >= 1.14.0 and < 6.0, the same range for CocoaPods and
19
+ # for the Swift package (where maximumVersion is exclusive). The newest release in the range is
20
+ # used, unless the app pins a version inside it; Podfile.lock or Package.resolved then keeps
21
+ # that version until the dependencies are updated.
22
+ #
23
+ # 1.14.0 added the span control and plugin APIs used by this plugin. The upper bound makes
24
+ # CocoaPods report a clear version conflict, rather than a build error, if a BugsnagPerformance
25
+ # major version is incompatible.
26
+ #
27
+ # BUGSNAG_PERFORMANCE_SPM=1 takes BugsnagPerformance from its Swift package instead, using React
28
+ # Native's spm_dependency helper. The app must not also depend on the BugsnagPerformance pod,
29
+ # directly or through another pod such as BugsnagPerformanceSwift, or it is linked twice.
30
+ use_spm = ENV["BUGSNAG_PERFORMANCE_SPM"] == "1"
31
+ if use_spm && defined?(spm_dependency)
32
+ spm_dependency(s,
33
+ url: "https://github.com/bugsnag/bugsnag-cocoa-performance.git",
34
+ requirement: { kind: "versionRange", minimumVersion: "1.14.0", maximumVersion: "6.0.0" },
35
+ products: ["BugsnagPerformance"])
36
+ else
37
+ Pod::UI.warn "BUGSNAG_PERFORMANCE_SPM is ignored because this version of React Native does not " \
38
+ "support spm_dependency. BugsnagNativeSpans uses the BugsnagPerformance pod." if use_spm
39
+ s.dependency 'BugsnagPerformance', '>= 1.14.0', '< 6.0'
40
+ end
41
+ s.dependency 'BugsnagReactNativePerformance'
19
42
 
20
43
  if ENV["RCT_NEW_ARCH_ENABLED"] == "1"
21
44
  install_modules_dependencies(s)
@@ -1,9 +1,10 @@
1
1
  #import <Foundation/Foundation.h>
2
2
  #import <BugsnagPerformance/BugsnagPerformancePlugin.h>
3
+ #import <BugsnagReactNativePerformance/BugsnagPerformanceAppStartProvider.h>
3
4
 
4
5
  NS_ASSUME_NONNULL_BEGIN
5
6
 
6
- @interface BugsnagReactNativeAppStartPlugin: NSObject <BugsnagPerformancePlugin>
7
+ @interface BugsnagReactNativeAppStartPlugin: NSObject <BugsnagPerformancePlugin, BugsnagPerformanceAppStartProvider>
7
8
 
8
9
  - (instancetype)init;
9
10
  - (instancetype)initWithTimeout:(NSTimeInterval)timeout;
@@ -4,6 +4,7 @@
4
4
  #import <BugsnagPerformance/BugsnagPerformanceSpan.h>
5
5
  #import <BugsnagPerformance/BugsnagPerformanceSpanCondition.h>
6
6
  #import <BugsnagPerformance/BugsnagPerformanceSpanContext.h>
7
+ #import <BugsnagReactNativePerformance/BugsnagPerformanceAppStartRegistry.h>
7
8
 
8
9
  static const NSTimeInterval kDefaultSpanBlockTimeoutInterval = 5; // 5s default timeout
9
10
 
@@ -22,8 +23,6 @@ static const NSTimeInterval kDefaultSpanBlockTimeoutInterval = 5; // 5s default
22
23
 
23
24
  @implementation BugsnagReactNativeAppStartPlugin
24
25
 
25
- static BugsnagReactNativeAppStartPlugin *_sharedInstance = nil;
26
-
27
26
  - (instancetype)init {
28
27
  return [self initWithTimeout:kDefaultSpanBlockTimeoutInterval];
29
28
  }
@@ -35,12 +34,9 @@ static BugsnagReactNativeAppStartPlugin *_sharedInstance = nil;
35
34
  return self;
36
35
  }
37
36
 
38
- + (id)singleton {
39
- return _sharedInstance;
40
- }
41
-
42
37
  - (void)installWithContext:(BugsnagPerformancePluginContext *)context {
43
- _sharedInstance = self;
38
+ // Register this plugin as the AppStartProvider with the core React Native Performance module
39
+ [BugsnagPerformanceAppStartRegistry registerProvider:self];
44
40
  __weak BugsnagReactNativeAppStartPlugin *weakSelf = self;
45
41
 
46
42
  // Add span start callback with high priority (equivalent to NORM_PRIORITY + 1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bugsnag/plugin-react-native-span-access",
3
- "version": "3.4.0",
3
+ "version": "4.0.0",
4
4
  "description": "BugSnag performance monitoring for react-native",
5
5
  "homepage": "https://www.bugsnag.com/",
6
6
  "license": "MIT",
@@ -23,8 +23,8 @@
23
23
  "@bugsnag/react-native-performance": "^3.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@bugsnag/core-performance": "^3.2.0",
27
- "@bugsnag/react-native-performance": "^3.4.0",
26
+ "@bugsnag/core-performance": "^4.0.0",
27
+ "@bugsnag/react-native-performance": "^4.0.0",
28
28
  "@react-native/babel-preset": "^0.74.0",
29
29
  "@testing-library/jest-native": "^5.4.3",
30
30
  "@testing-library/react-native": "^12.4.1"
@@ -48,5 +48,5 @@
48
48
  "javaPackageName": "com.bugsnag.reactnative.performance.nativespans"
49
49
  }
50
50
  },
51
- "gitHead": "ee23ead619633202a2f639a75e869232c08713c4"
51
+ "gitHead": "800495d52648248fd7569b9771eeffc4e65ca829"
52
52
  }