Skip to content

Commit 401e974

Browse files
Merge
2 parents 0778cf7 + e9fed6d commit 401e974

38 files changed

+231
-223
lines changed

integration/browserify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "karma start --single-run"
88
},
99
"dependencies": {
10-
"firebase": "7.12.0"
10+
"firebase": "7.13.0"
1111
},
1212
"devDependencies": {
1313
"@babel/core": "7.8.7",

integration/firebase-typings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "tsc"
77
},
88
"dependencies": {
9-
"firebase": "7.12.0"
9+
"firebase": "7.13.0"
1010
},
1111
"devDependencies": {
1212
"typescript": "3.8.3"

integration/messaging/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test:manual": "mocha --exit"
99
},
1010
"dependencies": {
11-
"firebase": "7.12.0"
11+
"firebase": "7.13.0"
1212
},
1313
"devDependencies": {
1414
"chai": "4.2.0",

integration/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "karma start --single-run"
77
},
88
"dependencies": {
9-
"firebase": "7.12.0"
9+
"firebase": "7.13.0"
1010
},
1111
"devDependencies": {
1212
"@babel/core": "7.8.7",

integration/webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "karma start --single-run"
88
},
99
"dependencies": {
10-
"firebase": "7.12.0"
10+
"firebase": "7.13.0"
1111
},
1212
"devDependencies": {
1313
"@babel/core": "7.8.7",

packages/analytics-types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/analytics-types",
3-
"version": "0.2.8",
3+
"version": "0.3.0",
44
"description": "@firebase/analytics Types",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"license": "Apache-2.0",

packages/analytics/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/analytics",
3-
"version": "0.2.18",
3+
"version": "0.3.0",
44
"description": "A analytics package for new firebase packages",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"main": "dist/index.cjs.js",
@@ -25,7 +25,7 @@
2525
"@firebase/app-types": "0.x"
2626
},
2727
"dependencies": {
28-
"@firebase/analytics-types": "0.2.8",
28+
"@firebase/analytics-types": "0.3.0",
2929
"@firebase/installations": "0.4.6",
3030
"@firebase/logger": "0.2.0",
3131
"@firebase/util": "0.2.43",

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": "7.12.0",
3+
"version": "7.13.0",
44
"description": "Firebase JavaScript library for web and Node.js",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"license": "Apache-2.0",
@@ -43,15 +43,15 @@
4343
"@firebase/app-types": "0.6.0",
4444
"@firebase/auth": "0.14.1",
4545
"@firebase/database": "0.5.24",
46-
"@firebase/firestore": "1.12.2",
46+
"@firebase/firestore": "1.13.0",
4747
"@firebase/functions": "0.4.38",
4848
"@firebase/installations": "0.4.6",
4949
"@firebase/messaging": "0.6.10",
5050
"@firebase/polyfill": "0.3.33",
5151
"@firebase/storage": "0.3.30",
5252
"@firebase/performance": "0.2.36",
5353
"@firebase/remote-config": "0.1.17",
54-
"@firebase/analytics": "0.2.18",
54+
"@firebase/analytics": "0.3.0",
5555
"@firebase/util": "0.2.43"
5656
},
5757
"devDependencies": {

packages/firestore/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/firestore",
3-
"version": "1.12.2",
3+
"version": "1.13.0",
44
"description": "The Cloud Firestore component of the Firebase JS SDK.",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"scripts": {

packages/firestore/src/api/database.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ import {
6868
validateStringEnum,
6969
valueDescription
7070
} from '../util/input_validation';
71-
// eslint-disable-next-line import/no-duplicates
72-
import * as log from '../util/log';
73-
// eslint-disable-next-line import/no-duplicates
74-
import { LogLevel } from '../util/log';
71+
import { logError, setLogLevel, LogLevel, getLogLevel } from '../util/log';
7572
import { AutoId } from '../util/misc';
7673
import { Deferred, Rejecter, Resolver } from '../util/promise';
7774
import { FieldPath as ExternalFieldPath } from './field_path';
@@ -197,13 +194,13 @@ class FirestoreSettings {
197194
// Nobody should set timestampsInSnapshots anymore, but the error depends on
198195
// whether they set it to true or false...
199196
if (settings.timestampsInSnapshots === true) {
200-
log.error(`
197+
logError(`
201198
The timestampsInSnapshots setting now defaults to true and you no
202199
longer need to explicitly set it. In a future release, the setting
203200
will be removed entirely and so it is recommended that you remove it
204201
from your firestore.settings() call now.`);
205202
} else if (settings.timestampsInSnapshots === false) {
206-
log.error(`
203+
logError(`
207204
The timestampsInSnapshots setting will soon be removed. YOU MUST UPDATE
208205
YOUR CODE.
209206
@@ -389,7 +386,7 @@ export class Firestore implements firestore.FirebaseFirestore, FirebaseService {
389386

390387
if (settings) {
391388
if (settings.experimentalTabSynchronization !== undefined) {
392-
log.error(
389+
logError(
393390
"The 'experimentalTabSynchronization' setting has been renamed to " +
394391
"'synchronizeTabs'. In a future release, the setting will be removed " +
395392
'and it is recommended that you update your ' +
@@ -646,15 +643,14 @@ export class Firestore implements firestore.FirebaseFirestore, FirebaseService {
646643
}
647644

648645
static get logLevel(): firestore.LogLevel {
649-
switch (log.getLogLevel()) {
646+
switch (getLogLevel()) {
650647
case LogLevel.DEBUG:
651648
return 'debug';
652-
case LogLevel.ERROR:
653-
return 'error';
654649
case LogLevel.SILENT:
655650
return 'silent';
656651
default:
657-
return fail('Unknown log level: ' + log.getLogLevel());
652+
// The default log level is error
653+
return 'error';
658654
}
659655
}
660656

@@ -663,13 +659,13 @@ export class Firestore implements firestore.FirebaseFirestore, FirebaseService {
663659
validateArgType('Firestore.setLogLevel', 'non-empty string', 1, level);
664660
switch (level) {
665661
case 'debug':
666-
log.setLogLevel(log.LogLevel.DEBUG);
662+
setLogLevel(LogLevel.DEBUG);
667663
break;
668664
case 'error':
669-
log.setLogLevel(log.LogLevel.ERROR);
665+
setLogLevel(LogLevel.ERROR);
670666
break;
671667
case 'silent':
672-
log.setLogLevel(log.LogLevel.SILENT);
668+
setLogLevel(LogLevel.SILENT);
673669
break;
674670
default:
675671
throw new FirestoreError(

packages/firestore/src/api/user_data_writer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import * as firestore from '@firebase/firestore-types';
1919

2020
import * as api from '../protos/firestore_proto_api';
21-
import * as log from '../util/log';
2221

2322
import { DocumentReference, Firestore } from './database';
2423
import { Blob } from './blob';
@@ -41,6 +40,7 @@ import { forEach } from '../util/obj';
4140
import { TypeOrder } from '../model/field_value';
4241
import { ResourcePath } from '../model/path';
4342
import { isValidResourceName } from '../remote/serializer';
43+
import { logError } from '../util/log';
4444

4545
export type ServerTimestampBehavior = 'estimate' | 'previous' | 'none';
4646

@@ -139,7 +139,7 @@ export class UserDataWriter<T = firestore.DocumentData> {
139139

140140
if (!databaseId.isEqual(this.firestore._databaseId)) {
141141
// TODO(b/64130202): Somehow support foreign references.
142-
log.error(
142+
logError(
143143
`Document ${key} contains a document ` +
144144
`reference within a different database (` +
145145
`${databaseId.projectId}/${databaseId.database}) which is not ` +

packages/firestore/src/core/firestore_client.ts

Lines changed: 4 additions & 4 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.
@@ -33,7 +33,7 @@ import { Datastore } from '../remote/datastore';
3333
import { RemoteStore } from '../remote/remote_store';
3434
import { AsyncQueue } from '../util/async_queue';
3535
import { Code, FirestoreError } from '../util/error';
36-
import { debug } from '../util/log';
36+
import { logDebug } from '../util/log';
3737
import { Deferred } from '../util/promise';
3838
import {
3939
EventManager,
@@ -324,7 +324,7 @@ export class FirestoreClient {
324324
* implementation is available in this.persistence.
325325
*/
326326
private initializeRest(user: User): Promise<void> {
327-
debug(LOG_TAG, 'Initializing. user=', user.uid);
327+
logDebug(LOG_TAG, 'Initializing. user=', user.uid);
328328
return this.platform
329329
.loadConnection(this.databaseInfo)
330330
.then(async connection => {
@@ -406,7 +406,7 @@ export class FirestoreClient {
406406
private handleCredentialChange(user: User): Promise<void> {
407407
this.asyncQueue.verifyOperationInProgress();
408408

409-
debug(LOG_TAG, 'Credential Changed. Current user: ' + user.uid);
409+
logDebug(LOG_TAG, 'Credential Changed. Current user: ' + user.uid);
410410
return this.syncEngine.handleCredentialChange(user);
411411
}
412412

packages/firestore/src/core/sync_engine.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { RemoteStore } from '../remote/remote_store';
3434
import { RemoteSyncer } from '../remote/remote_syncer';
3535
import { assert, fail } from '../util/assert';
3636
import { Code, FirestoreError } from '../util/error';
37-
import * as log from '../util/log';
37+
import { logDebug } from '../util/log';
3838
import { primitiveComparator } from '../util/misc';
3939
import { ObjectMap } from '../util/obj_map';
4040
import { Deferred } from '../util/promise';
@@ -534,7 +534,7 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
534534
// had, we would have cached the affected documents), and so we will just
535535
// see any resulting document changes via normal remote document updates
536536
// as applicable.
537-
log.debug(LOG_TAG, 'Cannot apply mutation batch with id: ' + batchId);
537+
logDebug(LOG_TAG, 'Cannot apply mutation batch with id: ' + batchId);
538538
return;
539539
}
540540

@@ -610,7 +610,7 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
610610
*/
611611
async registerPendingWritesCallback(callback: Deferred<void>): Promise<void> {
612612
if (!this.remoteStore.canUseNetwork()) {
613-
log.debug(
613+
logDebug(
614614
LOG_TAG,
615615
'The network is disabled. The task returned by ' +
616616
"'awaitPendingWrites()' will not complete until the network is enabled."
@@ -750,7 +750,7 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
750750
this.limboDocumentRefs.addReference(limboChange.key, targetId);
751751
this.trackLimboChange(limboChange);
752752
} else if (limboChange instanceof RemovedLimboDocument) {
753-
log.debug(LOG_TAG, 'Document no longer in limbo: ' + limboChange.key);
753+
logDebug(LOG_TAG, 'Document no longer in limbo: ' + limboChange.key);
754754
this.limboDocumentRefs.removeReference(limboChange.key, targetId);
755755
const isReferenced = this.limboDocumentRefs.containsKey(
756756
limboChange.key
@@ -768,7 +768,7 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
768768
private trackLimboChange(limboChange: AddedLimboDocument): void {
769769
const key = limboChange.key;
770770
if (!this.limboTargetsByKey.get(key)) {
771-
log.debug(LOG_TAG, 'New document in limbo: ' + key);
771+
logDebug(LOG_TAG, 'New document in limbo: ' + key);
772772
const limboTargetId = this.limboTargetIdGenerator.next();
773773
const query = Query.atPath(key.path);
774774
this.limboResolutionsByTarget.set(
@@ -1049,7 +1049,7 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
10491049
if (this.isPrimary) {
10501050
// If we receive a target state notification via WebStorage, we are
10511051
// either already secondary or another tab has taken the primary lease.
1052-
log.debug(LOG_TAG, 'Ignoring unexpected query state notification.');
1052+
logDebug(LOG_TAG, 'Ignoring unexpected query state notification.');
10531053
return;
10541054
}
10551055

packages/firestore/src/local/index_free_query_engine.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2019 Google Inc.
3+
* Copyright 2019 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.
@@ -19,7 +19,7 @@ import { QueryEngine } from './query_engine';
1919
import { LocalDocumentsView } from './local_documents_view';
2020
import { PersistenceTransaction } from './persistence';
2121
import { PersistencePromise } from './persistence_promise';
22-
import { Query, LimitType } from '../core/query';
22+
import { LimitType, Query } from '../core/query';
2323
import { SnapshotVersion } from '../core/snapshot_version';
2424
import {
2525
DocumentKeySet,
@@ -28,7 +28,7 @@ import {
2828
} from '../model/collections';
2929
import { Document } from '../model/document';
3030
import { assert } from '../util/assert';
31-
import { debug, getLogLevel, LogLevel } from '../util/log';
31+
import { getLogLevel, LogLevel, logDebug } from '../util/log';
3232
import { SortedSet } from '../util/sorted_set';
3333

3434
// TOOD(b/140938512): Drop SimpleQueryEngine and rename IndexFreeQueryEngine.
@@ -99,7 +99,7 @@ export class IndexFreeQueryEngine implements QueryEngine {
9999
}
100100

101101
if (getLogLevel() <= LogLevel.DEBUG) {
102-
debug(
102+
logDebug(
103103
'IndexFreeQueryEngine',
104104
'Re-using previous result from %s to execute query: %s',
105105
lastLimboFreeSnapshotVersion.toString(),
@@ -194,7 +194,7 @@ export class IndexFreeQueryEngine implements QueryEngine {
194194
query: Query
195195
): PersistencePromise<DocumentMap> {
196196
if (getLogLevel() <= LogLevel.DEBUG) {
197-
debug(
197+
logDebug(
198198
'IndexFreeQueryEngine',
199199
'Using full collection scan to execute query: %s',
200200
query.toString()

0 commit comments

Comments
 (0)