@firebase/database 0.14.0 → 0.14.1-canary.27b5e7d70
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 +13 -0
- package/dist/index.esm2017.js +18 -9
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +20 -10
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +19 -9
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.standalone.js +13 -5
- package/dist/index.standalone.js.map +1 -1
- package/dist/internal.d.ts +2 -1
- package/dist/node-esm/index.node.esm.js +18 -9
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/core/RepoInfo.d.ts +2 -1
- package/dist/private.d.ts +2 -1
- package/dist/src/core/RepoInfo.d.ts +2 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Unreleased
|
|
2
2
|
|
|
3
|
+
## 0.14.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d8af08feb`](https://github.com/firebase/firebase-js-sdk/commit/d8af08febfd4507a28bcda38d475b8010ef20f92) [#6883](https://github.com/firebase/firebase-js-sdk/pull/6883) (fixes [#6853](https://github.com/firebase/firebase-js-sdk/issues/6853)) - Fixed issue where connectDatabaseToEmulator can be called twice during a hot reload
|
|
8
|
+
|
|
9
|
+
- [`a4056634a`](https://github.com/firebase/firebase-js-sdk/commit/a4056634a5119dd3f2ca935cae23b90fc99d84ee) [#6916](https://github.com/firebase/firebase-js-sdk/pull/6916) - Replace `innerHTML` call with `textContent`.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`e9bcd4c43`](https://github.com/firebase/firebase-js-sdk/commit/e9bcd4c43a0628ebce570f03f1e91dfa93fffca2), [`d4114a4f7`](https://github.com/firebase/firebase-js-sdk/commit/d4114a4f7da3f469c0c900416ac8beee58885ec3), [`06dc1364d`](https://github.com/firebase/firebase-js-sdk/commit/06dc1364d7560f4c563e1ccc89af9cad4cd91df8)]:
|
|
12
|
+
- @firebase/auth-interop-types@0.2.1
|
|
13
|
+
- @firebase/util@1.9.0
|
|
14
|
+
- @firebase/component@0.6.1
|
|
15
|
+
|
|
3
16
|
## 0.14.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/dist/index.esm2017.js
CHANGED
|
@@ -4,7 +4,7 @@ import { stringify, jsonEval, contains, assert, isNodeSdk, stringToByteArray, Sh
|
|
|
4
4
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
5
5
|
|
|
6
6
|
const name = "@firebase/database";
|
|
7
|
-
const version = "0.14.
|
|
7
|
+
const version = "0.14.1-canary.27b5e7d70";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
@@ -929,13 +929,14 @@ class RepoInfo {
|
|
|
929
929
|
* @param nodeAdmin - Whether this instance uses Admin SDK credentials
|
|
930
930
|
* @param persistenceKey - Override the default session persistence storage key
|
|
931
931
|
*/
|
|
932
|
-
constructor(host, secure, namespace, webSocketOnly, nodeAdmin = false, persistenceKey = '', includeNamespaceInQueryParams = false) {
|
|
932
|
+
constructor(host, secure, namespace, webSocketOnly, nodeAdmin = false, persistenceKey = '', includeNamespaceInQueryParams = false, isUsingEmulator = false) {
|
|
933
933
|
this.secure = secure;
|
|
934
934
|
this.namespace = namespace;
|
|
935
935
|
this.webSocketOnly = webSocketOnly;
|
|
936
936
|
this.nodeAdmin = nodeAdmin;
|
|
937
937
|
this.persistenceKey = persistenceKey;
|
|
938
938
|
this.includeNamespaceInQueryParams = includeNamespaceInQueryParams;
|
|
939
|
+
this.isUsingEmulator = isUsingEmulator;
|
|
939
940
|
this._host = host.toLowerCase();
|
|
940
941
|
this._domain = this._host.substr(this._host.indexOf('.') + 1);
|
|
941
942
|
this.internalHost =
|
|
@@ -1580,8 +1581,8 @@ class FirebaseIFrameScriptHolder {
|
|
|
1580
1581
|
if (this.myIFrame) {
|
|
1581
1582
|
//We have to actually remove all of the html inside this iframe before removing it from the
|
|
1582
1583
|
//window, or IE will continue loading and executing the script tags we've already added, which
|
|
1583
|
-
//can lead to some errors being thrown. Setting
|
|
1584
|
-
this.myIFrame.doc.body.
|
|
1584
|
+
//can lead to some errors being thrown. Setting textContent seems to be the safest way to do this.
|
|
1585
|
+
this.myIFrame.doc.body.textContent = '';
|
|
1585
1586
|
setTimeout(() => {
|
|
1586
1587
|
if (this.myIFrame !== null) {
|
|
1587
1588
|
document.body.removeChild(this.myIFrame);
|
|
@@ -2465,7 +2466,12 @@ class Connection {
|
|
|
2465
2466
|
if (MESSAGE_DATA in controlData) {
|
|
2466
2467
|
const payload = controlData[MESSAGE_DATA];
|
|
2467
2468
|
if (cmd === SERVER_HELLO) {
|
|
2468
|
-
|
|
2469
|
+
const handshakePayload = Object.assign({}, payload);
|
|
2470
|
+
if (this.repoInfo_.isUsingEmulator) {
|
|
2471
|
+
// Upon connecting, the emulator will pass the hostname that it's aware of, but we prefer the user's set hostname via `connectDatabaseEmulator` over what the emulator passes.
|
|
2472
|
+
handshakePayload.h = this.repoInfo_.host;
|
|
2473
|
+
}
|
|
2474
|
+
this.onHandshake_(handshakePayload);
|
|
2469
2475
|
}
|
|
2470
2476
|
else if (cmd === END_TRANSMISSION) {
|
|
2471
2477
|
this.log_('recvd end transmission on primary');
|
|
@@ -13453,7 +13459,8 @@ let useRestClient = false;
|
|
|
13453
13459
|
*/
|
|
13454
13460
|
function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) {
|
|
13455
13461
|
repo.repoInfo_ = new RepoInfo(`${host}:${port}`,
|
|
13456
|
-
/* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams
|
|
13462
|
+
/* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams,
|
|
13463
|
+
/*isUsingEmulator=*/ true);
|
|
13457
13464
|
if (tokenProvider) {
|
|
13458
13465
|
repo.authTokenProvider_ = tokenProvider;
|
|
13459
13466
|
}
|
|
@@ -13617,9 +13624,11 @@ function getDatabase(app = getApp(), url) {
|
|
|
13617
13624
|
const db = _getProvider(app, 'database').getImmediate({
|
|
13618
13625
|
identifier: url
|
|
13619
13626
|
});
|
|
13620
|
-
|
|
13621
|
-
|
|
13622
|
-
|
|
13627
|
+
if (!db._instanceStarted) {
|
|
13628
|
+
const emulator = getDefaultEmulatorHostnameAndPort('database');
|
|
13629
|
+
if (emulator) {
|
|
13630
|
+
connectDatabaseEmulator(db, ...emulator);
|
|
13631
|
+
}
|
|
13623
13632
|
}
|
|
13624
13633
|
return db;
|
|
13625
13634
|
}
|