@umituz/react-native-firebase 2.4.74 → 2.4.76

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-firebase",
3
- "version": "2.4.74",
3
+ "version": "2.4.76",
4
4
  "description": "Unified Firebase package for React Native apps - Auth and Firestore services using Firebase JS SDK (no native modules).",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -51,9 +51,11 @@ export function setupAuthListener(
51
51
  // Safety timeout
52
52
  const timeoutId = setTimeout(() => {
53
53
  if (!hasTriggered) {
54
- console.warn(
55
- "[AuthListener] Auth listener timeout - marking as initialized"
56
- );
54
+ if (__DEV__) {
55
+ console.warn(
56
+ "[AuthListener] Auth listener timeout - marking as initialized"
57
+ );
58
+ }
57
59
  hasTriggered = true;
58
60
  onInitialized?.();
59
61
  }
@@ -80,7 +80,9 @@ export async function signUpWithEmail(
80
80
  } catch (profileError) {
81
81
  // Profile update failed but account was created successfully
82
82
  // Log the error but don't fail the signup
83
- console.warn("Profile update failed after account creation:", profileError);
83
+ if (__DEV__) {
84
+ console.warn("Profile update failed after account creation:", profileError);
85
+ }
84
86
  }
85
87
  }
86
88
  }
@@ -113,12 +113,18 @@ export {
113
113
  withFirestore,
114
114
  withFirestoreVoid,
115
115
  withFirestoreBool,
116
- createErrorResult,
117
- createSuccessResult,
116
+ } from './utils/operation/operation-executor.util';
117
+
118
+ export {
118
119
  runTransaction,
119
120
  serverTimestamp,
120
- } from './utils/firestore-helper';
121
- export type { NoDbResult } from './utils/firestore-helper';
121
+ } from './utils/transaction/transaction.util';
122
+
123
+ export {
124
+ createErrorResult,
125
+ createSuccessResult,
126
+ } from './utils/result/result.util';
127
+ export type { NoDbResult } from './utils/result/result.util';
122
128
 
123
129
  // Validation Utilities
124
130
  export {
@@ -65,7 +65,9 @@ function getFirestoreClientSafe(): FirestoreClientSingleton | null {
65
65
  try {
66
66
  return FirestoreClientSingleton.getInstance();
67
67
  } catch (error) {
68
- console.error('[Firestore] Could not create Firestore client singleton:', error);
68
+ if (__DEV__) {
69
+ console.error('[Firestore] Could not create Firestore client singleton:', error);
70
+ }
69
71
  return null;
70
72
  }
71
73
  }
@@ -10,7 +10,8 @@
10
10
  * const { data: matches, isLoading } = useFirestoreSnapshot<Match[]>({
11
11
  * queryKey: ["matches", userId],
12
12
  * subscribe: (onData) => {
13
- * return onSnapshot(matchesCol(userId!), (snap) => {
13
+ * if (!userId) return () => {};
14
+ * return onSnapshot(matchesCol(userId), (snap) => {
14
15
  * onData(snap.docs.map(d => d.data() as Match));
15
16
  * });
16
17
  * },
@@ -23,7 +23,7 @@ export {
23
23
  export {
24
24
  executeOperation,
25
25
  executeAuthOperation,
26
- } from './async-executor.util';
26
+ } from './executors/basic-executors.util';
27
27
 
28
28
  // Error handling
29
29
  export { toErrorInfo } from './error-handlers/error-converters';
@@ -4,6 +4,8 @@
4
4
  * Automatically loads Firebase configuration from:
5
5
  * 1. expo-constants (Constants.expoConfig?.extra)
6
6
  * 2. Environment variables (process.env)
7
+ *
8
+ * Config format (flat): extra.firebaseApiKey, extra.firebaseAuthDomain, etc.
7
9
  */
8
10
 
9
11
  import type { FirebaseConfig } from '../../domain/value-objects/FirebaseConfig';
@@ -50,9 +52,7 @@ function loadExpoConfig(): Record<string, unknown> {
50
52
 
51
53
  /**
52
54
  * Get config value from expo constants.
53
- * Supports two formats in app.json extra:
54
- * 1. Flat: extra.firebaseApiKey (preferred)
55
- * 2. Nested: extra.firebase.apiKey (legacy fallback)
55
+ * Config format: extra.firebaseApiKey, extra.firebaseAuthDomain, etc.
56
56
  */
57
57
  function getExpoValue(key: ConfigKey, expoConfig: Record<string, unknown>): string {
58
58
  const flatMapping: Record<ConfigKey, string> = {
@@ -64,17 +64,9 @@ function getExpoValue(key: ConfigKey, expoConfig: Record<string, unknown>): stri
64
64
  appId: 'firebaseAppId',
65
65
  };
66
66
 
67
- // 1. Flat key: extra.firebaseApiKey
68
67
  const flat = expoConfig[flatMapping[key]];
69
68
  if (typeof flat === 'string' && flat) return flat;
70
69
 
71
- // 2. Nested key: extra.firebase.apiKey
72
- const nested = expoConfig['firebase'];
73
- if (nested && typeof nested === 'object') {
74
- const val = (nested as Record<string, unknown>)[key];
75
- if (typeof val === 'string' && val) return val;
76
- }
77
-
78
70
  return '';
79
71
  }
80
72
 
@@ -49,7 +49,8 @@ export class FirebaseInitializationOrchestrator {
49
49
  static autoInitialize(): FirebaseApp | null {
50
50
  try {
51
51
  const existingApps = getApps();
52
- return existingApps.length > 0 ? (existingApps[0] ?? null) : null;
52
+ const existingApp = existingApps.length > 0 ? existingApps[0] : undefined;
53
+ return existingApp ?? null;
53
54
  } catch {
54
55
  return null;
55
56
  }
@@ -1,18 +0,0 @@
1
- /**
2
- * Firestore Helper - Centralized Firestore access utilities
3
- * Provides common patterns for Firestore operations with error handling
4
- */
5
-
6
- export {
7
- createErrorResult,
8
- createSuccessResult,
9
- type NoDbResult,
10
- } from "./result/result.util";
11
-
12
- export {
13
- withFirestore,
14
- withFirestoreVoid,
15
- withFirestoreBool,
16
- } from "./operation/operation-executor.util";
17
-
18
- export { runTransaction, serverTimestamp } from "./transaction/transaction.util";
@@ -1,9 +0,0 @@
1
- /**
2
- * Async Operation Executor Utility
3
- * Re-exports async executors
4
- */
5
-
6
- export {
7
- executeOperation,
8
- executeAuthOperation,
9
- } from './executors/basic-executors.util';