-
Notifications
You must be signed in to change notification settings - Fork 877
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix platform logging for exp packages (#4740)
- Loading branch information
Showing
20 changed files
with
310 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* @license | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { registerDatabase } from './register'; | ||
|
||
export { getDatabase, ServerValue } from '../src/exp/Database'; | ||
export { enableLogging } from '../src/core/util/util'; | ||
|
||
registerDatabase('node'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* @license | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { _registerComponent, registerVersion } from '@firebase/app-exp'; | ||
import { Component, ComponentType } from '@firebase/component'; | ||
|
||
import { name, version } from '../package.json'; | ||
import { FirebaseDatabase } from '../src/exp/Database'; | ||
|
||
export { getDatabase, ServerValue } from '../src/exp/Database'; | ||
export { enableLogging } from '../src/core/util/util'; | ||
|
||
declare module '@firebase/component' { | ||
interface NameServiceMapping { | ||
'database-exp': FirebaseDatabase; | ||
} | ||
} | ||
|
||
export function registerDatabase(variant?: string): void { | ||
_registerComponent( | ||
new Component( | ||
'database-exp', | ||
(container, { instanceIdentifier: url }) => { | ||
const app = container.getProvider('app-exp').getImmediate()!; | ||
const authProvider = container.getProvider('auth-internal'); | ||
return new FirebaseDatabase(app, authProvider, url); | ||
}, | ||
ComponentType.PUBLIC | ||
).setMultipleInstances(true) | ||
); | ||
registerVersion(name, version, variant); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
/** | ||
* @license | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
export { FieldPath, documentId } from '../src/exp/field_path'; | ||
|
||
export { | ||
FirebaseFirestore, | ||
initializeFirestore, | ||
getFirestore, | ||
enableIndexedDbPersistence, | ||
enableMultiTabIndexedDbPersistence, | ||
clearIndexedDbPersistence, | ||
waitForPendingWrites, | ||
disableNetwork, | ||
enableNetwork, | ||
terminate, | ||
useFirestoreEmulator, | ||
loadBundle, | ||
namedQuery, | ||
ensureFirestoreConfigured | ||
} from '../src/exp/database'; | ||
|
||
export { | ||
LoadBundleTask, | ||
LoadBundleTaskProgress, | ||
TaskState | ||
} from '../src/exp/bundle'; | ||
|
||
export { Settings, PersistenceSettings } from '../src/exp/settings'; | ||
|
||
export { | ||
DocumentChange, | ||
DocumentSnapshot, | ||
QueryDocumentSnapshot, | ||
QuerySnapshot, | ||
snapshotEqual, | ||
SnapshotOptions, | ||
FirestoreDataConverter, | ||
DocumentChangeType, | ||
SnapshotMetadata | ||
} from '../src/exp/snapshot'; | ||
|
||
export { | ||
DocumentReference, | ||
CollectionReference, | ||
Query, | ||
doc, | ||
collection, | ||
collectionGroup, | ||
SetOptions, | ||
DocumentData, | ||
UpdateData, | ||
refEqual, | ||
queryEqual | ||
} from '../src/exp/reference'; | ||
|
||
export { | ||
endAt, | ||
endBefore, | ||
startAt, | ||
startAfter, | ||
limit, | ||
limitToLast, | ||
where, | ||
orderBy, | ||
query, | ||
QueryConstraint, | ||
QueryConstraintType, | ||
OrderByDirection, | ||
WhereFilterOp | ||
} from '../src/exp/query'; | ||
|
||
export { Unsubscribe, SnapshotListenOptions } from '../src/exp/reference_impl'; | ||
|
||
export { runTransaction, Transaction } from '../src/exp/transaction'; | ||
|
||
export { | ||
getDoc, | ||
getDocFromCache, | ||
getDocFromServer, | ||
getDocs, | ||
getDocsFromCache, | ||
getDocsFromServer, | ||
onSnapshot, | ||
onSnapshotsInSync, | ||
setDoc, | ||
updateDoc, | ||
deleteDoc, | ||
addDoc, | ||
executeWrite | ||
} from '../src/exp/reference_impl'; | ||
|
||
export { FieldValue } from '../src/exp/field_value'; | ||
|
||
export { | ||
increment, | ||
arrayRemove, | ||
arrayUnion, | ||
serverTimestamp, | ||
deleteField | ||
} from '../src/exp/field_value_impl'; | ||
|
||
export { setLogLevel, LogLevelString as LogLevel } from '../src/util/log'; | ||
|
||
export { Bytes } from '../src/exp/bytes'; | ||
|
||
export { WriteBatch, writeBatch } from '../src/exp/write_batch'; | ||
|
||
export { GeoPoint } from '../src/exp/geo_point'; | ||
|
||
export { Timestamp } from '../src/exp/timestamp'; | ||
|
||
export { CACHE_SIZE_UNLIMITED } from '../src/exp/database'; | ||
|
||
export { FirestoreErrorCode, FirestoreError } from '../src/util/error'; | ||
|
||
export { AbstractUserDataWriter } from '../src/lite/user_data_writer'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @license | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { registerFirestore } from './register'; | ||
|
||
registerFirestore('node'); | ||
|
||
export * from './api'; |
Oops, something went wrong.