Skip to content

Fei v9 main firestore #5319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 47 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
00d5618
compile firestore
Feiyang1 Aug 14, 2021
e072423
update typings path
Feiyang1 Aug 16, 2021
61326d0
compile firestore compat
Feiyang1 Aug 16, 2021
6d3a95c
lint compat
Feiyang1 Aug 16, 2021
fb89c68
make test work
Feiyang1 Aug 17, 2021
e9039e5
get most tests work
Feiyang1 Aug 18, 2021
b7c9e77
build
Feiyang1 Aug 18, 2021
25a9dea
remove special paths
Feiyang1 Aug 18, 2021
5bff131
update firestore-compat pkg json
Feiyang1 Aug 18, 2021
e475b43
Merge branch 'master' into fei-v9-main-firestore
Feiyang1 Aug 18, 2021
2cb9567
fix merge issues
Feiyang1 Aug 18, 2021
ae2d146
Simplify bundles
schmidt-sebastian Aug 18, 2021
0ea42e3
Prettier
schmidt-sebastian Aug 18, 2021
bfdf412
Fix Bundle compile
schmidt-sebastian Aug 18, 2021
f73c1b5
Fix build
schmidt-sebastian Aug 18, 2021
8a9eb9f
address comments
Feiyang1 Aug 18, 2021
8d637a3
console build
Feiyang1 Aug 18, 2021
30f77b9
Merge branch 'fei-v9-main-firestore' of https://github.com/firebase/f…
Feiyang1 Aug 18, 2021
0b6f1ce
Fix all tests
schmidt-sebastian Aug 18, 2021
00490a6
Prettier
schmidt-sebastian Aug 18, 2021
0408b3b
Merge branch 'fei-v9-main-firestore' of github.com:firebase/firebase-…
schmidt-sebastian Aug 18, 2021
1504240
Merge branch 'master' into fei-v9-main-firestore
Feiyang1 Aug 19, 2021
3fdb655
fix merge issues
Feiyang1 Aug 19, 2021
557d06d
Merge branch 'fei-v9-main-firestore' of https://github.com/firebase/f…
Feiyang1 Aug 19, 2021
6f4ec23
fix typo
Feiyang1 Aug 19, 2021
2dedf19
Merge branch 'master' into fei-v9-main-firestore
Feiyang1 Aug 19, 2021
95cb0e2
update paths
Feiyang1 Aug 19, 2021
8be6e79
app-exp
Feiyang1 Aug 20, 2021
070f093
fix lint
Feiyang1 Aug 20, 2021
c78cb57
correct path
Feiyang1 Aug 20, 2021
bf408d4
fix
Feiyang1 Aug 20, 2021
609419d
fix compat lint
Feiyang1 Aug 20, 2021
196d0e6
fix firestore integration
Feiyang1 Aug 20, 2021
031942a
fix workflow
Feiyang1 Aug 20, 2021
b03423b
update dep
Feiyang1 Aug 20, 2021
aa5b344
Always block on Auth (#5340)
schmidt-sebastian Aug 21, 2021
0bdf7f2
fix lint
Feiyang1 Aug 21, 2021
b417bbe
Merge branch 'fei-v9-main' into fei-v9-main-firestore
Feiyang1 Aug 22, 2021
6655e90
build firestore
Feiyang1 Aug 22, 2021
0adb499
remove memory only tests
Feiyang1 Aug 22, 2021
1b46468
fix firebase integration tests
Feiyang1 Aug 22, 2021
0b43ba7
enable more build and tests
Feiyang1 Aug 22, 2021
60b2f0a
add firestore-compat to firebase dep
Feiyang1 Aug 22, 2021
6577316
fix auth compat class
Feiyang1 Aug 22, 2021
07c6ee3
enable auth test
Feiyang1 Aug 22, 2021
8481938
auth package doc
Feiyang1 Aug 23, 2021
13339f8
Update API reports
Feiyang1 Aug 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,650 changes: 824 additions & 826 deletions common/api-review/auth.api.md

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion common/api-review/firestore-lite.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```ts

import { EmulatorMockTokenOptions } from '@firebase/util';
import { FirebaseApp } from '@firebase/app-exp';
import { FirebaseApp } from '@firebase/app';
import { LogLevelString as LogLevel } from '@firebase/logger';

// @public
Expand Down Expand Up @@ -104,6 +104,8 @@ export class DocumentSnapshot<T = DocumentData> {
get ref(): DocumentReference<T>;
}

export { EmulatorMockTokenOptions }

// @public
export function endAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;

Expand Down
4 changes: 3 additions & 1 deletion common/api-review/firestore.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```ts

import { EmulatorMockTokenOptions } from '@firebase/util';
import { FirebaseApp } from '@firebase/app-exp';
import { FirebaseApp } from '@firebase/app';
import { LogLevelString as LogLevel } from '@firebase/logger';

// @public
Expand Down Expand Up @@ -125,6 +125,8 @@ export class DocumentSnapshot<T = DocumentData> {
get ref(): DocumentReference<T>;
}

export { EmulatorMockTokenOptions }

// @public
export function enableIndexedDbPersistence(firestore: Firestore, persistenceSettings?: PersistenceSettings): Promise<void>;

Expand Down
11 changes: 1 addition & 10 deletions integration/firebase/test/namespaceDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
"removeApp": {
"__type": "function"
},
"components": {
"__type": "Map"
},
"ErrorFactory": {
"__type": "function"
},
Expand Down Expand Up @@ -223,16 +220,10 @@
"onMessage": {
"__type": "function"
},
"onTokenRefresh": {
"__type": "function"
},
"requestPermission": {
"__type": "function"
},
"deleteToken": {
"__type": "function"
},
"setBackgroundMessageHandler": {
"onBackgroundMessage": {
"__type": "function"
}
}
Expand Down
5 changes: 2 additions & 3 deletions integration/firestore/firebase_export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
* limitations under the License.
*/

import firebase from '@firebase/app';
import '@firebase/firestore';
import '@firebase/firestore/bundle';
import firebase from '@firebase/app-compat';
import '@firebase/firestore-compat';
import { FirebaseApp } from '@firebase/app-types';
import { Settings, FirebaseFirestore } from '@firebase/firestore-types';

Expand Down
71 changes: 0 additions & 71 deletions integration/firestore/firebase_export_memory.ts

This file was deleted.

5 changes: 1 addition & 4 deletions integration/firestore/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ function copyTests() {
*/
/import\s+\* as firebaseExport\s+from\s+('|")[^\1]+firebase_export\1;?/,
`import * as firebaseExport from '${resolve(
__dirname,
isPersistenceEnabled()
? './firebase_export'
: './firebase_export_memory'
__dirname, './firebase_export'
)}';

if (typeof process === 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion integration/firestore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@firebase/app": "0.6.30",
"@firebase/firestore": "2.4.0",
"@firebase/firestore-compat": "0.0.900",
"@types/mocha": "8.2.3",
"gulp": "4.0.2",
"gulp-filter": "7.0.0",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
],
"scripts": {
"dev": "lerna run --parallel --scope @firebase/* --scope firebase dev",
"build": "lerna run --scope @firebase/* --scope firebase --ignore @firebase/rules-unit-testing --ignore @firebase/firestore build",
"build": "lerna run --scope @firebase/* --scope firebase --ignore @firebase/rules-unit-testing build",
"build:changed": "ts-node-script scripts/ci-test/build_changed.ts",
"release:prepare": "lerna run --scope @firebase/* add-compat-overloads && lerna run --scope @firebase/* typings:public",
"link:packages": "lerna exec --scope @firebase/* --scope firebase -- yarn link",
"stage:packages": "./scripts/prepublish.sh",
"repl": "node tools/repl.js",
"release": "ts-node-script scripts/release/cli.ts",
"pretest": "node tools/pretest.js",
"test": "lerna run --ignore firebase-repo-scripts-prune-dts --ignore @firebase/rules-unit-testing --ignore @firebase/auth --ignore @firebase/firestore --ignore @firebase/database-compat --ignore firebase-firestore-integration-test --ignore firebase-messaging-integration-test --ignore firebase-namespace-integration-test --concurrency 4 --stream test",
"test": "lerna run --ignore firebase-repo-scripts-prune-dts --ignore @firebase/rules-unit-testing --ignore @firebase/database-compat --ignore firebase-messaging-integration-test --concurrency 4 --stream test",
"test:ci": "lerna run --concurrency 4 test:ci",
"pretest:coverage": "mkdirp coverage",
"ci:coverage": "lcov-result-merger 'packages/**/lcov.info' 'lcov-all.info'",
Expand Down
10 changes: 4 additions & 6 deletions packages/auth-compat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import {
ComponentType,
InstantiationMode
} from '@firebase/component';
import { FirebaseError } from '@firebase/util';

import * as types from '@firebase/auth-types';
import { name, version } from './package.json';
import { Auth } from './src/auth';
import { Persistence } from './src/persistence';
import { PhoneAuthProvider as CompatAuthProvider } from './src/phone_auth_provider';
import { RecaptchaVerifier as CompatRecaptchaVerifier } from './src/recaptcha_verifier';

Expand Down Expand Up @@ -106,11 +106,9 @@ function registerAuthCompat(instance: _FirebaseNamespace): void {
PhoneMultiFactorGenerator: impl.PhoneMultiFactorGenerator,
RecaptchaVerifier: CompatRecaptchaVerifier,
TwitterAuthProvider: impl.TwitterAuthProvider,
Auth: {
Persistence
},
AuthCredential: impl.AuthCredential
// 'Error': fireauth.AuthError
Auth,
AuthCredential: impl.AuthCredential,
Error: FirebaseError
})
.setInstantiationMode(InstantiationMode.LAZY)
.setMultipleInstances(false)
Expand Down
1 change: 1 addition & 0 deletions packages/auth-compat/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const _assert: typeof exp._assert = exp._assert;
export class Auth
implements compat.FirebaseAuth, Wrapper<exp.Auth>, _FirebaseService
{
static Persistence = Persistence;
readonly _delegate: exp.AuthImpl;

constructor(readonly app: FirebaseApp, provider: Provider<'auth'>) {
Expand Down
6 changes: 6 additions & 0 deletions packages/auth/index.doc.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Firebase Authentication
*
* @packageDocumentation
*/

/**
* @license
* Copyright 2021 Google LLC
Expand Down
1 change: 1 addition & 0 deletions packages/firebase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
"@firebase/database": "0.11.0",
"@firebase/database-compat": "0.0.900",
"@firebase/firestore": "2.4.0",
"@firebase/firestore-compat": "0.0.900",
"@firebase/functions": "0.6.15",
"@firebase/functions-compat": "0.0.900",
"@firebase/installations": "0.4.32",
Expand Down
76 changes: 76 additions & 0 deletions packages/firestore-compat/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**
* @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.
*/

module.exports = {
extends: '../../config/.eslintrc.js',
parserOptions: {
project: 'tsconfig.json',
// to make vscode-eslint work with monorepo
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
tsconfigRootDir: __dirname
},
plugins: ['import'],
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
'@typescript-eslint/no-unused-vars': [
'error',
{
varsIgnorePattern: '^_',
args: 'none'
}
],
'import/order': [
'error',
{
'groups': [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index'
],
'newlines-between': 'always',
'alphabetize': { 'order': 'asc', 'caseInsensitive': true }
}
]
},
overrides: [
{
files: ['**/*.d.ts'],
rules: {
'camelcase': 'off',
'import/no-duplicates': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off'
}
},
{
files: ['**/*.test.ts', '**/test/**/*.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'error'
}
},
{
files: ['scripts/*.ts'],
rules: {
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/no-require-imports': 'off'
}
}
]
};
24 changes: 24 additions & 0 deletions packages/firestore-compat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# @firebase/firestore-compat

This is the [Cloud Firestore](https://firebase.google.com/docs/firestore/) component of the
[Firebase JS SDK](https://www.npmjs.com/package/firebase).

**This package is not intended for direct usage, and should only be used via the officially
supported [firebase](https://www.npmjs.com/package/firebase) package.**

If you are developing a Node.js application that requires administrative access to Cloud Firestore,
use the [`@google-cloud/firestore`](https://www.npmjs.com/package/@google-cloud/firestore) Server
SDK with your developer credentials.

## Documentation

For comprehensive documentation please see the [Firebase Reference
Docs][reference-docs].

[reference-docs]: https://firebase.google.com/docs/reference/js/

## Contributing
See [Contributing to the Firebase SDK](../../CONTRIBUTING.md) for general
information about contributing to the firebase-js-sdk repo and
[Contributing to the Cloud Firestore Component](./CONTRIBUTING.md) for
details specific to the Cloud Firestore code and tests.
Loading