Skip to content

Commit aae9956

Browse files
committed
Merge branch 'master' into wuandy/ReleaseBundles
# Conflicts: # packages/firestore/rollup.shared.js
2 parents f8bb4d8 + 3754371 commit aae9956

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+826
-512
lines changed

.changeset/afraid-socks-shop.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/calm-shrimps-press.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/early-dots-peel.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/rich-birds-wink.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
'@firebase/firestore': minor
3+
---
4+
A write to a document that contains FieldValue transforms is no longer split up into two separate operations. This reduces the number of writes the backend performs and allows each WriteBatch to hold 500 writes regardless of how many FieldValue transformations are attached.

.changeset/thick-snails-appear.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@firebase/auth": minor
3+
"firebase": minor
4+
---
5+
6+
Add option to hide banner in auth when using the emulator

.changeset/wet-dolphins-play.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

integration/firebase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
88
},
99
"devDependencies": {
10-
"firebase": "8.1.1",
10+
"firebase": "8.1.2",
1111
"@types/chai": "4.2.14",
1212
"@types/mocha": "7.0.2",
1313
"chai": "4.2.0",

integration/firestore/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"devDependencies": {
1717
"@firebase/app": "0.6.13",
18-
"@firebase/firestore": "2.0.4",
18+
"@firebase/firestore": "2.0.5",
1919
"@types/mocha": "7.0.2",
2020
"gulp": "4.0.2",
2121
"gulp-filter": "6.0.0",

integration/messaging/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test:manual": "mocha --exit"
1010
},
1111
"devDependencies": {
12-
"firebase": "8.1.1",
12+
"firebase": "8.1.2",
1313
"chai": "4.2.0",
1414
"chromedriver": "86.0.0",
1515
"express": "4.17.1",

packages-exp/firebase-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@firebase/app-compat": "0.0.900",
4242
"@firebase/auth-exp": "0.0.900",
4343
"@firebase/functions-exp": "0.0.900",
44-
"@firebase/firestore": "2.0.4",
44+
"@firebase/firestore": "2.0.5",
4545
"@firebase/performance-exp": "0.0.900",
4646
"@firebase/remote-config-exp": "0.0.900"
4747
},

packages/auth/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @firebase/auth
22

3+
## 0.15.3
4+
5+
### Patch Changes
6+
7+
- [`11563b227`](https://github.com/firebase/firebase-js-sdk/commit/11563b227f30c9282c45e4a8128d5679954dcfd1) [#4146](https://github.com/firebase/firebase-js-sdk/pull/4146) - Fix issue with IndexedDB retry logic causing uncaught errors
8+
39
## 0.15.2
410

511
### Patch Changes

packages/auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/auth",
3-
"version": "0.15.2",
3+
"version": "0.15.3",
44
"main": "dist/auth.js",
55
"browser": "dist/auth.esm.js",
66
"module": "dist/auth.esm.js",

packages/auth/src/auth.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,9 @@ fireauth.Auth.prototype.useDeviceLanguage = function() {
295295
/**
296296
* Sets the emulator configuration (go/firebase-emulator-connection-api).
297297
* @param {string} url The url for the Auth emulator.
298+
* @param {?Object=} options Optional options to specify emulator settings.
298299
*/
299-
fireauth.Auth.prototype.useEmulator = function(url) {
300+
fireauth.Auth.prototype.useEmulator = function(url, options) {
300301
// Emulator config can only be set once.
301302
if (!this.emulatorConfig_) {
302303
if (!/^https?:\/\//.test(url)) {
@@ -305,7 +306,8 @@ fireauth.Auth.prototype.useEmulator = function(url) {
305306
'Emulator URL must start with a valid scheme (http:// or https://).');
306307
}
307308
// Emit a warning so dev knows we are now in test mode.
308-
this.emitEmulatorWarning_();
309+
const disableBanner = options ? !!options['disableWarnings'] : false;
310+
this.emitEmulatorWarning_(disableBanner);
309311
// Persist the config.
310312
this.emulatorConfig_ = { url };
311313
// Disable app verification.
@@ -319,14 +321,16 @@ fireauth.Auth.prototype.useEmulator = function(url) {
319321

320322

321323
/**
322-
* Emits a console warning and a visual banner if emulator integration is
324+
* Emits a console info and a visual banner if emulator integration is
323325
* enabled.
326+
* @param {boolean} disableBanner Whether visual banner should be disabled.
327+
* @private
324328
*/
325-
fireauth.Auth.prototype.emitEmulatorWarning_ = function() {
326-
fireauth.util.consoleWarn('WARNING: You are using the Auth Emulator,' +
329+
fireauth.Auth.prototype.emitEmulatorWarning_ = function(disableBanner) {
330+
fireauth.util.consoleInfo('WARNING: You are using the Auth Emulator,' +
327331
' which is intended for local testing only. Do not use with' +
328332
' production credentials.');
329-
if (goog.global.document) {
333+
if (goog.global.document && !disableBanner) {
330334
fireauth.util.onDomReady().then(() => {
331335
const ele = goog.global.document.createElement('div');
332336
ele.innerText = 'Running in emulator mode. Do not use with production' +

packages/auth/src/exports_auth.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ fireauth.exportlib.exportPrototypeMethods(
200200
useEmulator: {
201201
name: 'useEmulator',
202202
args: [
203-
fireauth.args.string('url')
203+
fireauth.args.string('url'),
204+
fireauth.args.object('options', true)
204205
]
205206
},
206207
verifyPasswordResetCode: {

packages/auth/src/utils.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2017 Google Inc.
3+
* Copyright 2017 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -1406,6 +1406,17 @@ fireauth.util.consoleWarn = function(message) {
14061406
};
14071407

14081408

1409+
/**
1410+
* Logs an info message to the console, if the console is available.
1411+
* @param {string} message
1412+
*/
1413+
fireauth.util.consoleInfo = function(message) {
1414+
if (typeof console !== 'undefined' && typeof console.info === 'function') {
1415+
console.info(message);
1416+
}
1417+
};
1418+
1419+
14091420
/**
14101421
* Parses a UTC time stamp string or number and returns the corresponding UTC
14111422
* date string if valid. Otherwise, returns null.

packages/auth/test/auth_test.js

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ function testUseEmulator() {
914914
goog.testing.recordFunction());
915915
stubs.replace(
916916
fireauth.util,
917-
'consoleWarn',
917+
'consoleInfo',
918918
goog.testing.recordFunction());
919919
var handler = goog.testing.recordFunction();
920920
stubs.replace(
@@ -935,7 +935,7 @@ function testUseEmulator() {
935935
assertEquals(0, handler.getCallCount());
936936
assertEquals(
937937
0, fireauth.RpcHandler.prototype.updateEmulatorConfig.getCallCount());
938-
assertEquals(0, fireauth.util.consoleWarn.getCallCount());
938+
assertEquals(0, fireauth.util.consoleInfo.getCallCount());
939939
assertEquals(
940940
0,
941941
fireauth.AuthSettings.prototype.setAppVerificationDisabledForTesting.
@@ -958,8 +958,17 @@ function testUseEmulator() {
958958
fireauth.RpcHandler.prototype.updateEmulatorConfig.getLastCall()
959959
.getArgument(0)
960960
);
961-
// Should emit a console warning.
962-
assertEquals(1, fireauth.util.consoleWarn.getCallCount());
961+
// Should emit a console warning and a banner.
962+
assertEquals(1, fireauth.util.consoleInfo.getCallCount());
963+
if (goog.global.document) {
964+
asyncTestCase.waitForSignals(1);
965+
fireauth.util.onDomReady().then(() => {
966+
const el =
967+
goog.global.document.querySelector('.firebase-emulator-warning');
968+
assertNotNull(el);
969+
asyncTestCase.signal();
970+
});
971+
}
963972
// Should disable App verification.
964973
assertEquals(
965974
true,
@@ -975,7 +984,7 @@ function testUseEmulator() {
975984
auth1.getEmulatorConfig());
976985
assertEquals(
977986
1, fireauth.RpcHandler.prototype.updateEmulatorConfig.getCallCount());
978-
assertEquals(1, fireauth.util.consoleWarn.getCallCount());
987+
assertEquals(1, fireauth.util.consoleInfo.getCallCount());
979988

980989
// Updating to different config should still not trigger event.
981990
auth1.useEmulator('http://emulator.other.domain:9876');
@@ -989,6 +998,58 @@ function testUseEmulator() {
989998
}
990999

9911000

1001+
function testUseEmulator_withDisableWarnings() {
1002+
// Listen to emulator config calls on RpcHandler.
1003+
stubs.replace(
1004+
fireauth.RpcHandler.prototype, 'updateEmulatorConfig',
1005+
goog.testing.recordFunction());
1006+
stubs.replace(fireauth.util, 'consoleInfo', goog.testing.recordFunction());
1007+
const handler = goog.testing.recordFunction();
1008+
1009+
app1 = firebase.initializeApp(config1, appId1);
1010+
auth1 = app1.auth();
1011+
1012+
// Listen to all emulatorConfigChange events dispatched by the Auth instance.
1013+
goog.events.listen(
1014+
auth1, fireauth.constants.AuthEventType.EMULATOR_CONFIG_CHANGED, handler);
1015+
1016+
assertUndefined(fireauth.constants.emulatorConfig);
1017+
assertEquals(0, handler.getCallCount());
1018+
assertEquals(
1019+
0, fireauth.RpcHandler.prototype.updateEmulatorConfig.getCallCount());
1020+
assertEquals(0, fireauth.util.consoleInfo.getCallCount());
1021+
1022+
// Update the emulator config.
1023+
auth1.useEmulator(
1024+
'http://emulator.test.domain:1234', {disableWarnings: true});
1025+
assertObjectEquals(
1026+
{
1027+
url: 'http://emulator.test.domain:1234',
1028+
},
1029+
auth1.getEmulatorConfig());
1030+
// Should notify the RPC handler.
1031+
assertEquals(
1032+
1, fireauth.RpcHandler.prototype.updateEmulatorConfig.getCallCount());
1033+
assertObjectEquals(
1034+
{
1035+
url: 'http://emulator.test.domain:1234',
1036+
},
1037+
fireauth.RpcHandler.prototype.updateEmulatorConfig.getLastCall()
1038+
.getArgument(0));
1039+
// Should emit a console info but not a banner.
1040+
assertEquals(1, fireauth.util.consoleInfo.getCallCount());
1041+
if (goog.global.document) {
1042+
asyncTestCase.waitForSignals(1);
1043+
fireauth.util.onDomReady().then(() => {
1044+
const el =
1045+
goog.global.document.querySelector('.firebase-emulator-warning');
1046+
assertNull(el);
1047+
asyncTestCase.signal();
1048+
});
1049+
}
1050+
}
1051+
1052+
9921053
function testGetSetTenantId() {
9931054
app1 = firebase.initializeApp(config1, appId1);
9941055
auth1 = app1.auth();

packages/auth/test/utils_test.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2017 Google Inc.
3+
* Copyright 2017 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -1791,8 +1791,8 @@ function testConsoleWarn() {
17911791
// those browsers.
17921792
return;
17931793
}
1794-
var consoleWarn = mockControl.createMethodMock(goog.global.console, 'warn');
1795-
var message = 'This is my message.';
1794+
const consoleWarn = mockControl.createMethodMock(goog.global.console, 'warn');
1795+
const message = 'This is my message.';
17961796
consoleWarn(message).$once();
17971797

17981798
mockControl.$replayAll();
@@ -1806,6 +1806,28 @@ function testConsoleWarn_doesntBreakIE() {
18061806
}
18071807

18081808

1809+
function testConsoleInfo() {
1810+
if (typeof console === 'undefined') {
1811+
// Ignore browsers that don't support console. The test
1812+
// testConsoleInfo_doesntBreakIE tests that this function doesn't break
1813+
// those browsers.
1814+
return;
1815+
}
1816+
const consoleInfo = mockControl.createMethodMock(goog.global.console, 'info');
1817+
const message = 'This is my message.';
1818+
consoleInfo(message).$once();
1819+
1820+
mockControl.$replayAll();
1821+
1822+
fireauth.util.consoleInfo(message);
1823+
}
1824+
1825+
1826+
function testConsoleInfo_doesntBreakIE() {
1827+
fireauth.util.consoleInfo('This should not trigger an error in IE.');
1828+
}
1829+
1830+
18091831
function testUtcTimestampToDateString() {
18101832
var actual;
18111833
// Null.

packages/firebase/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# firebase
22

3+
## 8.1.2
4+
5+
### Patch Changes
6+
7+
- [`11563b227`](https://github.com/firebase/firebase-js-sdk/commit/11563b227f30c9282c45e4a8128d5679954dcfd1) [#4146](https://github.com/firebase/firebase-js-sdk/pull/4146) - Fix issue with IndexedDB retry logic causing uncaught errors
8+
9+
- Updated dependencies [[`1849b0d0f`](https://github.com/firebase/firebase-js-sdk/commit/1849b0d0f0bbca56e50bea01979d20ada58040dc), [`8993f16b8`](https://github.com/firebase/firebase-js-sdk/commit/8993f16b81b4b386f2ac5195950235a6a43ed9bc), [`11563b227`](https://github.com/firebase/firebase-js-sdk/commit/11563b227f30c9282c45e4a8128d5679954dcfd1)]:
10+
- @firebase/firestore@2.0.5
11+
- @firebase/auth@0.15.3
12+
313
## 8.1.1
414

515
### Patch Changes

packages/firebase/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebase",
3-
"version": "8.1.1",
3+
"version": "8.1.2",
44
"description": "Firebase JavaScript library for web and Node.js",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"license": "Apache-2.0",
@@ -47,9 +47,9 @@
4747
"dependencies": {
4848
"@firebase/app": "0.6.13",
4949
"@firebase/app-types": "0.6.1",
50-
"@firebase/auth": "0.15.2",
50+
"@firebase/auth": "0.15.3",
5151
"@firebase/database": "0.8.1",
52-
"@firebase/firestore": "2.0.4",
52+
"@firebase/firestore": "2.0.5",
5353
"@firebase/functions": "0.6.1",
5454
"@firebase/installations": "0.4.19",
5555
"@firebase/messaging": "0.7.3",

packages/firestore/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @firebase/firestore
22

3+
## 2.0.5
4+
5+
### Patch Changes
6+
7+
- [`1849b0d0f`](https://github.com/firebase/firebase-js-sdk/commit/1849b0d0f0bbca56e50bea01979d20ada58040dc) [#4148](https://github.com/firebase/firebase-js-sdk/pull/4148) - Fixed a bug that prevented usage of FieldPaths with multiple special characters.
8+
9+
* [`8993f16b8`](https://github.com/firebase/firebase-js-sdk/commit/8993f16b81b4b386f2ac5195950235a6a43ed9bc) [#4136](https://github.com/firebase/firebase-js-sdk/pull/4136) (fixes [#4125](https://github.com/firebase/firebase-js-sdk/issues/4125)) - Fixes an issue that returned invalid `DocumentReference`s in `QuerySnapshot`s.
10+
311
## 2.0.4
412

513
### Patch Changes

0 commit comments

Comments
 (0)