Skip to content

Commit 7407901

Browse files
Merge c006e4b into 9ac2093
2 parents 9ac2093 + c006e4b commit 7407901

19 files changed

+5529
-418
lines changed

common/api-review/firestore-exp.api.md

+47-110
Large diffs are not rendered by default.

common/api-review/firestore-lite.api.md

+6-103
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@
44
55
```ts
66

7-
import { DocumentData as DocumentData_2 } from '@firebase/firestore-types';
87
import { FirebaseApp } from '@firebase/app-types-exp';
9-
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
10-
import { _FirebaseService } from '@firebase/app-types-exp';
118
import { LogLevelString as LogLevel } from '@firebase/logger';
12-
import { Provider } from '@firebase/component';
13-
import { SetOptions as SetOptions_2 } from '@firebase/firestore-types';
149

1510
// @public
1611
export function addDoc<T>(reference: CollectionReference<T>, data: T): Promise<DocumentReference<T>>;
@@ -23,11 +18,6 @@ export function arrayUnion(...elements: unknown[]): FieldValue;
2318

2419
// @public
2520
export class Bytes {
26-
constructor(byteString: ByteString);
27-
// Warning: (ae-forgotten-export) The symbol "ByteString" needs to be exported by the entry point index.d.ts
28-
//
29-
// (undocumented)
30-
_byteString: ByteString;
3121
static fromBase64String(base64: string): Bytes;
3222
static fromUint8Array(array: Uint8Array): Bytes;
3323
isEqual(other: Bytes): boolean;
@@ -50,16 +40,11 @@ export function collectionGroup(firestore: FirebaseFirestore, collectionId: stri
5040

5141
// @public
5242
export class CollectionReference<T = DocumentData> extends Query<T> {
53-
constructor(firestore: FirebaseFirestore, converter: FirestoreDataConverter<T> | null, _path: ResourcePath);
5443
// (undocumented)
5544
readonly firestore: FirebaseFirestore;
5645
get id(): string;
5746
get parent(): DocumentReference<DocumentData> | null;
5847
get path(): string;
59-
// Warning: (ae-forgotten-export) The symbol "ResourcePath" needs to be exported by the entry point index.d.ts
60-
//
61-
// (undocumented)
62-
readonly _path: ResourcePath;
6348
// (undocumented)
6449
readonly type = "collection";
6550
withConverter<U>(converter: FirestoreDataConverter<U>): CollectionReference<U>;
@@ -91,47 +76,22 @@ export function documentId(): FieldPath;
9176

9277
// @public
9378
export class DocumentReference<T = DocumentData> {
94-
constructor(firestore: FirebaseFirestore, _converter: FirestoreDataConverter<T> | null, _key: DocumentKey);
95-
// (undocumented)
96-
readonly _converter: FirestoreDataConverter<T> | null;
9779
readonly firestore: FirebaseFirestore;
9880
get id(): string;
99-
// Warning: (ae-forgotten-export) The symbol "DocumentKey" needs to be exported by the entry point index.d.ts
100-
//
101-
// (undocumented)
102-
readonly _key: DocumentKey;
10381
get parent(): CollectionReference<T>;
10482
get path(): string;
105-
// (undocumented)
106-
get _path(): ResourcePath;
10783
readonly type = "document";
10884
withConverter<U>(converter: FirestoreDataConverter<U>): DocumentReference<U>;
10985
}
11086

11187
// @public
11288
export class DocumentSnapshot<T = DocumentData> {
113-
constructor(_firestore: FirebaseFirestore, _userDataWriter: AbstractUserDataWriter, _key: DocumentKey, _document: Document_2 | null, _converter: UntypedFirestoreDataConverter<T> | null);
114-
// Warning: (ae-forgotten-export) The symbol "UntypedFirestoreDataConverter" needs to be exported by the entry point index.d.ts
115-
//
116-
// (undocumented)
117-
_converter: UntypedFirestoreDataConverter<T> | null;
89+
protected constructor();
11890
data(): T | undefined;
119-
// Warning: (ae-forgotten-export) The symbol "Document" needs to be exported by the entry point index.d.ts
120-
//
121-
// (undocumented)
122-
_document: Document_2 | null;
12391
exists(): this is QueryDocumentSnapshot<T>;
124-
// (undocumented)
125-
_firestore: FirebaseFirestore;
12692
get(fieldPath: string | FieldPath): any;
12793
get id(): string;
128-
// (undocumented)
129-
_key: DocumentKey;
13094
get ref(): DocumentReference<T>;
131-
// Warning: (ae-forgotten-export) The symbol "AbstractUserDataWriter" needs to be exported by the entry point index.d.ts
132-
//
133-
// (undocumented)
134-
_userDataWriter: AbstractUserDataWriter;
13595
}
13696

13797
// @public
@@ -149,8 +109,6 @@ export function endBefore(...fieldValues: unknown[]): QueryConstraint;
149109
// @public
150110
export class FieldPath {
151111
constructor(...fieldNames: string[]);
152-
// Warning: (ae-forgotten-export) The symbol "FieldPath" needs to be exported by the entry point index.d.ts
153-
readonly _internalPath: FieldPath_2;
154112
isEqual(other: FieldPath): boolean;
155113
}
156114

@@ -159,49 +117,14 @@ export abstract class FieldValue {
159117
constructor(_methodName: string);
160118
// (undocumented)
161119
abstract isEqual(other: FieldValue): boolean;
162-
// (undocumented)
163-
_methodName: string;
164-
// Warning: (ae-forgotten-export) The symbol "ParseContext" needs to be exported by the entry point index.d.ts
165-
// Warning: (ae-forgotten-export) The symbol "FieldTransform" needs to be exported by the entry point index.d.ts
166-
//
167-
// (undocumented)
168-
abstract _toFieldTransform(context: ParseContext): FieldTransform | null;
169120
}
170121

171-
// Warning: (ae-forgotten-export) The symbol "FirestoreService" needs to be exported by the entry point index.d.ts
172-
//
173122
// @public
174-
export class FirebaseFirestore implements FirestoreService {
175-
constructor(databaseIdOrApp: DatabaseId | FirebaseApp, authProvider: Provider<FirebaseAuthInternalName>);
123+
export class FirebaseFirestore {
176124
get app(): FirebaseApp;
177-
// Warning: (ae-forgotten-export) The symbol "CredentialsProvider" needs to be exported by the entry point index.d.ts
178-
//
179-
// (undocumented)
180-
_credentials: CredentialsProvider;
181-
// Warning: (ae-forgotten-export) The symbol "DatabaseId" needs to be exported by the entry point index.d.ts
182-
//
183-
// (undocumented)
184-
readonly _databaseId: DatabaseId;
185125
// (undocumented)
186-
_delete(): Promise<void>;
187-
// (undocumented)
188-
_freezeSettings(): FirestoreSettings;
189-
// Warning: (ae-forgotten-export) The symbol "FirestoreSettings" needs to be exported by the entry point index.d.ts
190-
//
191-
// (undocumented)
192-
_getSettings(): FirestoreSettings;
193-
// (undocumented)
194-
get _initialized(): boolean;
195-
// (undocumented)
196-
readonly _persistenceKey: string;
197-
// Warning: (ae-forgotten-export) The symbol "PrivateSettings" needs to be exported by the entry point index.d.ts
198-
//
199-
// (undocumented)
200-
_setSettings(settings: PrivateSettings): void;
201-
protected _terminate(): Promise<void>;
202-
// (undocumented)
203-
get _terminated(): boolean;
204-
}
126+
toJSON(): object;
127+
}
205128

206129
// @public
207130
export interface FirestoreDataConverter<T> {
@@ -212,7 +135,6 @@ export interface FirestoreDataConverter<T> {
212135

213136
// @public
214137
export class FirestoreError extends Error {
215-
constructor(code: FirestoreErrorCode, message: string);
216138
// (undocumented)
217139
readonly code: FirestoreErrorCode;
218140
// (undocumented)
@@ -229,7 +151,6 @@ export type FirestoreErrorCode = 'cancelled' | 'unknown' | 'invalid-argument' |
229151
// @public
230152
export class GeoPoint {
231153
constructor(latitude: number, longitude: number);
232-
_compareTo(other: GeoPoint): number;
233154
isEqual(other: GeoPoint): boolean;
234155
get latitude(): number;
235156
get longitude(): number;
@@ -271,14 +192,8 @@ export type OrderByDirection = 'desc' | 'asc';
271192

272193
// @public
273194
export class Query<T = DocumentData> {
274-
constructor(firestore: FirebaseFirestore, _converter: FirestoreDataConverter<T> | null, _query: Query_2);
275-
// (undocumented)
276-
readonly _converter: FirestoreDataConverter<T> | null;
195+
protected constructor();
277196
readonly firestore: FirebaseFirestore;
278-
// Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point index.d.ts
279-
//
280-
// (undocumented)
281-
readonly _query: Query_2;
282197
readonly type: 'query' | 'collection';
283198
withConverter<U>(converter: FirestoreDataConverter<U>): Query<U>;
284199
}
@@ -288,7 +203,6 @@ export function query<T>(query: Query<T>, ...queryConstraints: QueryConstraint[]
288203

289204
// @public
290205
export abstract class QueryConstraint {
291-
abstract _apply<T>(query: Query<T>): Query<T>;
292206
abstract readonly type: QueryConstraintType;
293207
}
294208

@@ -306,10 +220,7 @@ export function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;
306220

307221
// @public
308222
export class QuerySnapshot<T = DocumentData> {
309-
constructor(_query: Query<T>, _docs: Array<QueryDocumentSnapshot<T>>);
310223
get docs(): Array<QueryDocumentSnapshot<T>>;
311-
// (undocumented)
312-
readonly _docs: Array<QueryDocumentSnapshot<T>>;
313224
get empty(): boolean;
314225
forEach(callback: (result: QueryDocumentSnapshot<T>) => void, thisArg?: unknown): void;
315226
readonly query: Query<T>;
@@ -378,8 +289,6 @@ export function terminate(firestore: FirebaseFirestore): Promise<void>;
378289
// @public
379290
export class Timestamp {
380291
constructor(seconds: number, nanoseconds: number);
381-
// (undocumented)
382-
_compareTo(other: Timestamp): number;
383292
static fromDate(date: Date): Timestamp;
384293
static fromMillis(milliseconds: number): Timestamp;
385294
isEqual(other: Timestamp): boolean;
@@ -402,11 +311,7 @@ export class Timestamp {
402311

403312
// @public
404313
export class Transaction {
405-
// Warning: (ae-forgotten-export) The symbol "Transaction" needs to be exported by the entry point index.d.ts
406-
constructor(_firestore: FirebaseFirestore, _transaction: Transaction_2);
407314
delete(documentRef: DocumentReference<unknown>): this;
408-
// (undocumented)
409-
protected readonly _firestore: FirebaseFirestore;
410315
get<T>(documentRef: DocumentReference<T>): Promise<DocumentSnapshot<T>>;
411316
set<T>(documentRef: DocumentReference<T>, data: T): this;
412317
set<T>(documentRef: DocumentReference<T>, data: Partial<T>, options: SetOptions): this;
@@ -437,15 +342,13 @@ export type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-conta
437342

438343
// @public
439344
export class WriteBatch {
440-
// Warning: (ae-forgotten-export) The symbol "Mutation" needs to be exported by the entry point index.d.ts
441-
constructor(_firestore: FirebaseFirestore, _commitHandler: (m: Mutation[]) => Promise<void>);
442345
commit(): Promise<void>;
443346
delete(documentRef: DocumentReference<unknown>): WriteBatch;
444347
set<T>(documentRef: DocumentReference<T>, data: T): WriteBatch;
445348
set<T>(documentRef: DocumentReference<T>, data: Partial<T>, options: SetOptions): WriteBatch;
446349
update(documentRef: DocumentReference<unknown>, data: UpdateData): WriteBatch;
447350
update(documentRef: DocumentReference<unknown>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): WriteBatch;
448-
}
351+
}
449352

450353
// @public
451354
export function writeBatch(firestore: FirebaseFirestore): WriteBatch;

packages/firestore/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
module.exports = {
1919
extends: '../../config/.eslintrc.js',
2020
parserOptions: {
21-
project: 'tsconfig.json',
21+
project: 'tsconfig.eslint.json',
2222
// to make vscode-eslint work with monorepo
2323
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
2424
tsconfigRootDir: __dirname

packages/firestore/exp/api-extractor.json

-23
This file was deleted.

packages/firestore/lite/api-extractor.json

-23
This file was deleted.

packages/firestore/package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
"description": "The Cloud Firestore component of the Firebase JS SDK.",
88
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
99
"scripts": {
10-
"api-report:exp": "(cd exp; api-extractor run --local --verbose) && ts-node-script ../../repo-scripts/prune-dts/prune-dts.ts --input dist/exp/private.d.ts --output dist/exp/index.d.ts",
11-
"api-report:lite": "(cd lite; api-extractor run --local --verbose) && ts-node-script ../../repo-scripts/prune-dts/prune-dts.ts --input dist/lite/private.d.ts --output dist/lite/index.d.ts",
1210
"bundle": "rollup -c",
13-
"prebuild": "tsc --emitDeclarationOnly --declaration -p tsconfig.json; run-p api-report:exp api-report:lite",
11+
"prebuild": "tsc --emitDeclarationOnly --declaration -p tsconfig.json && yarn api-report",
1412
"build": "run-p 'bundle rollup.config.browser.js' 'bundle rollup.config.node.js' 'bundle rollup.config.rn.js' build:lite build:exp",
1513
"build:scripts": "tsc -moduleResolution node --module commonjs scripts/*.ts && ls scripts/*.js | xargs -I % sh -c 'terser % -o %'",
1614
"prebuild:release": "yarn prebuild",
@@ -27,9 +25,9 @@
2725
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
2826
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
2927
"prettier": "prettier --write '*.js' '*.ts' '@(lite|exp|src|test)/**/*.ts'",
30-
"pregendeps:exp": "yarn api-report:exp && node scripts/build-bundle.js --input ./exp/index.ts --output ./dist/exp/tmp.js",
28+
"pregendeps:exp": "yarn api-report && node scripts/build-bundle.js --input ./exp/index.ts --output ./dist/exp/tmp.js",
3129
"gendeps:exp": "../../scripts/exp/extract-deps.sh --types ./dist/exp/index.d.ts --bundle ./dist/exp/tmp.js --output ./dist/exp/dependencies.json",
32-
"pregendeps:lite": "yarn api-report:lite && node scripts/build-bundle.js --input ./lite/index.ts --output ./dist/lite/tmp.js",
30+
"pregendeps:lite": "yarn api-report && node scripts/build-bundle.js --input ./lite/index.ts --output ./dist/lite/tmp.js",
3331
"gendeps:lite": "../../scripts/exp/extract-deps.sh --types ./dist/lite/index.d.ts --bundle ./dist/lite/tmp.js --output ./dist/lite/dependencies.json",
3432
"test:lite": "node ./scripts/run-tests.js --emulator --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
3533
"test:lite:prod": "node ./scripts/run-tests.js --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
@@ -46,7 +44,7 @@
4644
"test:node:persistence:prod": "node ./scripts/run-tests.js --main=index.node.ts --persistence 'test/{,!(browser|lite)/**/}*.test.ts'",
4745
"test:travis": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/firestore-test-runner.ts",
4846
"test:minified": "(cd ../../integration/firestore ; yarn test)",
49-
"api-report": "rm -rf temp && api-extractor run --local --verbose",
47+
"api-report": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ./scripts/api-report.ts",
5048
"predoc": "node ../../scripts/exp/remove-exp.js temp",
5149
"doc": "api-documenter markdown --input temp --output docs"
5250
},

0 commit comments

Comments
 (0)