@datadog/mobile-react-native 1.8.3 → 1.8.5
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.
- package/datadog-sourcemaps.gradle +22 -9
- package/ios/Sources/DdSdk.mm +3 -1
- package/ios/Sources/DdSdkImplementation.swift +6 -6
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/version.ts +1 -1
|
@@ -26,11 +26,10 @@ afterEvaluate {
|
|
|
26
26
|
" define versionName property in the application/variant config.")
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
def targetName =
|
|
31
|
-
def targetPath =
|
|
29
|
+
def reactConfig = getReactConfig(buildDir, variant)
|
|
30
|
+
def targetName = reactConfig["targetName"]
|
|
31
|
+
def targetPath = reactConfig["targetPath"]
|
|
32
32
|
|
|
33
|
-
def reactConfig = getReactConfig(buildDir, targetName, targetPath)
|
|
34
33
|
def reactRoot = file(reactConfig.root)
|
|
35
34
|
|
|
36
35
|
def bundleTask = tasks.findByName(reactConfig.bundleTaskName)
|
|
@@ -58,8 +57,7 @@ afterEvaluate {
|
|
|
58
57
|
|
|
59
58
|
def execCommand = { jsBundleFile ->
|
|
60
59
|
return [
|
|
61
|
-
"
|
|
62
|
-
"datadog-ci",
|
|
60
|
+
"$reactConfig.root/node_modules/.bin/datadog-ci",
|
|
63
61
|
"react-native",
|
|
64
62
|
"upload",
|
|
65
63
|
"--platform",
|
|
@@ -88,7 +86,6 @@ afterEvaluate {
|
|
|
88
86
|
}
|
|
89
87
|
|
|
90
88
|
runShellCommand(execCommand(jsBundleFile), reactRoot)
|
|
91
|
-
|
|
92
89
|
}
|
|
93
90
|
}
|
|
94
91
|
|
|
@@ -105,7 +102,7 @@ afterEvaluate {
|
|
|
105
102
|
private def getBundleFileResolver(String[] jsBundleDirs, String bundleAssetName) {
|
|
106
103
|
def resolver = { ->
|
|
107
104
|
return jsBundleDirs.collect {
|
|
108
|
-
file("$it/$bundleAssetName")
|
|
105
|
+
file("$it/$bundleAssetName")
|
|
109
106
|
}.find {
|
|
110
107
|
it.exists()
|
|
111
108
|
}
|
|
@@ -121,34 +118,50 @@ private def getBundleFileResolver(String[] jsBundleDirs, String bundleAssetName)
|
|
|
121
118
|
* (and then "$buildDir/generated/assets/createBundle${targetPath}JsAndAssets" with the release of Android Gradle Plugin 7.4, see https://github.com/facebook/react-native/issues/35439)
|
|
122
119
|
* - config was in "project.react" and is now in "project.extensions.react"
|
|
123
120
|
* - accessing parameters values requires calling a getter
|
|
121
|
+
* - target path changed from variant.dirName to variant.name
|
|
124
122
|
*/
|
|
125
|
-
private def getReactConfig(File buildDir,
|
|
123
|
+
private def getReactConfig(File buildDir, variant) {
|
|
126
124
|
def reactConfig = [:]
|
|
127
125
|
|
|
128
126
|
if (project.extensions.findByName("react")) {
|
|
129
127
|
// From RN 0.71
|
|
128
|
+
// Locations and names are defined in "node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt"
|
|
130
129
|
def bundleAssetName = project.extensions.react.bundleAssetName.get() ?: "index.android.bundle"
|
|
130
|
+
def targetName = variant.name.capitalize()
|
|
131
|
+
def targetPath = variant.name
|
|
131
132
|
reactConfig['bundleTaskName'] = "createBundle${targetName}JsAndAssets"
|
|
132
133
|
reactConfig['bundleFileResolver'] = getBundleFileResolver([
|
|
133
134
|
"$buildDir/ASSETS/createBundle${targetName}JsAndAssets", // Android Gradle Plugin 7.3
|
|
134
135
|
"$buildDir/generated/assets/createBundle${targetName}JsAndAssets" // Android Gradle Plugin 7.4 and up
|
|
135
136
|
] as String[], bundleAssetName)
|
|
136
137
|
reactConfig['bundleAssetName'] = bundleAssetName
|
|
138
|
+
reactConfig['targetPath'] = targetPath
|
|
139
|
+
reactConfig['targetName'] = targetName
|
|
137
140
|
reactConfig['root'] = project.extensions.react.root.get() ?: "../../"
|
|
138
141
|
} else if (project.hasProperty("react")) {
|
|
139
142
|
// WARNING: on RN 0.71, `project.react` is an empty map, so this `if` must go after the previous one.
|
|
140
143
|
// Legacy way, before RN 0.71
|
|
144
|
+
// Locations and names are defined in "node_modules/react-native/react.gradle"
|
|
145
|
+
def targetName = variant.name.capitalize()
|
|
146
|
+
def targetPath = variant.dirName
|
|
141
147
|
def bundleAssetName = project.react.bundleAssetName ?: "index.android.bundle"
|
|
142
148
|
reactConfig['bundleTaskName'] = "bundle${targetName}JsAndAssets"
|
|
143
149
|
reactConfig['bundleFileResolver'] = getBundleFileResolver(["$buildDir/generated/assets/react/${targetPath}"] as String[], bundleAssetName)
|
|
144
150
|
reactConfig['bundleAssetName'] = bundleAssetName
|
|
151
|
+
reactConfig['targetPath'] = targetPath
|
|
152
|
+
reactConfig['targetName'] = targetName
|
|
145
153
|
reactConfig['root'] = project.react.root ?: "../../"
|
|
146
154
|
} else {
|
|
147
155
|
// We assume this cannot happen with RN >= 0.71, so we use the legacy default values
|
|
156
|
+
// Locations and names are defined in "node_modules/react-native/react.gradle"
|
|
157
|
+
def targetName = variant.name.capitalize()
|
|
158
|
+
def targetPath = variant.dirName
|
|
148
159
|
def bundleAssetName = "index.android.bundle"
|
|
149
160
|
reactConfig['bundleTaskName'] = "bundle${targetName}JsAndAssets"
|
|
150
161
|
reactConfig['bundleFileResolver'] = getBundleFileResolver(["$buildDir/generated/assets/react/${targetPath}"] as String[], bundleAssetName)
|
|
151
162
|
reactConfig['bundleAssetName'] = bundleAssetName
|
|
163
|
+
reactConfig['targetPath'] = targetPath
|
|
164
|
+
reactConfig['targetName'] = targetName
|
|
152
165
|
reactConfig['root'] = "../../"
|
|
153
166
|
}
|
|
154
167
|
|
package/ios/Sources/DdSdk.mm
CHANGED
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
#import <DatadogSDKReactNative/DatadogSDKReactNative-Swift.h>
|
|
11
11
|
#endif
|
|
12
12
|
#import "DdSdk.h"
|
|
13
|
+
#import <React/RCTBridge+Private.h>
|
|
13
14
|
|
|
14
15
|
@implementation DdSdk
|
|
15
16
|
|
|
17
|
+
@synthesize bridge = _bridge;
|
|
16
18
|
RCT_EXPORT_MODULE()
|
|
17
19
|
|
|
18
20
|
RCT_REMAP_METHOD(initialize, withConfiguration:(NSDictionary*)configuration
|
|
@@ -79,7 +81,7 @@ RCT_REMAP_METHOD(consumeWebviewEvent, withWebviewMessage:(NSString*)message
|
|
|
79
81
|
- (DdSdkImplementation*)ddSdkImplementation
|
|
80
82
|
{
|
|
81
83
|
if (_ddSdkImplementation == nil) {
|
|
82
|
-
_ddSdkImplementation = [[DdSdkImplementation alloc]
|
|
84
|
+
_ddSdkImplementation = [[DdSdkImplementation alloc] initWithBridge:_bridge];
|
|
83
85
|
}
|
|
84
86
|
return _ddSdkImplementation;
|
|
85
87
|
}
|
|
@@ -17,20 +17,20 @@ func getDefaultAppVersion() -> String {
|
|
|
17
17
|
|
|
18
18
|
@objc
|
|
19
19
|
public class DdSdkImplementation: NSObject {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
let jsDispatchQueue: DispatchQueueType
|
|
22
21
|
let jsRefreshRateMonitor: RefreshRateMonitor
|
|
23
22
|
let mainDispatchQueue: DispatchQueueType
|
|
24
23
|
|
|
25
24
|
private let jsLongTaskThresholdInSeconds: TimeInterval = 0.1;
|
|
26
25
|
|
|
27
26
|
@objc
|
|
28
|
-
public convenience
|
|
29
|
-
self.init(mainDispatchQueue: DispatchQueue.main, jsRefreshRateMonitor: JSRefreshRateMonitor.init())
|
|
27
|
+
public convenience init(bridge: RCTBridge) {
|
|
28
|
+
self.init(mainDispatchQueue: DispatchQueue.main, jsDispatchQueue: bridge, jsRefreshRateMonitor: JSRefreshRateMonitor.init())
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
init(mainDispatchQueue: DispatchQueueType, jsRefreshRateMonitor: RefreshRateMonitor) {
|
|
31
|
+
init(mainDispatchQueue: DispatchQueueType, jsDispatchQueue: DispatchQueueType, jsRefreshRateMonitor: RefreshRateMonitor) {
|
|
33
32
|
self.mainDispatchQueue = mainDispatchQueue
|
|
33
|
+
self.jsDispatchQueue = jsDispatchQueue
|
|
34
34
|
self.jsRefreshRateMonitor = jsRefreshRateMonitor
|
|
35
35
|
super.init()
|
|
36
36
|
}
|
|
@@ -377,7 +377,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
377
377
|
func startJSRefreshRateMonitoring(sdkConfiguration: DdSdkConfiguration) {
|
|
378
378
|
if let frameTimeCallback = buildFrameTimeCallback(sdkConfiguration: sdkConfiguration) {
|
|
379
379
|
// Falling back to mainDispatchQueue if bridge is nil is only useful for tests
|
|
380
|
-
self.jsRefreshRateMonitor.startMonitoring(jsQueue:
|
|
380
|
+
self.jsRefreshRateMonitor.startMonitoring(jsQueue: jsDispatchQueue, frameTimeCallback: frameTimeCallback)
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '1.8.
|
|
1
|
+
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '1.8.5';\n"]}
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '1.8.
|
|
1
|
+
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '1.8.5';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.8.
|
|
1
|
+
export declare const version = "1.8.5";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5",
|
|
4
4
|
"description": "A client-side React Native module to interact with Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"javaPackageName": "com.datadog.reactnative"
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "f2333b854e3a8b6e0bc36d62b3ea9759fac9f56d"
|
|
90
90
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '1.8.
|
|
2
|
+
export const version = '1.8.5';
|