Skip to content

Commit a43bbdd

Browse files
committed
Merge remote-tracking branch 'origin/master' into store-create-time
2 parents eea9d45 + 09dfc3a commit a43bbdd

File tree

109 files changed

+5236
-1339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+5236
-1339
lines changed

.changeset/breezy-wombats-care.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@firebase/firestore': minor
3+
'@firebase/firestore-compat': minor
4+
'firebase': minor
5+
---
6+
7+
Upgrade TypeScript to 4.7.4 (was 4.2.2)

.changeset/dirty-eggs-deliver.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/empty-doors-brush.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/database': patch
3+
'@firebase/database-compat': patch
4+
---
5+
6+
Use new wire protocol parameters for startAfter, endBefore.

.changeset/little-rats-relax.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/long-shirts-explode.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/lovely-swans-shake.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/lucky-games-arrive.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@firebase/firestore": minor
3+
"firebase": minor
4+
---
5+
6+
Functions in the Firestore package that return QueryConstraints (for example: `where(...)`, `limit(...)`, and `orderBy(...)`)
7+
now return a more specific type, which extends QueryConstraint. Refactoring and code that supports future features is also
8+
included in this release.

.changeset/rotten-peaches-poke.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.changeset/shiny-berries-carry.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/six-brooms-listen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/auth': patch
3+
---
4+
5+
move selenium-webdriver to devDependencies

.changeset/spicy-bags-sparkle.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/young-knives-shake.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/test-changed-auth.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ jobs:
3838
run: xvfb-run yarn test:changed auth
3939
test-firefox:
4040
name: Test Auth on Firefox If Changed
41-
runs-on: ubuntu-latest
41+
# Whatever version of Firefox comes with 22.04 is causing Firefox
42+
# startup to hang when launched by karma. Need to look further into
43+
# why.
44+
runs-on: ubuntu-20.04
4245

4346
steps:
4447
- name: install Firefox stable

.github/workflows/test-changed-firestore.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ jobs:
3434

3535
test-firefox:
3636
name: Test Firestore on Firefox If Changed
37-
runs-on: ubuntu-latest
37+
# Whatever version of Firefox comes with 22.04 is causing Firefox
38+
# startup to hang when launched by karma. Need to look further into
39+
# why.
40+
runs-on: ubuntu-20.04
3841

3942
steps:
4043
- name: install Firefox stable

.github/workflows/test-changed.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ jobs:
3434

3535
test-firefox:
3636
name: Test Packages With Changed Files in Firefox
37-
runs-on: ubuntu-latest
37+
# Whatever version of Firefox comes with 22.04 is causing Firefox
38+
# startup to hang when launched by karma. Need to look further into
39+
# why.
40+
runs-on: ubuntu-20.04
3841

3942
steps:
4043
- name: Checkout Repo

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,16 @@ scope](https://www.npmjs.com/search?q=scope%3Afirebase) on NPM.
190190

191191
### Testing the SDK Locally
192192

193-
Please be sure to build your repo before proceeding any further.
193+
Please be sure your product's package has been built before proceeding any further. (If you haven't built this repo before, make sure to run `yarn build` at the root)
194194
In order to manually test your SDK changes locally, you must use [yarn link](https://classic.yarnpkg.com/en/docs/cli/link):
195195

196196
```shell
197197
$ cd packages/firebase
198198
$ yarn link # initialize the linking to the other folder
199-
$ cd ../<my-test-app-dir> # cd into your personal project directory
200-
$ yarn link firebase # tell yarn to use the locally built firebase SDK instead
199+
$ cd ../packages/<my-product> # Example: $ cd packages/database
200+
$ yarn link # link your product to make it available elsewhere
201+
$ cd <my-test-app-dir> # cd into your personal project directory
202+
$ yarn link firebase @firebase/<my-product> # tell yarn to use the locally built firebase SDK instead
201203
```
202204

203205
This will create a symlink and point your `<my-test-app-dir>` to the locally built version of the firebase SDK.

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

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,16 @@ export class DocumentSnapshot<T = DocumentData> {
140140
export { EmulatorMockTokenOptions }
141141

142142
// @public
143-
export function endAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
143+
export function endAt(snapshot: DocumentSnapshot<unknown>): QueryEndAtConstraint;
144144

145145
// @public
146-
export function endAt(...fieldValues: unknown[]): QueryConstraint;
146+
export function endAt(...fieldValues: unknown[]): QueryEndAtConstraint;
147147

148148
// @public
149-
export function endBefore(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
149+
export function endBefore(snapshot: DocumentSnapshot<unknown>): QueryEndAtConstraint;
150150

151151
// @public
152-
export function endBefore(...fieldValues: unknown[]): QueryConstraint;
152+
export function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint;
153153

154154
// @public
155155
export class FieldPath {
@@ -222,10 +222,10 @@ export function increment(n: number): FieldValue;
222222
export function initializeFirestore(app: FirebaseApp, settings: Settings): Firestore;
223223

224224
// @public
225-
export function limit(limit: number): QueryConstraint;
225+
export function limit(limit: number): QueryLimitConstraint;
226226

227227
// @public
228-
export function limitToLast(limit: number): QueryConstraint;
228+
export function limitToLast(limit: number): QueryLimitConstraint;
229229

230230
export { LogLevel }
231231

@@ -235,7 +235,7 @@ export type NestedUpdateFields<T extends Record<string, unknown>> = UnionToInter
235235
}[keyof T & string]>;
236236

237237
// @public
238-
export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryConstraint;
238+
export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint;
239239

240240
// @public
241241
export type OrderByDirection = 'desc' | 'asc';
@@ -275,9 +275,32 @@ export class QueryDocumentSnapshot<T = DocumentData> extends DocumentSnapshot<T>
275275
data(): T;
276276
}
277277

278+
// @public
279+
export class QueryEndAtConstraint extends QueryConstraint {
280+
readonly type: 'endBefore' | 'endAt';
281+
}
282+
278283
// @public
279284
export function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;
280285

286+
// @public
287+
export class QueryFieldFilterConstraint extends QueryConstraint {
288+
readonly type = "where";
289+
}
290+
291+
// @public
292+
export class QueryLimitConstraint extends QueryConstraint {
293+
readonly type: 'limit' | 'limitToLast';
294+
}
295+
296+
// @public
297+
export type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint;
298+
299+
// @public
300+
export class QueryOrderByConstraint extends QueryConstraint {
301+
readonly type = "orderBy";
302+
}
303+
281304
// @public
282305
export class QuerySnapshot<T = DocumentData> {
283306
get docs(): Array<QueryDocumentSnapshot<T>>;
@@ -287,6 +310,11 @@ export class QuerySnapshot<T = DocumentData> {
287310
get size(): number;
288311
}
289312

313+
// @public
314+
export class QueryStartAtConstraint extends QueryConstraint {
315+
readonly type: 'startAt' | 'startAfter';
316+
}
317+
290318
// @public
291319
export function refEqual<T>(left: DocumentReference<T> | CollectionReference<T>, right: DocumentReference<T> | CollectionReference<T>): boolean;
292320

@@ -323,16 +351,16 @@ export interface Settings {
323351
export function snapshotEqual<T>(left: DocumentSnapshot<T> | QuerySnapshot<T>, right: DocumentSnapshot<T> | QuerySnapshot<T>): boolean;
324352

325353
// @public
326-
export function startAfter(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
354+
export function startAfter(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
327355

328356
// @public
329-
export function startAfter(...fieldValues: unknown[]): QueryConstraint;
357+
export function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint;
330358

331359
// @public
332-
export function startAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
360+
export function startAt(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
333361

334362
// @public
335-
export function startAt(...fieldValues: unknown[]): QueryConstraint;
363+
export function startAt(...fieldValues: unknown[]): QueryStartAtConstraint;
336364

337365
// @public
338366
export function terminate(firestore: Firestore): Promise<void>;
@@ -388,7 +416,7 @@ export function updateDoc<T>(reference: DocumentReference<T>, data: UpdateData<T
388416
export function updateDoc(reference: DocumentReference<unknown>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise<void>;
389417

390418
// @public
391-
export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryConstraint;
419+
export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint;
392420

393421
// @public
394422
export type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-contains' | 'in' | 'array-contains-any' | 'not-in';

common/api-review/firestore.api.md

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,16 @@ export function enableMultiTabIndexedDbPersistence(firestore: Firestore): Promis
170170
export function enableNetwork(firestore: Firestore): Promise<void>;
171171

172172
// @public
173-
export function endAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
173+
export function endAt(snapshot: DocumentSnapshot<unknown>): QueryEndAtConstraint;
174174

175175
// @public
176-
export function endAt(...fieldValues: unknown[]): QueryConstraint;
176+
export function endAt(...fieldValues: unknown[]): QueryEndAtConstraint;
177177

178178
// @public
179-
export function endBefore(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
179+
export function endBefore(snapshot: DocumentSnapshot<unknown>): QueryEndAtConstraint;
180180

181181
// @public
182-
export function endBefore(...fieldValues: unknown[]): QueryConstraint;
182+
export function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint;
183183

184184
// @public
185185
export class FieldPath {
@@ -298,10 +298,10 @@ export interface IndexField {
298298
export function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
299299

300300
// @public
301-
export function limit(limit: number): QueryConstraint;
301+
export function limit(limit: number): QueryLimitConstraint;
302302

303303
// @public
304-
export function limitToLast(limit: number): QueryConstraint;
304+
export function limitToLast(limit: number): QueryLimitConstraint;
305305

306306
// @public
307307
export function loadBundle(firestore: Firestore, bundleData: ReadableStream<Uint8Array> | ArrayBuffer | string): LoadBundleTask;
@@ -383,7 +383,7 @@ export function onSnapshotsInSync(firestore: Firestore, observer: {
383383
export function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe;
384384

385385
// @public
386-
export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryConstraint;
386+
export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint;
387387

388388
// @public
389389
export type OrderByDirection = 'desc' | 'asc';
@@ -428,9 +428,32 @@ export class QueryDocumentSnapshot<T = DocumentData> extends DocumentSnapshot<T>
428428
data(options?: SnapshotOptions): T;
429429
}
430430

431+
// @public
432+
export class QueryEndAtConstraint extends QueryConstraint {
433+
readonly type: 'endBefore' | 'endAt';
434+
}
435+
431436
// @public
432437
export function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;
433438

439+
// @public
440+
export class QueryFieldFilterConstraint extends QueryConstraint {
441+
readonly type = "where";
442+
}
443+
444+
// @public
445+
export class QueryLimitConstraint extends QueryConstraint {
446+
readonly type: 'limit' | 'limitToLast';
447+
}
448+
449+
// @public
450+
export type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint;
451+
452+
// @public
453+
export class QueryOrderByConstraint extends QueryConstraint {
454+
readonly type = "orderBy";
455+
}
456+
434457
// @public
435458
export class QuerySnapshot<T = DocumentData> {
436459
docChanges(options?: SnapshotListenOptions): Array<DocumentChange<T>>;
@@ -442,6 +465,11 @@ export class QuerySnapshot<T = DocumentData> {
442465
get size(): number;
443466
}
444467

468+
// @public
469+
export class QueryStartAtConstraint extends QueryConstraint {
470+
readonly type: 'startAt' | 'startAfter';
471+
}
472+
445473
// @public
446474
export function refEqual<T>(left: DocumentReference<T> | CollectionReference<T>, right: DocumentReference<T> | CollectionReference<T>): boolean;
447475

@@ -494,16 +522,16 @@ export interface SnapshotOptions {
494522
}
495523

496524
// @public
497-
export function startAfter(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
525+
export function startAfter(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
498526

499527
// @public
500-
export function startAfter(...fieldValues: unknown[]): QueryConstraint;
528+
export function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint;
501529

502530
// @public
503-
export function startAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
531+
export function startAt(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
504532

505533
// @public
506-
export function startAt(...fieldValues: unknown[]): QueryConstraint;
534+
export function startAt(...fieldValues: unknown[]): QueryStartAtConstraint;
507535

508536
// @public
509537
export type TaskState = 'Error' | 'Running' | 'Success';
@@ -570,7 +598,7 @@ export function updateDoc(reference: DocumentReference<unknown>, field: string |
570598
export function waitForPendingWrites(firestore: Firestore): Promise<void>;
571599

572600
// @public
573-
export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryConstraint;
601+
export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint;
574602

575603
// @public
576604
export type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-contains' | 'in' | 'array-contains-any' | 'not-in';

integration/compat-interop/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
"test:debug": "karma start --browsers Chrome --auto-watch"
99
},
1010
"dependencies": {
11-
"@firebase/app": "0.8.3",
12-
"@firebase/app-compat": "0.1.38",
11+
"@firebase/app": "0.8.4",
12+
"@firebase/app-compat": "0.1.39",
1313
"@firebase/analytics": "0.8.4",
1414
"@firebase/analytics-compat": "0.1.17",
1515
"@firebase/auth": "0.20.11",
1616
"@firebase/auth-compat": "0.2.24",
1717
"@firebase/functions": "0.8.8",
1818
"@firebase/functions-compat": "0.2.8",
19-
"@firebase/messaging": "0.10.0",
20-
"@firebase/messaging-compat": "0.1.20",
21-
"@firebase/performance": "0.5.16",
22-
"@firebase/performance-compat": "0.1.16",
19+
"@firebase/messaging": "0.11.0",
20+
"@firebase/messaging-compat": "0.1.21",
21+
"@firebase/performance": "0.5.17",
22+
"@firebase/performance-compat": "0.1.17",
2323
"@firebase/remote-config": "0.3.15",
2424
"@firebase/remote-config-compat": "0.1.16"
2525
},

0 commit comments

Comments
 (0)