@react-native-firebase/perf 20.3.0 → 20.4.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)
7
+
8
+ **Note:** Version bump only for package @react-native-firebase/perf
9
+
6
10
  ## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)
7
11
 
8
12
  **Note:** Version bump only for package @react-native-firebase/perf
package/lib/index.d.ts CHANGED
@@ -552,6 +552,8 @@ export const firebase: ReactNativeFirebase.Module & {
552
552
 
553
553
  export default defaultExport;
554
554
 
555
+ export * from './modular';
556
+
555
557
  /**
556
558
  * Attach namespace to `firebase.` and `FirebaseApp.`.
557
559
  */
package/lib/index.js CHANGED
@@ -27,15 +27,6 @@ import Trace from './Trace';
27
27
  import ScreenTrace from './ScreenTrace';
28
28
  import version from './version';
29
29
 
30
- export {
31
- getPerformance,
32
- initializePerformance,
33
- trace,
34
- httpMetric,
35
- newScreenTrace,
36
- startScreenTrace,
37
- } from './modular/index';
38
-
39
30
  const statics = {};
40
31
 
41
32
  const namespace = 'perf';
@@ -175,6 +166,8 @@ export default createModuleNamespace({
175
166
  ModuleClass: FirebasePerfModule,
176
167
  });
177
168
 
169
+ export * from './modular';
170
+
178
171
  // import perf, { firebase } from '@react-native-firebase/perf';
179
172
  // perf().X(...);
180
173
  // firebase.perf().X(...);
@@ -0,0 +1,88 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+ import { FirebaseApp } from '@firebase/app-types';
18
+ import { FirebasePerformanceTypes } from '..';
19
+
20
+ import Performance = FirebasePerformanceTypes.Module;
21
+
22
+ import Trace = FirebasePerformanceTypes.Module.Trace;
23
+ import HttpMethod = FirebasePerformanceTypes.HttpMethod;
24
+ import HttpMetric = FirebasePerformanceTypes.HttpMetric;
25
+ import ScreenTrace = FirebasePerformanceTypes.ScreenTrace;
26
+
27
+ /**
28
+ * Returns a Performance instance for the given app.
29
+ * @param app - FirebaseApp. Optional.
30
+ * @returns {Performance}
31
+ */
32
+ export function getPerformance(app?: FirebaseApp): Performance;
33
+
34
+ type PerformanceSettings = {
35
+ dataCollectionEnabled: boolean;
36
+ };
37
+
38
+ /**
39
+ * Returns a Performance instance for the given app.
40
+ * @param app - FirebaseApp. Required.
41
+ * @param settings - PerformanceSettings. Set "dataCollectionEnabled" which will enable/disable Performance collection.
42
+ * @returns {Promise<Performance>}
43
+ */
44
+ export function initializePerformance(
45
+ app: FirebaseApp,
46
+ settings: PerformanceSettings,
47
+ ): Promise<Performance>;
48
+
49
+ /**
50
+ * Returns a Trace instance.
51
+ * @param perf - Performance instance.
52
+ * @param identifier - A String to identify the Trace instance.
53
+ * @returns {Trace}
54
+ */
55
+ export function trace(perf: Performance, identifier: string): Trace;
56
+
57
+ /**
58
+ * Returns a HttpMetric instance.
59
+ * @param perf - Performance instance.
60
+ * @param identifier - A String to identify the HttpMetric instance.
61
+ * @param httpMethod - The HTTP method for the HttpMetric instance.
62
+ * @returns {HttpMetric}
63
+ */
64
+ export function httpMetric(
65
+ perf: Performance,
66
+ identifier: string,
67
+ httpMethod: HttpMethod,
68
+ ): HttpMetric;
69
+
70
+ /**
71
+ * Creates a ScreenTrace instance with the given identifier.
72
+ * Throws if hardware acceleration is disabled or if Android is 9.0 or 9.1.
73
+ * @platform android Android !== 9.0.0 && Android !== 9.1.0
74
+ * @param perf - Performance instance.
75
+ * @param identifier - Name of the trace, no leading or trailing whitespace allowed, no leading underscore '_' character allowed, max length is 100.
76
+ * @returns {ScreenTrace}
77
+ */
78
+ export function newScreenTrace(perf: Performance, identifier: string): ScreenTrace;
79
+
80
+ /**
81
+ * Creates a ScreenTrace instance with the given identifier and immediately starts it.
82
+ * Throws if hardware acceleration is disabled or if Android is 9.0 or 9.1.
83
+ * @platform android Android !== 9.0.0 && Android !== 9.1.0
84
+ * @param perf - Performance instance.
85
+ * @param identifier - Name of the screen.
86
+ * @returns {Promise<ScreenTrace>}
87
+ */
88
+ export function startScreenTrace(perf: Performance, identifier: string): Promise<ScreenTrace>;
@@ -15,6 +15,14 @@
15
15
  *
16
16
  */
17
17
 
18
+ /**
19
+ * @typedef {import('@firebase/app').FirebaseApp} FirebaseApp
20
+ * @typedef {import('..').FirebasePerformanceTypes.Module} Performance
21
+ * @typedef {import('..').FirebasePerformanceTypes.Trace} Trace
22
+ * @typedef {import('..').FirebasePerformanceTypes.ScreenTrace} ScreenTrace
23
+ * @typedef {import('..').FirebasePerformanceTypes.HttpMetric} HttpMetric
24
+ */
25
+
18
26
  import { isBoolean } from '@react-native-firebase/app/lib/common';
19
27
  import { firebase } from '..';
20
28
 
@@ -73,6 +81,7 @@ export function httpMetric(perf, identifier, httpMethod) {
73
81
  * @platform android Android !== 9.0.0 && Android !== 9.1.0
74
82
  * @param perf - Performance instance
75
83
  * @param identifier Name of the trace, no leading or trailing whitespace allowed, no leading underscore '_' character allowed, max length is 100.
84
+ * @returns {ScreenTrace}
76
85
  */
77
86
  export function newScreenTrace(perf, identifier) {
78
87
  return perf.newScreenTrace(identifier);
@@ -83,6 +92,7 @@ export function newScreenTrace(perf, identifier) {
83
92
  * @platform android Android !== 9.0.0 && Android !== 9.1.0
84
93
  * @param perf - Performance instance
85
94
  * @param identifier Name of the screen
95
+ * @returns {Promise<ScreenTrace>}
86
96
  */
87
97
  export function startScreenTrace(perf, identifier) {
88
98
  return perf.startScreenTrace(identifier);
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '20.3.0';
2
+ module.exports = '20.4.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/perf",
3
- "version": "20.3.0",
3
+ "version": "20.4.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": "lib/index.js",
@@ -29,7 +29,7 @@
29
29
  "performance monitoring"
30
30
  ],
31
31
  "peerDependencies": {
32
- "@react-native-firebase/app": "20.3.0",
32
+ "@react-native-firebase/app": "20.4.0",
33
33
  "expo": ">=47.0.0"
34
34
  },
35
35
  "devDependencies": {
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "a916b37b022cf40588fa0fd915b7ab901e2458d0"
46
+ "gitHead": "3ac3e9623674a8db52c111b4aa0a85a883260116"
47
47
  }