@react-native-firebase/perf 26.4.0 → 27.1.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/RNFBPerf.podspec +6 -1
  3. package/android/build.gradle +3 -0
  4. package/android/src/main/java/io/invertase/firebase/perf/RNFBPerfHandleRegistry.kt +71 -0
  5. package/android/src/test/java/io/invertase/firebase/perf/RNFBPerfHandleRegistryTest.java +30 -0
  6. package/dist/module/version.js +1 -1
  7. package/dist/typescript/lib/index.d.ts +1 -1
  8. package/dist/typescript/lib/version.d.ts +1 -1
  9. package/ios/RNFBPerf/RNFBPerfHandleRegistry.m +28 -9
  10. package/ios/RNFBPerf/RNFBPerfHandleRegistryStorage.swift +58 -0
  11. package/ios/RNFBPerf/RNFBPerfHelper.h +71 -0
  12. package/ios/RNFBPerf/RNFBPerfHelper.m +219 -0
  13. package/ios/RNFBPerf/RNFBPerfHttpMethodMapper.swift +86 -0
  14. package/ios/RNFBPerf/RNFBPerfHttpMetricStopApplier.swift +87 -0
  15. package/ios/RNFBPerf/RNFBPerfModule.mm +35 -172
  16. package/ios/RNFBPerf/RNFBPerfTraceStopApplier.swift +68 -0
  17. package/ios/RNFBPerf.xcodeproj/project.pbxproj +32 -0
  18. package/ios/RNFBPerfUnitTests/HostStubs/Firebase/FIRPerformanceHostStub.m +170 -0
  19. package/ios/RNFBPerfUnitTests/HostStubs/Firebase/Firebase.h +75 -0
  20. package/ios/RNFBPerfUnitTests/HostStubs/RNFBApp/RNFBSharedUtils.h +12 -0
  21. package/ios/RNFBPerfUnitTests/HostStubs/RNFBApp/RNFBSharedUtilsHostStub.m +18 -0
  22. package/ios/RNFBPerfUnitTests/HostStubs/React/RCTBridgeModule.h +10 -0
  23. package/ios/RNFBPerfUnitTests/RNFBPerfHandleRegistryTests.m +46 -0
  24. package/ios/RNFBPerfUnitTests/RNFBPerfHelperHostStubTests.m +200 -0
  25. package/ios/RNFBPerfUnitTests/RNFBPerfHttpMethodMapperFacadeTests.m +52 -0
  26. package/ios/RNFBPerfUnitTests/RNFBPerfHttpMethodMapperTests.swift +92 -0
  27. package/ios/RNFBPerfUnitTests/RNFBPerfHttpMetricStopApplierFacadeTests.m +105 -0
  28. package/ios/RNFBPerfUnitTests/RNFBPerfHttpMetricStopApplierTests.swift +201 -0
  29. package/ios/RNFBPerfUnitTests/RNFBPerfTraceStopApplierFacadeTests.m +75 -0
  30. package/ios/RNFBPerfUnitTests/RNFBPerfTraceStopApplierTests.swift +142 -0
  31. package/ios/RNFBPerfUnitTests/RNFBPerfUnitTests.xcodeproj/project.pbxproj +70 -0
  32. package/lib/version.ts +1 -1
  33. package/package.json +4 -4
  34. package/android/src/main/java/io/invertase/firebase/perf/RNFBPerfHandleRegistry.java +0 -72
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/perf",
3
- "version": "26.4.0",
3
+ "version": "27.1.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - React Native Firebase provides native integration with Performance Monitoring to gain insight into key performance characteristics within your React Native application.",
6
6
  "main": "./dist/module/index.js",
@@ -49,11 +49,11 @@
49
49
  "performance monitoring"
50
50
  ],
51
51
  "peerDependencies": {
52
- "@react-native-firebase/app": "26.4.0",
52
+ "@react-native-firebase/app": "27.1.0",
53
53
  "expo": ">=47.0.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@react-native-firebase/app": "26.4.0",
56
+ "@react-native-firebase/app": "27.1.0",
57
57
  "expo": "^55.0.18",
58
58
  "react-native-builder-bob": "^0.40.13"
59
59
  },
@@ -104,5 +104,5 @@
104
104
  "node_modules/",
105
105
  "dist/"
106
106
  ],
107
- "gitHead": "06701af5fdc19bae9f379567eadb29dfe81953c0"
107
+ "gitHead": "c65e1ee3b78bcd0c5b66996100d7d1e579ca1614"
108
108
  }
@@ -1,72 +0,0 @@
1
- package io.invertase.firebase.perf;
2
-
3
- /*
4
- * Copyright (c) 2016-present Invertase Limited & Contributors
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this library except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- *
18
- */
19
-
20
- import io.invertase.firebase.common.RNFBHandleCollisionException;
21
- import io.invertase.firebase.common.RNFBHandleMap;
22
- import java.util.List;
23
- import java.util.function.Predicate;
24
-
25
- /**
26
- * Perf id → metric handle map (traces, screen traces, HTTP metrics). Module start paths use {@link
27
- * #putReplacing} (last wins, stop displaced outside lock). Unique {@link #put} / {@link
28
- * #putOrDiscard} remain for tests. Callers {@link #get} then {@link #take} then stop outside the
29
- * HandleMap lock. Tear-down discards via {@link #takeAll} without stopping (matches prior
30
- * SparseArray clear).
31
- */
32
- final class RNFBPerfHandleRegistry<V> {
33
- private final RNFBHandleMap<Integer, V> map = new RNFBHandleMap<>();
34
-
35
- void put(int id, V handle) throws RNFBHandleCollisionException {
36
- map.put(id, handle);
37
- }
38
-
39
- /**
40
- * Unique put. On collision, drop the incoming handle without stopping and leave the existing
41
- * mapping.
42
- *
43
- * @return true if stored
44
- */
45
- boolean putOrDiscard(int id, V handle) {
46
- return map.putIfAbsent(id, handle);
47
- }
48
-
49
- /**
50
- * Atomically replaces the mapping for {@code id} (last wins). Returns the displaced handle, or
51
- * {@code null} if the id was free. Stop the displaced handle after this method returns.
52
- */
53
- V putReplacing(int id, V handle) {
54
- return map.putReplacing(id, handle);
55
- }
56
-
57
- V get(int id) {
58
- return map.get(id);
59
- }
60
-
61
- V take(int id) {
62
- return map.take(id);
63
- }
64
-
65
- V takeIf(int id, Predicate<V> shouldTake) {
66
- return map.takeIf(id, shouldTake);
67
- }
68
-
69
- List<V> takeAll() {
70
- return map.takeAll();
71
- }
72
- }