@datadog/mobile-react-native 1.0.0-beta4 → 1.0.0-rc4

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.
Files changed (103) hide show
  1. package/DatadogSDKReactNative.podspec +1 -1
  2. package/README.md +73 -1
  3. package/android/build.gradle +2 -3
  4. package/android/src/main/java/com/datadog/reactnative/DdRum.kt +25 -24
  5. package/android/src/main/java/com/datadog/reactnative/DdTrace.kt +6 -6
  6. package/ios/Sources/DdRum.m +10 -9
  7. package/ios/Sources/DdRum.swift +24 -24
  8. package/ios/Sources/DdTrace.m +2 -2
  9. package/ios/Sources/DdTrace.swift +6 -6
  10. package/ios/Sources/QueueHolder.swift +1 -1
  11. package/lib/commonjs/DdSdkReactNative.js +57 -0
  12. package/lib/commonjs/DdSdkReactNative.js.map +1 -1
  13. package/lib/commonjs/DdSdkReactNativeConfiguration.js +8 -0
  14. package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
  15. package/lib/commonjs/NativeSdkVerbosity.js +26 -0
  16. package/lib/commonjs/NativeSdkVerbosity.js.map +1 -0
  17. package/lib/commonjs/ProxyConfiguration.js +53 -0
  18. package/lib/commonjs/ProxyConfiguration.js.map +1 -0
  19. package/lib/commonjs/Timer.js +99 -0
  20. package/lib/commonjs/Timer.js.map +1 -0
  21. package/lib/commonjs/TrackingConsent.js +6 -0
  22. package/lib/commonjs/TrackingConsent.js.map +1 -1
  23. package/lib/commonjs/foundation.js +88 -8
  24. package/lib/commonjs/foundation.js.map +1 -1
  25. package/lib/commonjs/index.js +14 -0
  26. package/lib/commonjs/index.js.map +1 -1
  27. package/lib/commonjs/rum/instrumentation/DdEventsInterceptor.js +51 -11
  28. package/lib/commonjs/rum/instrumentation/DdEventsInterceptor.js.map +1 -1
  29. package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +38 -6
  30. package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
  31. package/lib/commonjs/rum/instrumentation/DdRumResourceTracking.js +103 -18
  32. package/lib/commonjs/rum/instrumentation/DdRumResourceTracking.js.map +1 -1
  33. package/lib/commonjs/types.js.map +1 -1
  34. package/lib/commonjs/version.js +10 -0
  35. package/lib/commonjs/version.js.map +1 -0
  36. package/lib/module/DdSdkReactNative.js +56 -1
  37. package/lib/module/DdSdkReactNative.js.map +1 -1
  38. package/lib/module/DdSdkReactNativeConfiguration.js +9 -1
  39. package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
  40. package/lib/module/NativeSdkVerbosity.js +18 -0
  41. package/lib/module/NativeSdkVerbosity.js.map +1 -0
  42. package/lib/module/ProxyConfiguration.js +46 -0
  43. package/lib/module/ProxyConfiguration.js.map +1 -0
  44. package/lib/module/Timer.js +90 -0
  45. package/lib/module/Timer.js.map +1 -0
  46. package/lib/module/TrackingConsent.js +6 -0
  47. package/lib/module/TrackingConsent.js.map +1 -1
  48. package/lib/module/foundation.js +89 -3
  49. package/lib/module/foundation.js.map +1 -1
  50. package/lib/module/index.js +2 -1
  51. package/lib/module/index.js.map +1 -1
  52. package/lib/module/rum/instrumentation/DdEventsInterceptor.js +51 -11
  53. package/lib/module/rum/instrumentation/DdEventsInterceptor.js.map +1 -1
  54. package/lib/module/rum/instrumentation/DdRumErrorTracking.js +37 -6
  55. package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
  56. package/lib/module/rum/instrumentation/DdRumResourceTracking.js +96 -18
  57. package/lib/module/rum/instrumentation/DdRumResourceTracking.js.map +1 -1
  58. package/lib/module/types.js.map +1 -1
  59. package/lib/module/version.js +3 -0
  60. package/lib/module/version.js.map +1 -0
  61. package/lib/typescript/DdSdkReactNative.d.ts +11 -0
  62. package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +6 -0
  63. package/lib/typescript/NativeSdkVerbosity.d.ts +9 -0
  64. package/lib/typescript/ProxyConfiguration.d.ts +56 -0
  65. package/lib/typescript/Timer.d.ts +20 -0
  66. package/lib/typescript/index.d.ts +2 -1
  67. package/lib/typescript/rum/instrumentation/DdEventsInterceptor.d.ts +2 -0
  68. package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts +2 -0
  69. package/lib/typescript/rum/instrumentation/DdRumResourceTracking.d.ts +4 -0
  70. package/lib/typescript/rum/instrumentation/DdRumXhr.d.ts +2 -2
  71. package/lib/typescript/types.d.ts +25 -24
  72. package/lib/typescript/version.d.ts +1 -0
  73. package/package.json +12 -13
  74. package/src/DdSdkReactNative.tsx +47 -0
  75. package/src/DdSdkReactNativeConfiguration.tsx +7 -1
  76. package/src/NativeSdkVerbosity.tsx +15 -0
  77. package/src/ProxyConfiguration.tsx +37 -0
  78. package/src/Timer.ts +96 -0
  79. package/src/TrackingConsent.tsx +6 -0
  80. package/src/__tests__/DdRumWrapper.test.tsx +91 -0
  81. package/src/__tests__/DdSdkReactNative.test.tsx +541 -0
  82. package/src/__tests__/Timer.test.ts +145 -0
  83. package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +222 -0
  84. package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +314 -0
  85. package/src/__tests__/rum/instrumentation/DdRumResourceTracking.test.tsx +677 -0
  86. package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +188 -0
  87. package/src/__tests__/rum/instrumentation/TraceIdentifier.test.tsx +33 -0
  88. package/src/foundation.tsx +83 -3
  89. package/src/index.tsx +3 -2
  90. package/src/rum/instrumentation/DdEventsInterceptor.tsx +40 -10
  91. package/src/rum/instrumentation/DdRumErrorTracking.tsx +56 -25
  92. package/src/rum/instrumentation/DdRumResourceTracking.tsx +92 -22
  93. package/src/rum/instrumentation/DdRumXhr.tsx +6 -5
  94. package/src/types.tsx +25 -24
  95. package/src/version.ts +2 -0
  96. package/android/.project +0 -17
  97. package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
  98. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  99. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  100. package/android/gradlew +0 -185
  101. package/android/gradlew.bat +0 -104
  102. package/ios/DdSdkReactNative.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  103. package/ios/Tests/ModulesTest.swift +0 -43
@@ -1,104 +0,0 @@
1
- @rem
2
- @rem Copyright 2015 the original author or authors.
3
- @rem
4
- @rem Licensed under the Apache License, Version 2.0 (the "License");
5
- @rem you may not use this file except in compliance with the License.
6
- @rem You may obtain a copy of the License at
7
- @rem
8
- @rem https://www.apache.org/licenses/LICENSE-2.0
9
- @rem
10
- @rem Unless required by applicable law or agreed to in writing, software
11
- @rem distributed under the License is distributed on an "AS IS" BASIS,
12
- @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- @rem See the License for the specific language governing permissions and
14
- @rem limitations under the License.
15
- @rem
16
-
17
- @if "%DEBUG%" == "" @echo off
18
- @rem ##########################################################################
19
- @rem
20
- @rem Gradle startup script for Windows
21
- @rem
22
- @rem ##########################################################################
23
-
24
- @rem Set local scope for the variables with windows NT shell
25
- if "%OS%"=="Windows_NT" setlocal
26
-
27
- set DIRNAME=%~dp0
28
- if "%DIRNAME%" == "" set DIRNAME=.
29
- set APP_BASE_NAME=%~n0
30
- set APP_HOME=%DIRNAME%
31
-
32
- @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33
- for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34
-
35
- @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36
- set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37
-
38
- @rem Find java.exe
39
- if defined JAVA_HOME goto findJavaFromJavaHome
40
-
41
- set JAVA_EXE=java.exe
42
- %JAVA_EXE% -version >NUL 2>&1
43
- if "%ERRORLEVEL%" == "0" goto init
44
-
45
- echo.
46
- echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47
- echo.
48
- echo Please set the JAVA_HOME variable in your environment to match the
49
- echo location of your Java installation.
50
-
51
- goto fail
52
-
53
- :findJavaFromJavaHome
54
- set JAVA_HOME=%JAVA_HOME:"=%
55
- set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56
-
57
- if exist "%JAVA_EXE%" goto init
58
-
59
- echo.
60
- echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61
- echo.
62
- echo Please set the JAVA_HOME variable in your environment to match the
63
- echo location of your Java installation.
64
-
65
- goto fail
66
-
67
- :init
68
- @rem Get command-line arguments, handling Windows variants
69
-
70
- if not "%OS%" == "Windows_NT" goto win9xME_args
71
-
72
- :win9xME_args
73
- @rem Slurp the command line arguments.
74
- set CMD_LINE_ARGS=
75
- set _SKIP=2
76
-
77
- :win9xME_args_slurp
78
- if "x%~1" == "x" goto execute
79
-
80
- set CMD_LINE_ARGS=%*
81
-
82
- :execute
83
- @rem Setup the command line
84
-
85
- set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
86
-
87
-
88
- @rem Execute Gradle
89
- "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
90
-
91
- :end
92
- @rem End local scope for the variables with windows NT shell
93
- if "%ERRORLEVEL%"=="0" goto mainEnd
94
-
95
- :fail
96
- rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
97
- rem the _cmd.exe /c_ return code!
98
- if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
99
- exit /b 1
100
-
101
- :mainEnd
102
- if "%OS%"=="Windows_NT" endlocal
103
-
104
- :omega
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>IDEDidComputeMac32BitWarning</key>
6
- <true/>
7
- </dict>
8
- </plist>
@@ -1,43 +0,0 @@
1
- /*
2
- * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
3
- * This product includes software developed at Datadog (https://www.datadoghq.com/).
4
- * Copyright 2016-Present Datadog, Inc.
5
- */
6
-
7
- import XCTest
8
- @testable import dd_sdk_reactnative
9
- @testable import React.RCTModuleData
10
-
11
- // Since RN tooling does the modules linking automatically, it doesn't include testspecs
12
- // To do that modify node_modules/@react-native-community/cli-platform-ios/native_modules.rb#L90 to:
13
- //
14
- // if spec.name == "dd-sdk-reactnative"
15
- // pod spec.name, :path => relative_path.to_path, :testspecs => ['Tests']
16
- // else
17
- // pod spec.name, :path => relative_path.to_path
18
- // end
19
- //
20
- // and only after that do 'pod install'
21
- class ModulesTest: XCTestCase {
22
-
23
- func testAllModulesUseSameQueue() {
24
- XCTAssertTrue(sharedQueue === RNDdSdk().methodQueue)
25
- XCTAssertTrue(sharedQueue === RNDdRum().methodQueue)
26
- XCTAssertTrue(sharedQueue === RNDdLogs().methodQueue)
27
- XCTAssertTrue(sharedQueue === RNDdTrace().methodQueue)
28
- }
29
-
30
- func testAllModulesExposeMethodQueueProperly() {
31
- // RN does the check by calling BOOL implementsMethodQueue = [_instance respondsToSelector:@selector(methodQueue)];
32
- // So if methodQueue is static, check above returns false
33
- // This test makes sure that 'methodQueue' is implemented as instance member
34
- // Given
35
- let methodQueueSelector = #selector(getter: RCTModuleData.methodQueue)
36
-
37
- // Then
38
- XCTAssertTrue(RNDdSdk().responds(to: methodQueueSelector))
39
- XCTAssertTrue(RNDdRum().responds(to: methodQueueSelector))
40
- XCTAssertTrue(RNDdLogs().responds(to: methodQueueSelector))
41
- XCTAssertTrue(RNDdTrace().responds(to: methodQueueSelector))
42
- }
43
- }