@react-native-firebase/database 23.0.1 → 23.1.1
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 +11 -0
- package/lib/DatabaseDataSnapshot.js +10 -7
- package/lib/DatabaseQuery.js +4 -2
- package/lib/DatabaseReference.js +11 -6
- package/lib/DatabaseSyncTree.js +5 -3
- package/lib/DatabaseThenableReference.js +2 -1
- package/lib/modular/query.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,17 @@
|
|
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
|
+
## [23.1.1](https://github.com/invertase/react-native-firebase/compare/v23.1.0...v23.1.1) (2025-08-22)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @react-native-firebase/database
|
9
|
+
|
10
|
+
## [23.1.0](https://github.com/invertase/react-native-firebase/compare/v23.0.1...v23.1.0) (2025-08-19)
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
- **database:** offer more prescriptive advice for unimplemented off() method ([079b0e0](https://github.com/invertase/react-native-firebase/commit/079b0e0da2422e873bfa6e73add50d72e715ed59))
|
15
|
+
- **database:** wrap internal object construction in deprecation proxies ([67dad27](https://github.com/invertase/react-native-firebase/commit/67dad275f7239172fc0327dc4a2d40f046a2a2de))
|
16
|
+
|
6
17
|
## [23.0.1](https://github.com/invertase/react-native-firebase/compare/v23.0.0...v23.0.1) (2025-08-12)
|
7
18
|
|
8
19
|
**Note:** Version bump only for package @react-native-firebase/database
|
@@ -16,6 +16,7 @@
|
|
16
16
|
*/
|
17
17
|
|
18
18
|
import {
|
19
|
+
createDeprecationProxy,
|
19
20
|
isArray,
|
20
21
|
isFunction,
|
21
22
|
isObject,
|
@@ -75,13 +76,15 @@ export default class DatabaseDataSnapshot {
|
|
75
76
|
childPriority = childPriorityValue;
|
76
77
|
}
|
77
78
|
}
|
78
|
-
return
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
79
|
+
return createDeprecationProxy(
|
80
|
+
new DatabaseDataSnapshot(childRef, {
|
81
|
+
value,
|
82
|
+
key: childRef.key,
|
83
|
+
exists: value !== null,
|
84
|
+
childKeys: isObject(value) ? Object.keys(value) : [],
|
85
|
+
priority: childPriority,
|
86
|
+
}),
|
87
|
+
);
|
85
88
|
}
|
86
89
|
|
87
90
|
/**
|
package/lib/DatabaseQuery.js
CHANGED
@@ -390,9 +390,11 @@ export default class DatabaseQuery extends ReferenceBase {
|
|
390
390
|
|
391
391
|
// Child based events return a previousChildName
|
392
392
|
if (eventType === 'value') {
|
393
|
-
dataSnapshot = new DatabaseDataSnapshot(this.ref, result);
|
393
|
+
dataSnapshot = createDeprecationProxy(new DatabaseDataSnapshot(this.ref, result));
|
394
394
|
} else {
|
395
|
-
dataSnapshot =
|
395
|
+
dataSnapshot = createDeprecationProxy(
|
396
|
+
new DatabaseDataSnapshot(this.ref, result.snapshot),
|
397
|
+
);
|
396
398
|
previousChildName = result.previousChildName;
|
397
399
|
}
|
398
400
|
|
package/lib/DatabaseReference.js
CHANGED
@@ -29,6 +29,7 @@ import {
|
|
29
29
|
pathParent,
|
30
30
|
promiseWithOptionalCallback,
|
31
31
|
createDeprecationProxy,
|
32
|
+
MODULAR_DEPRECATION_ARG,
|
32
33
|
} from '@react-native-firebase/app/lib/common';
|
33
34
|
import DatabaseDataSnapshot from './DatabaseDataSnapshot';
|
34
35
|
import DatabaseOnDisconnect from './DatabaseOnDisconnect';
|
@@ -63,14 +64,14 @@ export default class DatabaseReference extends DatabaseQuery {
|
|
63
64
|
if (parentPath === null) {
|
64
65
|
return null;
|
65
66
|
}
|
66
|
-
return new DatabaseReference(this._database, parentPath);
|
67
|
+
return createDeprecationProxy(new DatabaseReference(this._database, parentPath));
|
67
68
|
}
|
68
69
|
|
69
70
|
/**
|
70
71
|
* @url https://firebase.google.com/docs/reference/js/firebase.database.Reference.html#root
|
71
72
|
*/
|
72
73
|
get root() {
|
73
|
-
return new DatabaseReference(this._database, '/');
|
74
|
+
return createDeprecationProxy(new DatabaseReference(this._database, '/'));
|
74
75
|
}
|
75
76
|
|
76
77
|
/**
|
@@ -81,7 +82,9 @@ export default class DatabaseReference extends DatabaseQuery {
|
|
81
82
|
if (!isString(path)) {
|
82
83
|
throw new Error("firebase.database().ref().child(*) 'path' must be a string value.");
|
83
84
|
}
|
84
|
-
return
|
85
|
+
return createDeprecationProxy(
|
86
|
+
new DatabaseReference(this._database, pathChild(this.path, path)),
|
87
|
+
);
|
85
88
|
}
|
86
89
|
|
87
90
|
/**
|
@@ -276,13 +279,15 @@ export default class DatabaseReference extends DatabaseQuery {
|
|
276
279
|
return new DatabaseThenableReference(
|
277
280
|
this._database,
|
278
281
|
pathChild(this.path, id),
|
279
|
-
Promise.resolve(this.child(id)),
|
282
|
+
Promise.resolve(this.child.call(this, id, MODULAR_DEPRECATION_ARG)),
|
280
283
|
);
|
281
284
|
}
|
282
285
|
|
283
|
-
const pushRef = this.child(id);
|
286
|
+
const pushRef = this.child.call(this, id, MODULAR_DEPRECATION_ARG);
|
284
287
|
|
285
|
-
const promise = pushRef.set
|
288
|
+
const promise = pushRef.set
|
289
|
+
.call(pushRef, value, onComplete, MODULAR_DEPRECATION_ARG)
|
290
|
+
.then(() => pushRef);
|
286
291
|
|
287
292
|
// Prevent unhandled promise rejection if onComplete is passed
|
288
293
|
if (onComplete) {
|
package/lib/DatabaseSyncTree.js
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
*
|
16
16
|
*/
|
17
17
|
|
18
|
-
import { isString } from '@react-native-firebase/app/lib/common';
|
18
|
+
import { createDeprecationProxy, isString } from '@react-native-firebase/app/lib/common';
|
19
19
|
import { getReactNativeModule } from '@react-native-firebase/app/lib/internal/nativeModule';
|
20
20
|
import NativeError from '@react-native-firebase/app/lib/internal/NativeFirebaseError';
|
21
21
|
import SharedEventEmitter from '@react-native-firebase/app/lib/internal/SharedEventEmitter';
|
@@ -119,9 +119,11 @@ class DatabaseSyncTree {
|
|
119
119
|
|
120
120
|
// Value events don't return a previousChildName
|
121
121
|
if (event.eventType === 'value') {
|
122
|
-
snapshot = new DatabaseDataSnapshot(registration.ref, event.data);
|
122
|
+
snapshot = createDeprecationProxy(new DatabaseDataSnapshot(registration.ref, event.data));
|
123
123
|
} else {
|
124
|
-
snapshot =
|
124
|
+
snapshot = createDeprecationProxy(
|
125
|
+
new DatabaseDataSnapshot(registration.ref, event.data.snapshot),
|
126
|
+
);
|
125
127
|
previousChildName = event.data.previousChildName;
|
126
128
|
}
|
127
129
|
|
@@ -15,6 +15,7 @@
|
|
15
15
|
*
|
16
16
|
*/
|
17
17
|
|
18
|
+
import { createDeprecationProxy } from '@react-native-firebase/app/lib/common';
|
18
19
|
// To avoid React Native require cycle warnings
|
19
20
|
let DatabaseReference = null;
|
20
21
|
export function provideReferenceClass(databaseReference) {
|
@@ -23,7 +24,7 @@ export function provideReferenceClass(databaseReference) {
|
|
23
24
|
|
24
25
|
export default class DatabaseThenableReference {
|
25
26
|
constructor(database, path, promise) {
|
26
|
-
this._ref = new DatabaseReference(database, path);
|
27
|
+
this._ref = createDeprecationProxy(new DatabaseReference(database, path));
|
27
28
|
this._promise = promise;
|
28
29
|
|
29
30
|
return new Proxy(this, {
|
package/lib/modular/query.js
CHANGED
@@ -249,7 +249,7 @@ export function get(query) {
|
|
249
249
|
}
|
250
250
|
|
251
251
|
export function off(_query, _eventType, _callback) {
|
252
|
-
throw new Error('off() is not implemented');
|
252
|
+
throw new Error('off() is not implemented - use unsubscriber callback returned when subscribing');
|
253
253
|
}
|
254
254
|
|
255
255
|
/**
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Generated by genversion.
|
2
|
-
module.exports = '23.
|
2
|
+
module.exports = '23.1.1';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/database",
|
3
|
-
"version": "23.
|
3
|
+
"version": "23.1.1",
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
5
5
|
"description": "React Native Firebase - The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. React Native Firebase provides native integration with the Android & iOS Firebase SDKs, supporting both realtime data sync and offline capabilities.",
|
6
6
|
"main": "lib/index.js",
|
@@ -25,11 +25,11 @@
|
|
25
25
|
"realtome database"
|
26
26
|
],
|
27
27
|
"peerDependencies": {
|
28
|
-
"@react-native-firebase/app": "23.
|
28
|
+
"@react-native-firebase/app": "23.1.1"
|
29
29
|
},
|
30
30
|
"publishConfig": {
|
31
31
|
"access": "public",
|
32
32
|
"provenance": true
|
33
33
|
},
|
34
|
-
"gitHead": "
|
34
|
+
"gitHead": "1cdb412427e0c909ede08f5fed5c6b512e9fb5d5"
|
35
35
|
}
|