@firebase/database 0.12.8 → 0.13.0-20220505222723
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 +12 -0
- package/dist/index.esm2017.js +34 -4
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +37 -3
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +37 -1
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.standalone.js +36 -0
- package/dist/index.standalone.js.map +1 -1
- package/dist/internal.d.ts +10 -0
- package/dist/node-esm/index.node.esm.js +34 -4
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/api/Database.d.ts +8 -0
- package/dist/node-esm/src/api.standalone.d.ts +1 -1
- package/dist/node-esm/src/realtime/BrowserPollConnection.d.ts +2 -2
- package/dist/node-esm/src/realtime/TransportManager.d.ts +6 -0
- package/dist/node-esm/test/transport.test.d.ts +17 -0
- package/dist/private.d.ts +10 -0
- package/dist/public.d.ts +8 -0
- package/dist/src/api/Database.d.ts +8 -0
- package/dist/src/api.standalone.d.ts +1 -1
- package/dist/src/realtime/BrowserPollConnection.d.ts +2 -2
- package/dist/src/realtime/TransportManager.d.ts +6 -0
- package/dist/test/transport.test.d.ts +17 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Unreleased
|
|
2
2
|
|
|
3
|
+
## 0.13.0-20220505222723
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`9c6808fea`](https://github.com/firebase/firebase-js-sdk/commit/9c6808fea231d1ab6de6f6ab548c67b751a12a78) [#6171](https://github.com/firebase/firebase-js-sdk/pull/6171) - Add `forceWebSockets()` and `forceLongPolling()`
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`9c5c9c36d`](https://github.com/firebase/firebase-js-sdk/commit/9c5c9c36da80b98b73cfd60ef2e2965087e9f801)]:
|
|
12
|
+
- @firebase/util@1.6.0-20220505222723
|
|
13
|
+
- @firebase/component@0.5.14-20220505222723
|
|
14
|
+
|
|
3
15
|
## 0.12.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.esm2017.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getApp, _getProvider, SDK_VERSION as SDK_VERSION$1, _registerComponent, registerVersion } from '@firebase/app';
|
|
2
2
|
import { Component } from '@firebase/component';
|
|
3
|
-
import { stringify, jsonEval, contains, assert, base64, stringToByteArray, Sha1,
|
|
3
|
+
import { stringify, jsonEval, contains, assert, isNodeSdk, base64, stringToByteArray, Sha1, deepCopy, base64Encode, isMobileCordova, stringLength, Deferred, safeGet, isAdmin, isValidFormat, isEmpty, isReactNative, assertionError, map, querystring, errorPrefix, getModularInstance, createMockUserToken } from '@firebase/util';
|
|
4
4
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
5
5
|
|
|
6
6
|
const name = "@firebase/database";
|
|
7
|
-
const version = "0.
|
|
7
|
+
const version = "0.13.0-20220505222723";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
@@ -2137,6 +2137,13 @@ class TransportManager {
|
|
|
2137
2137
|
static get ALL_TRANSPORTS() {
|
|
2138
2138
|
return [BrowserPollConnection, WebSocketConnection];
|
|
2139
2139
|
}
|
|
2140
|
+
/**
|
|
2141
|
+
* Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after
|
|
2142
|
+
* TransportManager has already set up transports_
|
|
2143
|
+
*/
|
|
2144
|
+
static get IS_TRANSPORT_INITIALIZED() {
|
|
2145
|
+
return this.globalTransportInitialized_;
|
|
2146
|
+
}
|
|
2140
2147
|
initTransports_(repoInfo) {
|
|
2141
2148
|
const isWebSocketsAvailable = WebSocketConnection && WebSocketConnection['isAvailable']();
|
|
2142
2149
|
let isSkipPollConnection = isWebSocketsAvailable && !WebSocketConnection.previouslyFailed();
|
|
@@ -2156,6 +2163,7 @@ class TransportManager {
|
|
|
2156
2163
|
transports.push(transport);
|
|
2157
2164
|
}
|
|
2158
2165
|
}
|
|
2166
|
+
TransportManager.globalTransportInitialized_ = true;
|
|
2159
2167
|
}
|
|
2160
2168
|
}
|
|
2161
2169
|
/**
|
|
@@ -2180,7 +2188,9 @@ class TransportManager {
|
|
|
2180
2188
|
return null;
|
|
2181
2189
|
}
|
|
2182
2190
|
}
|
|
2183
|
-
}
|
|
2191
|
+
}
|
|
2192
|
+
// Keeps track of whether the TransportManager has already chosen a transport to use
|
|
2193
|
+
TransportManager.globalTransportInitialized_ = false;
|
|
2184
2194
|
|
|
2185
2195
|
/**
|
|
2186
2196
|
* @license
|
|
@@ -13640,6 +13650,26 @@ class Database {
|
|
|
13640
13650
|
}
|
|
13641
13651
|
}
|
|
13642
13652
|
}
|
|
13653
|
+
function checkTransportInit() {
|
|
13654
|
+
if (TransportManager.IS_TRANSPORT_INITIALIZED) {
|
|
13655
|
+
warn('Transport has already been initialized. Please call this function before calling ref or setting up a listener');
|
|
13656
|
+
}
|
|
13657
|
+
}
|
|
13658
|
+
/**
|
|
13659
|
+
* Force the use of websockets instead of longPolling.
|
|
13660
|
+
*/
|
|
13661
|
+
function forceWebSockets() {
|
|
13662
|
+
checkTransportInit();
|
|
13663
|
+
BrowserPollConnection.forceDisallow();
|
|
13664
|
+
}
|
|
13665
|
+
/**
|
|
13666
|
+
* Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL.
|
|
13667
|
+
*/
|
|
13668
|
+
function forceLongPolling() {
|
|
13669
|
+
checkTransportInit();
|
|
13670
|
+
WebSocketConnection.forceDisallow();
|
|
13671
|
+
BrowserPollConnection.forceAllow();
|
|
13672
|
+
}
|
|
13643
13673
|
/**
|
|
13644
13674
|
* Returns the instance of the Realtime Database SDK that is associated
|
|
13645
13675
|
* with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with
|
|
@@ -13964,5 +13994,5 @@ const forceRestClient = function (forceRestClient) {
|
|
|
13964
13994
|
*/
|
|
13965
13995
|
registerDatabase();
|
|
13966
13996
|
|
|
13967
|
-
export { DataSnapshot, Database, OnDisconnect, QueryConstraint, TransactionResult, QueryImpl as _QueryImpl, QueryParams as _QueryParams, ReferenceImpl as _ReferenceImpl, forceRestClient as _TEST_ACCESS_forceRestClient, hijackHash as _TEST_ACCESS_hijackHash, repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp, setSDKVersion as _setSDKVersion, validatePathString as _validatePathString, validateWritablePath as _validateWritablePath, child, connectDatabaseEmulator, enableLogging, endAt, endBefore, equalTo, get, getDatabase, goOffline, goOnline, increment, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, runTransaction, serverTimestamp, set, setPriority, setWithPriority, startAfter, startAt, update };
|
|
13997
|
+
export { DataSnapshot, Database, OnDisconnect, QueryConstraint, TransactionResult, QueryImpl as _QueryImpl, QueryParams as _QueryParams, ReferenceImpl as _ReferenceImpl, forceRestClient as _TEST_ACCESS_forceRestClient, hijackHash as _TEST_ACCESS_hijackHash, repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp, setSDKVersion as _setSDKVersion, validatePathString as _validatePathString, validateWritablePath as _validateWritablePath, child, connectDatabaseEmulator, enableLogging, endAt, endBefore, equalTo, forceLongPolling, forceWebSockets, get, getDatabase, goOffline, goOnline, increment, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, runTransaction, serverTimestamp, set, setPriority, setWithPriority, startAfter, startAt, update };
|
|
13968
13998
|
//# sourceMappingURL=index.esm2017.js.map
|