@umituz/react-native-firebase 3.0.1 → 3.0.2

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": "3.0.1",
3
+ "version": "3.0.2",
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",
@@ -18,14 +18,19 @@ export * from './domain';
18
18
  // INFRASTRUCTURE LAYER - Implementation
19
19
  // =============================================================================
20
20
 
21
- // Firestore Client
22
- export {
23
- initializeFirestore,
24
- getFirestore,
25
- isFirestoreInitialized,
26
- getFirestoreInitializationError,
27
- resetFirestoreClient,
28
- } from './infrastructure/config/FirestoreClient';
21
+ // IMPORTANT: Use Firebase SDK directly for Firestore operations
22
+ // Import in your app: import { getFirestore } from 'firebase/firestore';
23
+ //
24
+ // Firestore initialization:
25
+ // import { initializeFirestore } from 'firebase/firestore';
26
+ // import { getReactNativePersistence } from 'firebase/firestore/react-native';
27
+ // import AsyncStorage from '@react-native-async-storage/async-storage';
28
+ //
29
+ // const db = initializeFirestore(firebaseApp, {
30
+ // localCache: getReactNativePersistence(AsyncStorage)
31
+ // });
32
+
33
+ // Firestore type (any to avoid conflicts)
29
34
  export type { Firestore } from './infrastructure/config/FirestoreClient';
30
35
 
31
36
  // Repositories
@@ -1,76 +1,24 @@
1
1
  /**
2
2
  * Firestore Configuration Client
3
3
  *
4
- * IMPORTANT: This package does NOT import from firebase/firestore to avoid
5
- * IndexedDB dependencies that break React Native bundling.
6
- *
7
- * Instead, you should:
8
- * 1. Install firebase SDK in your app: npm install firebase
9
- * 2. Import and use getFirestore() from 'firebase/firestore' directly
10
- * 3. Use the utilities from this package for repositories and helpers
11
- */
12
-
13
- import { FirebaseInitializationError } from "../../../../shared/domain/errors/FirebaseError";
14
-
15
- // Firestore type from firebase/firestore SDK
16
- // Import in your app: import type { Firestore } from 'firebase/firestore'
17
- export type Firestore = unknown;
18
-
19
- let firestoreInstance: Firestore | null = null;
20
- let initializationError: Error | null = null;
21
-
22
- /**
23
- * Initialize Firestore
24
- *
25
- * DEPRECATED: This function is deprecated and will be removed in future versions.
26
- *
27
- * Instead, initialize Firestore directly in your app:
4
+ * IMPORTANT: This package does NOT provide Firestore initialization.
5
+ * Use Firebase SDK directly in your app:
28
6
  * ```typescript
29
- * import { initializeFirestore } from 'firebase/firestore';
7
+ * import { getFirestore, initializeFirestore } from 'firebase/firestore';
30
8
  * import { getReactNativePersistence } from 'firebase/firestore/react-native';
31
9
  * import AsyncStorage from '@react-native-async-storage/async-storage';
32
10
  *
33
- * const firestore = initializeFirestore(firebaseApp, {
11
+ * const db = initializeFirestore(firebaseApp, {
34
12
  * localCache: getReactNativePersistence(AsyncStorage)
35
13
  * });
36
14
  * ```
15
+ *
16
+ * This package only provides:
17
+ * - Base repository classes (extend these for your data layer)
18
+ * - Utilities for pagination, queries, dates
19
+ * - Type definitions (import from 'firebase/firestore' in your app)
37
20
  */
38
- export async function initializeFirestore(
39
- firebaseApp: unknown // FirebaseApp from firebase/app
40
- ): Promise<Firestore> {
41
- throw new FirebaseInitializationError(
42
- "Firestore initialization has moved. " +
43
- "Please use initializeFirestore() from 'firebase/firestore' directly in your app. " +
44
- "See package README for migration guide."
45
- );
46
- }
47
-
48
- /**
49
- * Get Firestore instance
50
- * Returns null if not initialized
51
- */
52
- export function getFirestore(): Firestore | null {
53
- return firestoreInstance;
54
- }
55
-
56
- /**
57
- * Check if Firestore is initialized
58
- */
59
- export function isFirestoreInitialized(): boolean {
60
- return firestoreInstance !== null;
61
- }
62
-
63
- /**
64
- * Get Firestore initialization error
65
- */
66
- export function getFirestoreInitializationError(): Error | null {
67
- return initializationError;
68
- }
69
21
 
70
- /**
71
- * Reset Firestore client state
72
- */
73
- export function resetFirestoreClient(): void {
74
- firestoreInstance = null;
75
- initializationError = null;
76
- }
22
+ // Firestore type - use 'any' to avoid type conflicts with Firebase SDK
23
+ // The actual type checking happens in your app when you import from firebase/firestore
24
+ export type Firestore = any;
@@ -29,11 +29,9 @@ export interface FirebaseAppOptions {
29
29
  // Firestore Types
30
30
  // =============================================================================
31
31
 
32
- // IMPORTANT: Import Firestore from 'firebase/firestore' in your app
33
- // Do NOT use this type - it's only for internal package compatibility
34
- export interface Firestore {
35
- readonly __brand: 'Firestore';
36
- }
32
+ // Firestore type - use 'any' to avoid type conflicts with Firebase SDK
33
+ // In your app, import the actual type: import type { Firestore } from 'firebase/firestore'
34
+ export type Firestore = any;
37
35
 
38
36
  export interface DocumentSnapshot<T = unknown> {
39
37
  id: string;