@react-native-firebase/perf 25.1.0 → 26.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.
- package/CHANGELOG.md +23 -0
- package/RNFBPerf.podspec +9 -7
- package/android/build.gradle +19 -0
- package/android/src/main/java/io/invertase/firebase/perf/UniversalFirebasePerfModule.java +88 -0
- package/android/src/reactnative/java/io/invertase/firebase/perf/NativeRNFBTurboPerf.java +108 -0
- package/android/src/reactnative/java/io/invertase/firebase/perf/ReactNativeFirebasePerfPackage.java +1 -1
- package/android/src/reactnative/java/io/invertase/firebase/perf/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboPerfSpec.java +100 -0
- package/android/src/reactnative/java/io/invertase/firebase/perf/generated/jni/CMakeLists.txt +36 -0
- package/android/src/reactnative/java/io/invertase/firebase/perf/generated/jni/RNFBPerfTurboModules-generated.cpp +80 -0
- package/android/src/reactnative/java/io/invertase/firebase/perf/generated/jni/RNFBPerfTurboModules.h +31 -0
- package/android/src/reactnative/java/io/invertase/firebase/perf/generated/jni/react/renderer/components/RNFBPerfTurboModules/RNFBPerfTurboModulesJSI-generated.cpp +94 -0
- package/android/src/reactnative/java/io/invertase/firebase/perf/generated/jni/react/renderer/components/RNFBPerfTurboModules/RNFBPerfTurboModulesJSI.h +267 -0
- package/app.plugin.js +1 -1
- package/dist/module/HttpMetric.js +4 -4
- package/dist/module/HttpMetric.js.map +1 -1
- package/dist/module/ScreenTrace.js +5 -5
- package/dist/module/ScreenTrace.js.map +1 -1
- package/dist/module/Trace.js +4 -4
- package/dist/module/Trace.js.map +1 -1
- package/dist/module/index.js +142 -3
- package/dist/module/index.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/HttpMetric.d.ts +2 -2
- package/dist/typescript/lib/HttpMetric.d.ts.map +1 -1
- package/dist/typescript/lib/ScreenTrace.d.ts +2 -2
- package/dist/typescript/lib/ScreenTrace.d.ts.map +1 -1
- package/dist/typescript/lib/Trace.d.ts +2 -2
- package/dist/typescript/lib/Trace.d.ts.map +1 -1
- package/dist/typescript/lib/index.d.ts +23 -4
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +12 -16
- package/dist/typescript/lib/types/internal.d.ts.map +1 -1
- package/dist/typescript/lib/types/perf.d.ts +7 -7
- package/dist/typescript/lib/types/perf.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/ios/RNFBPerf/RNFBPerfModule.h +3 -2
- package/ios/RNFBPerf/RNFBPerfModule.mm +268 -0
- package/ios/RNFBPerf.xcodeproj/project.pbxproj +8 -8
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNFBPerfTurboModules/RNFBPerfTurboModules-generated.mm +106 -0
- package/ios/generated/RNFBPerfTurboModules/RNFBPerfTurboModules.h +191 -0
- package/ios/generated/RNFBPerfTurboModulesJSI-generated.cpp +94 -0
- package/ios/generated/RNFBPerfTurboModulesJSI.h +267 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/HttpMetric.ts +6 -6
- package/lib/ScreenTrace.ts +7 -7
- package/lib/Trace.ts +6 -6
- package/lib/index.ts +228 -5
- package/lib/types/internal.ts +12 -24
- package/lib/types/perf.ts +7 -7
- package/lib/version.ts +1 -1
- package/package.json +30 -5
- package/plugin/build/app.plugin.d.ts +2 -0
- package/plugin/build/app.plugin.js +6 -0
- package/plugin/src/app.plugin.ts +3 -0
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/react-native.config.js +10 -0
- package/specs/NativeRNFBTurboPerf.ts +44 -0
- package/typedoc.json +1 -1
- package/android/src/reactnative/java/io/invertase/firebase/perf/ReactNativeFirebasePerfModule.java +0 -158
- package/dist/module/modular.js +0 -93
- package/dist/module/modular.js.map +0 -1
- package/dist/module/namespaced.js +0 -130
- package/dist/module/namespaced.js.map +0 -1
- package/dist/module/types/namespaced.js +0 -65
- package/dist/module/types/namespaced.js.map +0 -1
- package/dist/typescript/lib/modular.d.ts +0 -43
- package/dist/typescript/lib/modular.d.ts.map +0 -1
- package/dist/typescript/lib/namespaced.d.ts +0 -11
- package/dist/typescript/lib/namespaced.d.ts.map +0 -1
- package/dist/typescript/lib/types/namespaced.d.ts +0 -128
- package/dist/typescript/lib/types/namespaced.d.ts.map +0 -1
- package/ios/RNFBPerf/RNFBPerfModule.m +0 -215
- package/lib/modular.ts +0 -116
- package/lib/namespaced.ts +0 -200
- package/lib/types/namespaced.ts +0 -162
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
import type { FirebaseApp } from '@react-native-firebase/app';
|
|
2
|
+
import './types/internal';
|
|
3
|
+
import type { FirebasePerformance, HttpMetric, HttpMethod, PerformanceSettings, PerformanceTrace, ScreenTrace } from './types/perf';
|
|
4
|
+
export declare const SDK_VERSION = "26.1.0";
|
|
5
|
+
export declare function getPerformance(app?: FirebaseApp): FirebasePerformance;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a Performance Monitoring instance and applies optional settings.
|
|
8
|
+
*
|
|
9
|
+
* @remarks Returns **synchronously** on React Native Firebase (unlike some async firebase-js-sdk
|
|
10
|
+
* initialization paths). Settings are applied to the native Performance SDK instance.
|
|
11
|
+
*/
|
|
12
|
+
export declare function initializePerformance(app: FirebaseApp, settings?: PerformanceSettings): FirebasePerformance;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a custom performance trace.
|
|
15
|
+
*
|
|
16
|
+
* @remarks On React Native Firebase, {@link PerformanceTrace.start} and
|
|
17
|
+
* {@link PerformanceTrace.stop} are **synchronous** (in-memory native calls via TurboModules),
|
|
18
|
+
* matching the firebase-js-sdk web `PerformanceTrace`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function trace(performance: FirebasePerformance, name: string): PerformanceTrace;
|
|
21
|
+
export declare function httpMetric(performance: FirebasePerformance, url: string, httpMethod: HttpMethod): HttpMetric;
|
|
22
|
+
export declare function newScreenTrace(performance: FirebasePerformance, screenName: string): ScreenTrace;
|
|
23
|
+
export declare function startScreenTrace(performance: FirebasePerformance, screenName: string): ScreenTrace;
|
|
1
24
|
export type * from './types/perf';
|
|
2
|
-
export * from './modular';
|
|
3
|
-
export type { FirebasePerformanceTypes } from './types/namespaced';
|
|
4
|
-
export * from './namespaced';
|
|
5
|
-
export { default } from './namespaced';
|
|
6
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/index.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAM9D,OAAO,kBAAkB,CAAC;AAS1B,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACZ,MAAM,cAAc,CAAC;AA6ItB,eAAO,MAAM,WAAW,WAAU,CAAC;AAMnC,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,WAAW,GAAG,mBAAmB,CAMrE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,WAAW,EAChB,QAAQ,CAAC,EAAE,mBAAmB,GAC7B,mBAAmB,CAWrB;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,WAAW,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAEtF;AAED,wBAAgB,UAAU,CACxB,WAAW,EAAE,mBAAmB,EAChC,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,UAAU,GACrB,UAAU,CAEZ;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,CAEhG;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,mBAAmB,EAChC,UAAU,EAAE,MAAM,GACjB,WAAW,CAEb;AAED,mBAAmB,cAAc,CAAC"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import type { FirebasePerformance, HttpMetric, HttpMethod, PerformanceTrace, ScreenTrace } from './perf';
|
|
2
|
-
export type PerfModularDeprecationArg = string;
|
|
3
|
-
/**
|
|
4
|
-
* Namespaced perf instance used by modular entrypoints; methods accept an optional modular deprecation token.
|
|
5
|
-
*/
|
|
6
2
|
export interface PerfInternal extends FirebasePerformance {
|
|
7
3
|
/**
|
|
8
4
|
* @deprecated Prefer assigning {@link FirebasePerformance.dataCollectionEnabled}.
|
|
9
5
|
*/
|
|
10
6
|
setPerformanceCollectionEnabled(enabled: boolean): Promise<null>;
|
|
11
|
-
newTrace(name: string
|
|
12
|
-
startTrace(name: string
|
|
13
|
-
newScreenTrace(screenName: string
|
|
14
|
-
startScreenTrace(screenName: string
|
|
15
|
-
newHttpMetric(url: string, httpMethod: HttpMethod
|
|
7
|
+
newTrace(name: string): PerformanceTrace;
|
|
8
|
+
startTrace(name: string): PerformanceTrace;
|
|
9
|
+
newScreenTrace(screenName: string): ScreenTrace;
|
|
10
|
+
startScreenTrace(screenName: string): ScreenTrace;
|
|
11
|
+
newHttpMetric(url: string, httpMethod: HttpMethod): HttpMetric;
|
|
16
12
|
}
|
|
17
13
|
export interface RNFBPerfTraceData {
|
|
18
14
|
metrics: Record<string, number>;
|
|
@@ -30,16 +26,16 @@ export interface RNFBPerfNativeModule {
|
|
|
30
26
|
isInstrumentationEnabled: boolean;
|
|
31
27
|
setPerformanceCollectionEnabled(enabled: boolean): Promise<null>;
|
|
32
28
|
instrumentationEnabled(enabled: boolean): Promise<null>;
|
|
33
|
-
startTrace(id: number, identifier: string):
|
|
34
|
-
stopTrace(id: number, traceData: RNFBPerfTraceData):
|
|
35
|
-
startHttpMetric(id: number, url: string, httpMethod: HttpMethod):
|
|
36
|
-
stopHttpMetric(id: number, metricData: RNFBPerfHttpMetricData):
|
|
37
|
-
startScreenTrace(id: number, identifier: string):
|
|
38
|
-
stopScreenTrace(id: number):
|
|
29
|
+
startTrace(id: number, identifier: string): void;
|
|
30
|
+
stopTrace(id: number, traceData: RNFBPerfTraceData): void;
|
|
31
|
+
startHttpMetric(id: number, url: string, httpMethod: HttpMethod): void;
|
|
32
|
+
stopHttpMetric(id: number, metricData: RNFBPerfHttpMetricData): void;
|
|
33
|
+
startScreenTrace(id: number, identifier: string): void;
|
|
34
|
+
stopScreenTrace(id: number): void;
|
|
39
35
|
}
|
|
40
36
|
declare module '@react-native-firebase/app/dist/module/internal/NativeModules' {
|
|
41
37
|
interface ReactNativeFirebaseNativeModules {
|
|
42
|
-
|
|
38
|
+
NativeRNFBTurboPerf: RNFBPerfNativeModule;
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
41
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../lib/types/internal.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,QAAQ,CAAC;AAEhB,MAAM,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../lib/types/internal.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,QAAQ,CAAC;AAEhB,MAAM,WAAW,YAAa,SAAQ,mBAAmB;IACvD;;OAEG;IACH,+BAA+B,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAC;IACzC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAC3C,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC;IAChD,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC;IAClD,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;CAChE;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,8BAA8B,EAAE,OAAO,CAAC;IACxC,wBAAwB,EAAE,OAAO,CAAC;IAClC,+BAA+B,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC1D,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IACvE,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACrE,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACvD,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,OAAO,QAAQ,+DAA+D,CAAC;IAC7E,UAAU,gCAAgC;QACxC,mBAAmB,EAAE,oBAAoB,CAAC;KAC3C;CACF"}
|
|
@@ -15,7 +15,7 @@ export type HttpMethod = 'GET' | 'HEAD' | 'PUT' | 'POST' | 'PATCH' | 'TRACE' | '
|
|
|
15
15
|
/**
|
|
16
16
|
* A performance trace (aligned with {@link https://firebase.google.com/docs/reference/js/performance.performancetrace | PerformanceTrace} in the Firebase JS SDK).
|
|
17
17
|
*
|
|
18
|
-
* @remarks React Native uses
|
|
18
|
+
* @remarks React Native uses synchronous `start`/`stop` (in-memory native calls via TurboModules), matching the firebase-js-sdk web `PerformanceTrace`. React Native also exposes `getMetrics` and `removeMetric`, which are not on the web `PerformanceTrace` type.
|
|
19
19
|
*/
|
|
20
20
|
export interface PerformanceTrace {
|
|
21
21
|
getAttribute(attr: string): string | undefined;
|
|
@@ -27,15 +27,15 @@ export interface PerformanceTrace {
|
|
|
27
27
|
putMetric(metricName: string, num: number): void;
|
|
28
28
|
incrementMetric(metricName: string, num?: number): void;
|
|
29
29
|
removeMetric(metricName: string): void;
|
|
30
|
-
start():
|
|
31
|
-
stop():
|
|
30
|
+
start(): void;
|
|
31
|
+
stop(): void;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Screen trace for slow/frozen frames (React Native).
|
|
35
35
|
*/
|
|
36
36
|
export interface ScreenTrace {
|
|
37
|
-
start():
|
|
38
|
-
stop():
|
|
37
|
+
start(): void;
|
|
38
|
+
stop(): void;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Network request metric (React Native; not part of the web Performance modular surface).
|
|
@@ -51,8 +51,8 @@ export interface HttpMetric {
|
|
|
51
51
|
setRequestPayloadSize(bytes: number | null): void;
|
|
52
52
|
setResponsePayloadSize(bytes: number | null): void;
|
|
53
53
|
setResponseContentType(contentType: string | null): void;
|
|
54
|
-
start():
|
|
55
|
-
stop():
|
|
54
|
+
start(): void;
|
|
55
|
+
stop(): void;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Firebase Performance Monitoring service (aligned with {@link https://firebase.google.com/docs/reference/js/performance.firebaseperformance | FirebasePerformance} in the Firebase JS SDK).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../../lib/types/perf.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gDAAgD;IAChD,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,KAAK,GACL,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/C,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IACtC,UAAU,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACxC,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxD,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../../lib/types/perf.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gDAAgD;IAChD,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,KAAK,GACL,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/C,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IACtC,UAAU,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACxC,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxD,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/C,aAAa,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC3C,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/C,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAClD,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACnD,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACzD,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,GAAG,EAAE,WAAW,CAAC;IACjB,0EAA0E;IAC1E,sBAAsB,EAAE,OAAO,CAAC;IAChC,yCAAyC;IACzC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qFAAqF;IACrF,8BAA8B,EAAE,OAAO,CAAC;CACzC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "
|
|
1
|
+
export declare const version = "26.1.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
#import <Foundation/Foundation.h>
|
|
19
|
+
#import <React/RCTInvalidating.h>
|
|
20
|
+
#import "RNFBPerfTurboModules.h"
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
@interface RNFBPerfModule : NSObject <NativeRNFBTurboPerfSpec, RCTInvalidating>
|
|
21
23
|
|
|
22
|
-
@interface RNFBPerfModule : NSObject <RCTBridgeModule>
|
|
23
24
|
@end
|
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
|
|
18
|
+
#import <React/RCTConvert.h>
|
|
19
|
+
#import <React/RCTUtils.h>
|
|
20
|
+
|
|
21
|
+
#if __has_include(<Firebase/Firebase.h>)
|
|
22
|
+
#import <Firebase/Firebase.h>
|
|
23
|
+
#define RNFB_PERF_SDK_AVAILABLE 1
|
|
24
|
+
#elif __has_include(<FirebasePerformance/FirebasePerformance.h>)
|
|
25
|
+
#import <FirebaseCore/FirebaseCore.h>
|
|
26
|
+
#import <FirebasePerformance/FirebasePerformance.h>
|
|
27
|
+
#define RNFB_PERF_SDK_AVAILABLE 1
|
|
28
|
+
#else
|
|
29
|
+
// Product headers absent (typical Mac Catalyst + SPM). Upstream Package.swift
|
|
30
|
+
// omits .macCatalyst from FirebasePerformanceTarget; CocoaPods historically
|
|
31
|
+
// masked this via the Firebase umbrella. Temporary stubs pending
|
|
32
|
+
// https://github.com/firebase/firebase-ios-sdk/pull/16468 (or permanent if
|
|
33
|
+
// upstream declines). Never fall through to @import in this .mm — that
|
|
34
|
+
// requires -fcxx-modules and breaks RN C++/JSI.
|
|
35
|
+
#define RNFB_PERF_SDK_AVAILABLE 0
|
|
36
|
+
#endif
|
|
37
|
+
#import "RNFBApp/RNFBSharedUtils.h"
|
|
38
|
+
#import "RNFBPerfModule.h"
|
|
39
|
+
|
|
40
|
+
static __strong NSMutableDictionary *traces;
|
|
41
|
+
static __strong NSMutableDictionary *httpMetrics;
|
|
42
|
+
|
|
43
|
+
@implementation RNFBPerfModule
|
|
44
|
+
|
|
45
|
+
RCT_EXPORT_MODULE(NativeRNFBTurboPerf)
|
|
46
|
+
|
|
47
|
+
+ (BOOL)requiresMainQueueSetup {
|
|
48
|
+
return NO;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
- (instancetype)init {
|
|
52
|
+
self = [super init];
|
|
53
|
+
|
|
54
|
+
static dispatch_once_t onceToken;
|
|
55
|
+
dispatch_once(&onceToken, ^{
|
|
56
|
+
traces = [[NSMutableDictionary alloc] init];
|
|
57
|
+
httpMetrics = [[NSMutableDictionary alloc] init];
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
return self;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
- (void)invalidate {
|
|
64
|
+
@synchronized([self class]) {
|
|
65
|
+
for (NSString *key in [traces allKeys]) {
|
|
66
|
+
[traces removeObjectForKey:key];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
for (NSString *key in [httpMetrics allKeys]) {
|
|
70
|
+
[httpMetrics removeObjectForKey:key];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
#if !RNFB_PERF_SDK_AVAILABLE
|
|
76
|
+
- (void)rejectUnavailable:(RCTPromiseRejectBlock)reject {
|
|
77
|
+
[RNFBSharedUtils rejectPromiseWithUserInfo:reject
|
|
78
|
+
userInfo:(NSMutableDictionary *)@{
|
|
79
|
+
@"code" : @"unsupported",
|
|
80
|
+
@"message" : @"Firebase Performance is not available on "
|
|
81
|
+
@"this platform or dependency configuration.",
|
|
82
|
+
}];
|
|
83
|
+
}
|
|
84
|
+
#endif
|
|
85
|
+
|
|
86
|
+
- (NSDictionary *)perfConstantsDictionary {
|
|
87
|
+
NSMutableDictionary *constants = [NSMutableDictionary new];
|
|
88
|
+
#if RNFB_PERF_SDK_AVAILABLE
|
|
89
|
+
constants[@"isPerformanceCollectionEnabled"] =
|
|
90
|
+
@([RCTConvert BOOL:@([FIRPerformance sharedInstance].dataCollectionEnabled)]);
|
|
91
|
+
constants[@"isInstrumentationEnabled"] =
|
|
92
|
+
@([RCTConvert BOOL:@([FIRPerformance sharedInstance].instrumentationEnabled)]);
|
|
93
|
+
#else
|
|
94
|
+
constants[@"isPerformanceCollectionEnabled"] = @(NO);
|
|
95
|
+
constants[@"isInstrumentationEnabled"] = @(NO);
|
|
96
|
+
#endif
|
|
97
|
+
return constants;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
- (facebook::react::ModuleConstants<JS::NativeRNFBTurboPerf::Constants::Builder>)constantsToExport {
|
|
101
|
+
return [_RCTTypedModuleConstants newWithUnsafeDictionary:[self perfConstantsDictionary]];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
- (facebook::react::ModuleConstants<JS::NativeRNFBTurboPerf::Constants::Builder>)getConstants {
|
|
105
|
+
return [self constantsToExport];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
109
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
110
|
+
return std::make_shared<facebook::react::NativeRNFBTurboPerfSpecJSI>(params);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
- (void)setPerformanceCollectionEnabled:(BOOL)enabled
|
|
114
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
115
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
116
|
+
#if RNFB_PERF_SDK_AVAILABLE
|
|
117
|
+
[FIRPerformance sharedInstance].dataCollectionEnabled = (BOOL)enabled;
|
|
118
|
+
resolve([NSNull null]);
|
|
119
|
+
#else
|
|
120
|
+
(void)enabled;
|
|
121
|
+
(void)resolve;
|
|
122
|
+
[self rejectUnavailable:reject];
|
|
123
|
+
#endif
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
- (void)instrumentationEnabled:(BOOL)enabled
|
|
127
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
128
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
129
|
+
#if RNFB_PERF_SDK_AVAILABLE
|
|
130
|
+
[FIRPerformance sharedInstance].instrumentationEnabled = (BOOL)enabled;
|
|
131
|
+
resolve([NSNull null]);
|
|
132
|
+
#else
|
|
133
|
+
(void)enabled;
|
|
134
|
+
(void)resolve;
|
|
135
|
+
[self rejectUnavailable:reject];
|
|
136
|
+
#endif
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
- (void)startTrace:(double)id identifier:(NSString *)identifier {
|
|
140
|
+
#if RNFB_PERF_SDK_AVAILABLE
|
|
141
|
+
FIRTrace *trace = [[FIRPerformance sharedInstance] traceWithName:identifier];
|
|
142
|
+
[trace start];
|
|
143
|
+
|
|
144
|
+
@synchronized([self class]) {
|
|
145
|
+
traces[@((int)id)] = trace;
|
|
146
|
+
}
|
|
147
|
+
#else
|
|
148
|
+
(void)id;
|
|
149
|
+
(void)identifier;
|
|
150
|
+
#endif
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
- (void)stopTrace:(double)id traceData:(JS::NativeRNFBTurboPerf::TraceData &)traceData {
|
|
154
|
+
#if RNFB_PERF_SDK_AVAILABLE
|
|
155
|
+
FIRTrace *trace;
|
|
156
|
+
@synchronized([self class]) {
|
|
157
|
+
trace = traces[@((int)id)];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
NSDictionary *metrics = (NSDictionary *)traceData.metrics();
|
|
161
|
+
NSDictionary *attributes = (NSDictionary *)traceData.attributes();
|
|
162
|
+
|
|
163
|
+
[metrics enumerateKeysAndObjectsUsingBlock:^(NSString *metricName, NSNumber *value, BOOL *stop) {
|
|
164
|
+
[trace setIntValue:[value longLongValue] forMetric:metricName];
|
|
165
|
+
}];
|
|
166
|
+
|
|
167
|
+
[attributes
|
|
168
|
+
enumerateKeysAndObjectsUsingBlock:^(NSString *attributeName, NSString *value, BOOL *stop) {
|
|
169
|
+
[trace setValue:value forAttribute:attributeName];
|
|
170
|
+
}];
|
|
171
|
+
|
|
172
|
+
[trace stop];
|
|
173
|
+
|
|
174
|
+
@synchronized([self class]) {
|
|
175
|
+
[traces removeObjectForKey:@((int)id)];
|
|
176
|
+
}
|
|
177
|
+
#else
|
|
178
|
+
(void)id;
|
|
179
|
+
(void)traceData;
|
|
180
|
+
#endif
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
- (void)startScreenTrace:(double)id identifier:(NSString *)identifier {
|
|
184
|
+
// Custom screen traces are not supported on iOS.
|
|
185
|
+
(void)id;
|
|
186
|
+
(void)identifier;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
- (void)stopScreenTrace:(double)id {
|
|
190
|
+
// Custom screen traces are not supported on iOS.
|
|
191
|
+
(void)id;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
- (void)startHttpMetric:(double)id url:(NSString *)url httpMethod:(NSString *)httpMethod {
|
|
195
|
+
#if RNFB_PERF_SDK_AVAILABLE
|
|
196
|
+
FIRHTTPMethod method = FIRHTTPMethodGET;
|
|
197
|
+
NSURL *toNSURL = [NSURL URLWithString:url];
|
|
198
|
+
if ([httpMethod compare:@"put" options:NSCaseInsensitiveSearch] == NSOrderedSame)
|
|
199
|
+
method = FIRHTTPMethodPUT;
|
|
200
|
+
if ([httpMethod compare:@"post" options:NSCaseInsensitiveSearch] == NSOrderedSame)
|
|
201
|
+
method = FIRHTTPMethodPOST;
|
|
202
|
+
if ([httpMethod compare:@"head" options:NSCaseInsensitiveSearch] == NSOrderedSame)
|
|
203
|
+
method = FIRHTTPMethodHEAD;
|
|
204
|
+
if ([httpMethod compare:@"trace" options:NSCaseInsensitiveSearch] == NSOrderedSame)
|
|
205
|
+
method = FIRHTTPMethodTRACE;
|
|
206
|
+
if ([httpMethod compare:@"patch" options:NSCaseInsensitiveSearch] == NSOrderedSame)
|
|
207
|
+
method = FIRHTTPMethodPATCH;
|
|
208
|
+
if ([httpMethod compare:@"delete" options:NSCaseInsensitiveSearch] == NSOrderedSame)
|
|
209
|
+
method = FIRHTTPMethodDELETE;
|
|
210
|
+
if ([httpMethod compare:@"options" options:NSCaseInsensitiveSearch] == NSOrderedSame)
|
|
211
|
+
method = FIRHTTPMethodOPTIONS;
|
|
212
|
+
if ([httpMethod compare:@"connect" options:NSCaseInsensitiveSearch] == NSOrderedSame)
|
|
213
|
+
method = FIRHTTPMethodCONNECT;
|
|
214
|
+
|
|
215
|
+
FIRHTTPMetric *httpMetric = [[FIRHTTPMetric alloc] initWithURL:toNSURL HTTPMethod:method];
|
|
216
|
+
[httpMetric start];
|
|
217
|
+
|
|
218
|
+
@synchronized([self class]) {
|
|
219
|
+
httpMetrics[@((int)id)] = httpMetric;
|
|
220
|
+
}
|
|
221
|
+
#else
|
|
222
|
+
(void)id;
|
|
223
|
+
(void)url;
|
|
224
|
+
(void)httpMethod;
|
|
225
|
+
#endif
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
- (void)stopHttpMetric:(double)id metricData:(JS::NativeRNFBTurboPerf::HttpMetricData &)metricData {
|
|
229
|
+
#if RNFB_PERF_SDK_AVAILABLE
|
|
230
|
+
FIRHTTPMetric *httpMetric;
|
|
231
|
+
@synchronized([self class]) {
|
|
232
|
+
httpMetric = httpMetrics[@((int)id)];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
NSDictionary *attributes = (NSDictionary *)metricData.attributes();
|
|
236
|
+
[attributes
|
|
237
|
+
enumerateKeysAndObjectsUsingBlock:^(NSString *attributeName, NSString *value, BOOL *stop) {
|
|
238
|
+
[httpMetric setValue:value forAttribute:attributeName];
|
|
239
|
+
}];
|
|
240
|
+
|
|
241
|
+
if (metricData.httpResponseCode().has_value()) {
|
|
242
|
+
[httpMetric setResponseCode:(NSInteger)metricData.httpResponseCode().value()];
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (metricData.requestPayloadSize().has_value()) {
|
|
246
|
+
[httpMetric setRequestPayloadSize:(NSInteger)metricData.requestPayloadSize().value()];
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (metricData.responsePayloadSize().has_value()) {
|
|
250
|
+
[httpMetric setResponsePayloadSize:(NSInteger)metricData.responsePayloadSize().value()];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (metricData.responseContentType() != nil) {
|
|
254
|
+
[httpMetric setResponseContentType:metricData.responseContentType()];
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
[httpMetric stop];
|
|
258
|
+
|
|
259
|
+
@synchronized([self class]) {
|
|
260
|
+
[httpMetrics removeObjectForKey:@((int)id)];
|
|
261
|
+
}
|
|
262
|
+
#else
|
|
263
|
+
(void)id;
|
|
264
|
+
(void)metricData;
|
|
265
|
+
#endif
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@end
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
objects = {
|
|
8
8
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
|
-
2744B98621F45429004F8E3F /* RNFBPerfModule.
|
|
10
|
+
2744B98621F45429004F8E3F /* RNFBPerfModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744B98521F45429004F8E3F /* RNFBPerfModule.mm */; };
|
|
11
11
|
/* End PBXBuildFile section */
|
|
12
12
|
|
|
13
13
|
/* Begin PBXCopyFilesBuildPhase section */
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
/* Begin PBXFileReference section */
|
|
26
26
|
2744B98221F45429004F8E3F /* libRNFBPerf.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFBPerf.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
27
27
|
2744B98421F45429004F8E3F /* RNFBPerfModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBPerfModule.h; path = RNFBPerf/RNFBPerfModule.h; sourceTree = SOURCE_ROOT; };
|
|
28
|
-
2744B98521F45429004F8E3F /* RNFBPerfModule.
|
|
28
|
+
2744B98521F45429004F8E3F /* RNFBPerfModule.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBPerfModule.mm; path = RNFBPerf/RNFBPerfModule.mm; sourceTree = SOURCE_ROOT; };
|
|
29
29
|
/* End PBXFileReference section */
|
|
30
30
|
|
|
31
31
|
/* Begin PBXFrameworksBuildPhase section */
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
2744B9A121F48736004F8E3F /* converters */,
|
|
54
54
|
2744B98C21F45C64004F8E3F /* common */,
|
|
55
55
|
2744B98421F45429004F8E3F /* RNFBPerfModule.h */,
|
|
56
|
-
2744B98521F45429004F8E3F /* RNFBPerfModule.
|
|
56
|
+
2744B98521F45429004F8E3F /* RNFBPerfModule.mm */,
|
|
57
57
|
);
|
|
58
58
|
path = RNFBPerf;
|
|
59
59
|
sourceTree = "<group>";
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
isa = PBXSourcesBuildPhase;
|
|
125
125
|
buildActionMask = 2147483647;
|
|
126
126
|
files = (
|
|
127
|
-
2744B98621F45429004F8E3F /* RNFBPerfModule.
|
|
127
|
+
2744B98621F45429004F8E3F /* RNFBPerfModule.mm in Sources */,
|
|
128
128
|
);
|
|
129
129
|
runOnlyForDeploymentPostprocessing = 0;
|
|
130
130
|
};
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
);
|
|
160
160
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
161
161
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
162
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
162
|
+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
|
163
163
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
|
164
164
|
MTL_FAST_MATH = YES;
|
|
165
165
|
OTHER_LDFLAGS = "-ObjC";
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
|
194
194
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
195
195
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
196
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
196
|
+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
|
197
197
|
MTL_ENABLE_DEBUG_INFO = NO;
|
|
198
198
|
MTL_FAST_MATH = YES;
|
|
199
199
|
OTHER_LDFLAGS = "-ObjC";
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
"$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**",
|
|
255
255
|
"$(SRCROOT)/../../../packages/app/ios/**",
|
|
256
256
|
);
|
|
257
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
257
|
+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
|
258
258
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
259
259
|
MACH_O_TYPE = staticlib;
|
|
260
260
|
OTHER_LDFLAGS = "$(inherited)";
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
"$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**",
|
|
313
313
|
"$(SRCROOT)/../../../packages/app/ios/**",
|
|
314
314
|
);
|
|
315
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
315
|
+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
|
316
316
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
317
317
|
MACH_O_TYPE = staticlib;
|
|
318
318
|
ONLY_ACTIVE_ARCH = YES;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
#if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
|
|
12
|
+
#import <React-RCTAppDelegate/RCTDependencyProvider.h>
|
|
13
|
+
#elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
|
|
14
|
+
#import <React_RCTAppDelegate/RCTDependencyProvider.h>
|
|
15
|
+
#else
|
|
16
|
+
#import "RCTDependencyProvider.h"
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
20
|
+
|
|
21
|
+
@interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
|
|
22
|
+
|
|
23
|
+
@end
|
|
24
|
+
|
|
25
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTAppDependencyProvider.h"
|
|
9
|
+
#import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
|
|
10
|
+
#import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
|
|
11
|
+
|
|
12
|
+
@implementation RCTAppDependencyProvider {
|
|
13
|
+
NSArray<NSString *> * _URLRequestHandlerClassNames;
|
|
14
|
+
NSArray<NSString *> * _imageDataDecoderClassNames;
|
|
15
|
+
NSArray<NSString *> * _imageURLLoaderClassNames;
|
|
16
|
+
NSDictionary<NSString *,Class<RCTComponentViewProtocol>> * _thirdPartyFabricComponents;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
- (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
|
|
20
|
+
static dispatch_once_t requestUrlToken;
|
|
21
|
+
dispatch_once(&requestUrlToken, ^{
|
|
22
|
+
self->_URLRequestHandlerClassNames = RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return _URLRequestHandlerClassNames;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
- (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
|
|
29
|
+
static dispatch_once_t dataDecoderToken;
|
|
30
|
+
dispatch_once(&dataDecoderToken, ^{
|
|
31
|
+
_imageDataDecoderClassNames = RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return _imageDataDecoderClassNames;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
|
|
38
|
+
static dispatch_once_t urlLoaderToken;
|
|
39
|
+
dispatch_once(&urlLoaderToken, ^{
|
|
40
|
+
_imageURLLoaderClassNames = RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return _imageURLLoaderClassNames;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
|
|
47
|
+
static dispatch_once_t nativeComponentsToken;
|
|
48
|
+
dispatch_once(&nativeComponentsToken, ^{
|
|
49
|
+
_thirdPartyFabricComponents = RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return _thirdPartyFabricComponents;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@interface RCTModulesConformingToProtocolsProvider: NSObject
|
|
11
|
+
|
|
12
|
+
+(NSArray<NSString *> *)imageURLLoaderClassNames;
|
|
13
|
+
|
|
14
|
+
+(NSArray<NSString *> *)imageDataDecoderClassNames;
|
|
15
|
+
|
|
16
|
+
+(NSArray<NSString *> *)URLRequestHandlerClassNames;
|
|
17
|
+
|
|
18
|
+
@end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTModulesConformingToProtocolsProvider.h"
|
|
9
|
+
|
|
10
|
+
@implementation RCTModulesConformingToProtocolsProvider
|
|
11
|
+
|
|
12
|
+
+(NSArray<NSString *> *)imageURLLoaderClassNames
|
|
13
|
+
{
|
|
14
|
+
return @[
|
|
15
|
+
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
+(NSArray<NSString *> *)imageDataDecoderClassNames
|
|
20
|
+
{
|
|
21
|
+
return @[
|
|
22
|
+
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
+(NSArray<NSString *> *)URLRequestHandlerClassNames
|
|
27
|
+
{
|
|
28
|
+
return @[
|
|
29
|
+
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@protocol RCTComponentViewProtocol;
|
|
11
|
+
|
|
12
|
+
@interface RCTThirdPartyComponentsProvider: NSObject
|
|
13
|
+
|
|
14
|
+
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
|
|
15
|
+
|
|
16
|
+
@end
|