Skip to content

Commit

Permalink
Merge 4754c25 into 919413c
Browse files Browse the repository at this point in the history
  • Loading branch information
Feiyang1 authored Apr 28, 2021
2 parents 919413c + 4754c25 commit 94ffdd8
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 8 deletions.
8 changes: 7 additions & 1 deletion packages/database/exp/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
*/

// eslint-disable-next-line import/no-extraneous-dependencies
import { _registerComponent, registerVersion } from '@firebase/app-exp';
import {
_registerComponent,
registerVersion,
SDK_VERSION
} from '@firebase/app-exp';
import { Component, ComponentType } from '@firebase/component';

import { name, version } from '../package.json';
import { setSDKVersion } from '../src/core/version';
import {
FirebaseDatabase,
repoManagerDatabaseFromApp
Expand All @@ -32,6 +37,7 @@ declare module '@firebase/component' {
}

export function registerDatabase(variant?: string): void {
setSDKVersion(SDK_VERSION);
_registerComponent(
new Component(
'database-exp',
Expand Down
2 changes: 2 additions & 0 deletions packages/firestore/compat/index.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import firebase from '@firebase/app-compat';
import { FirebaseNamespace } from '@firebase/app-types';

import { Firestore, IndexedDbPersistenceProvider } from '../src/api/database';
import { setSDKVersion } from '../src/core/version';

import { registerBundle } from './bundle';
import { configureForFirebase } from './config';
Expand All @@ -30,6 +31,7 @@ import { name, version } from './package.json';
* Persistence can be enabled via `firebase.firestore().enablePersistence()`.
*/
export function registerFirestore(instance: FirebaseNamespace): void {
setSDKVersion(instance.SDK_VERSION);
configureForFirebase(
instance,
(app, firestoreExp) =>
Expand Down
3 changes: 2 additions & 1 deletion packages/firestore/compat/index.rn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ import firebase from '@firebase/app-compat';
import { FirebaseNamespace } from '@firebase/app-types';

import { Firestore, IndexedDbPersistenceProvider } from '../src/api/database';
import { setSDKVersion } from '../src/core/version';

import { registerBundle } from './bundle';
import { configureForFirebase } from './config';
import { name, version } from './package.json';

/**
* Registers the main Firestore ReactNative build with the components framework.
* Persistence can be enabled via `firebase.firestore().enablePersistence()`.
*/
export function registerFirestore(instance: FirebaseNamespace): void {
setSDKVersion(instance.SDK_VERSION);
configureForFirebase(
instance,
(app, firestoreExp) =>
Expand Down
2 changes: 2 additions & 0 deletions packages/firestore/compat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { FirebaseNamespace } from '@firebase/app-types';
import * as types from '@firebase/firestore-types';

import { Firestore, IndexedDbPersistenceProvider } from '../src/api/database';
import { setSDKVersion } from '../src/core/version';

import { registerBundle } from './bundle';
import { configureForFirebase } from './config';
Expand All @@ -33,6 +34,7 @@ import '../register-module';
* Persistence can be enabled via `firebase.firestore().enablePersistence()`.
*/
export function registerFirestore(instance: FirebaseNamespace): void {
setSDKVersion(instance.SDK_VERSION);
configureForFirebase(
instance,
(app, firestoreExp) =>
Expand Down
8 changes: 7 additions & 1 deletion packages/firestore/exp/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
* limitations under the License.
*/

import { _registerComponent, registerVersion } from '@firebase/app-exp';
import {
_registerComponent,
registerVersion,
SDK_VERSION
} from '@firebase/app-exp';
import { Component, ComponentType } from '@firebase/component';

import { name, version } from '../package.json';
import { setSDKVersion } from '../src/core/version';
import { FirebaseFirestore } from '../src/exp/database';
import { Settings } from '../src/exp/settings';

Expand All @@ -29,6 +34,7 @@ declare module '@firebase/component' {
}

export function registerFirestore(variant?: string): void {
setSDKVersion(SDK_VERSION);
_registerComponent(
new Component(
'firestore-exp',
Expand Down
8 changes: 7 additions & 1 deletion packages/firestore/lite/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
* limitations under the License.
*/

import { _registerComponent, registerVersion } from '@firebase/app-exp';
import {
_registerComponent,
registerVersion,
SDK_VERSION
} from '@firebase/app-exp';
import { Component, ComponentType } from '@firebase/component';

import { version } from '../package.json';
import { setSDKVersion } from '../src/core/version';
import { FirebaseFirestore } from '../src/lite/database';
import { Settings } from '../src/lite/settings';

Expand All @@ -29,6 +34,7 @@ declare module '@firebase/component' {
}

export function registerFirestore(): void {
setSDKVersion(SDK_VERSION);
_registerComponent(
new Component(
'firestore/lite',
Expand Down
6 changes: 5 additions & 1 deletion packages/firestore/src/core/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
*/

/** The semver (www.semver.org) version of the SDK. */
export { version as SDK_VERSION } from '../../../firebase/package.json';
import { version } from '../../../firebase/package.json';
export let SDK_VERSION = version;
export function setSDKVersion(version: string): void {
SDK_VERSION = version;
}
11 changes: 8 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,11 @@
resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.6.1.tgz#dcbd23030a71c0c74fc95d4a3f75ba81653850e9"
integrity sha512-L/ZnJRAq7F++utfuoTKX4CLBG5YR7tFO3PLzG1/oXXKEezJ0kRL3CMRoueBEmTCzVb/6SIs2Qlaw++uDgi5Xyg==

"@firebase/[email protected]":
version "0.1.5"
resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.1.5.tgz#9fc9bd7c879f16b8d1bb08373a0f48c3a8b74557"
integrity sha512-88h74TMQ6wXChPA6h9Q3E1Jg6TkTHep2+k63OWg3s0ozyGVMeY+TTOti7PFPzq5RhszQPQOoCi59es4MaRvgCw==

"@firebase/[email protected]":
version "0.1.21"
resolved "https://registry.npmjs.org/@firebase/component/-/component-0.1.21.tgz#56062eb0d449dc1e7bbef3c084a9b5fa48c7c14d"
Expand Down Expand Up @@ -7482,8 +7487,8 @@ [email protected]:
"@firebase/app-exp" "0.0.900"
"@firebase/auth-compat" "0.0.900"
"@firebase/auth-exp" "0.0.900"
"@firebase/database" "0.9.10"
"@firebase/firestore" "2.2.4"
"@firebase/database" "0.9.11"
"@firebase/firestore" "2.2.5"
"@firebase/functions-compat" "0.0.900"
"@firebase/functions-exp" "0.0.900"
"@firebase/messaging-compat" "0.0.900"
Expand All @@ -7492,7 +7497,7 @@ [email protected]:
"@firebase/performance-exp" "0.0.900"
"@firebase/remote-config-compat" "0.0.900"
"@firebase/remote-config-exp" "0.0.900"
"@firebase/storage" "0.5.0"
"@firebase/storage" "0.5.1"

[email protected]:
version "3.13.0"
Expand Down

0 comments on commit 94ffdd8

Please sign in to comment.