@firebase/database-compat 0.3.0 → 0.3.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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @firebase/database-compat
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`d8af08feb`](https://github.com/firebase/firebase-js-sdk/commit/d8af08febfd4507a28bcda38d475b8010ef20f92), [`a4056634a`](https://github.com/firebase/firebase-js-sdk/commit/a4056634a5119dd3f2ca935cae23b90fc99d84ee), [`d4114a4f7`](https://github.com/firebase/firebase-js-sdk/commit/d4114a4f7da3f469c0c900416ac8beee58885ec3), [`06dc1364d`](https://github.com/firebase/firebase-js-sdk/commit/06dc1364d7560f4c563e1ccc89af9cad4cd91df8)]:
8
+ - @firebase/database@0.14.1
9
+ - @firebase/util@1.9.0
10
+ - @firebase/component@0.6.1
11
+ - @firebase/database-types@0.10.1
12
+
3
13
  ## 0.3.0
4
14
 
5
15
  ### Minor Changes
@@ -5,7 +5,7 @@ import { errorPrefix, validateArgCount, validateCallback, validateContextObject,
5
5
  import { Logger } from '@firebase/logger';
6
6
 
7
7
  const name = "@firebase/database-compat";
8
- const version = "0.3.0";
8
+ const version = "0.3.1-canary.27b5e7d70";
9
9
 
10
10
  /**
11
11
  * @license
@@ -6,7 +6,7 @@ import { __extends } from 'tslib';
6
6
  import { Logger } from '@firebase/logger';
7
7
 
8
8
  var name = "@firebase/database-compat";
9
- var version = "0.3.0";
9
+ var version = "0.3.1-canary.27b5e7d70";
10
10
 
11
11
  /**
12
12
  * @license
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
  var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
13
13
 
14
14
  var name = "@firebase/database-compat";
15
- var version = "0.3.0";
15
+ var version = "0.3.1-canary.27b5e7d70";
16
16
 
17
17
  /**
18
18
  * @license
@@ -4100,16 +4100,18 @@ var RepoInfo = /** @class */ (function () {
4100
4100
  * @param nodeAdmin - Whether this instance uses Admin SDK credentials
4101
4101
  * @param persistenceKey - Override the default session persistence storage key
4102
4102
  */
4103
- function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams) {
4103
+ function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams, isUsingEmulator) {
4104
4104
  if (nodeAdmin === void 0) { nodeAdmin = false; }
4105
4105
  if (persistenceKey === void 0) { persistenceKey = ''; }
4106
4106
  if (includeNamespaceInQueryParams === void 0) { includeNamespaceInQueryParams = false; }
4107
+ if (isUsingEmulator === void 0) { isUsingEmulator = false; }
4107
4108
  this.secure = secure;
4108
4109
  this.namespace = namespace;
4109
4110
  this.webSocketOnly = webSocketOnly;
4110
4111
  this.nodeAdmin = nodeAdmin;
4111
4112
  this.persistenceKey = persistenceKey;
4112
4113
  this.includeNamespaceInQueryParams = includeNamespaceInQueryParams;
4114
+ this.isUsingEmulator = isUsingEmulator;
4113
4115
  this._host = host.toLowerCase();
4114
4116
  this._domain = this._host.substr(this._host.indexOf('.') + 1);
4115
4117
  this.internalHost =
@@ -5351,8 +5353,8 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
5351
5353
  if (this.myIFrame) {
5352
5354
  //We have to actually remove all of the html inside this iframe before removing it from the
5353
5355
  //window, or IE will continue loading and executing the script tags we've already added, which
5354
- //can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this.
5355
- this.myIFrame.doc.body.innerHTML = '';
5356
+ //can lead to some errors being thrown. Setting textContent seems to be the safest way to do this.
5357
+ this.myIFrame.doc.body.textContent = '';
5356
5358
  setTimeout(function () {
5357
5359
  if (_this.myIFrame !== null) {
5358
5360
  document.body.removeChild(_this.myIFrame);
@@ -5914,7 +5916,12 @@ var Connection = /** @class */ (function () {
5914
5916
  if (MESSAGE_DATA in controlData) {
5915
5917
  var payload = controlData[MESSAGE_DATA];
5916
5918
  if (cmd === SERVER_HELLO) {
5917
- this.onHandshake_(payload);
5919
+ var handshakePayload = tslib.__assign({}, payload);
5920
+ if (this.repoInfo_.isUsingEmulator) {
5921
+ // 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.
5922
+ handshakePayload.h = this.repoInfo_.host;
5923
+ }
5924
+ this.onHandshake_(handshakePayload);
5918
5925
  }
5919
5926
  else if (cmd === END_TRANSMISSION) {
5920
5927
  this.log_('recvd end transmission on primary');
@@ -17269,7 +17276,8 @@ var useRestClient = false;
17269
17276
  */
17270
17277
  function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) {
17271
17278
  repo.repoInfo_ = new RepoInfo("".concat(host, ":").concat(port),
17272
- /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams);
17279
+ /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams,
17280
+ /*isUsingEmulator=*/ true);
17273
17281
  if (tokenProvider) {
17274
17282
  repo.authTokenProvider_ = tokenProvider;
17275
17283
  }