Skip to content

Commit 853e0d7

Browse files
Merge master into release
2 parents ef47884 + 649e7f3 commit 853e0d7

File tree

181 files changed

+6001
-1619
lines changed

Some content is hidden

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

181 files changed

+6001
-1619
lines changed

.changeset/breezy-wombats-care.md

+7
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/eighty-ants-do.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'firebase': patch
3+
---
4+
5+
Modify entry point ESM bundles to conform to Node ESM specs.

.changeset/empty-doors-brush.md

+6
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/lucky-games-arrive.md

+8
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

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.changeset/six-brooms-listen.md

+5
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/three-glasses-judge.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/util': patch
3+
---
4+
5+
Fix for third party window content that cannot access IndexedDB if the browser is set to never accept third party cookies on Firefox.

.changeset/tidy-games-fry.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
'@firebase/analytics': minor
3+
'@firebase/analytics-compat': minor
4+
'@firebase/analytics-interop-types': minor
5+
'@firebase/analytics-types': minor
6+
'@firebase/app': minor
7+
'@firebase/app-check': minor
8+
'@firebase/app-check-compat': minor
9+
'@firebase/app-check-interop-types': minor
10+
'@firebase/app-check-types': minor
11+
'@firebase/app-compat': minor
12+
'@firebase/app-types': minor
13+
'@firebase/auth': minor
14+
'@firebase/auth-compat': minor
15+
'@firebase/auth-interop-types': minor
16+
'@firebase/auth-types': minor
17+
'@firebase/component': minor
18+
'@firebase/database': minor
19+
'@firebase/database-compat': minor
20+
'@firebase/database-types': minor
21+
'@firebase/functions': minor
22+
'@firebase/functions-compat': minor
23+
'@firebase/functions-types': minor
24+
'@firebase/installations': minor
25+
'@firebase/installations-compat': minor
26+
'@firebase/installations-types': minor
27+
'@firebase/logger': minor
28+
'@firebase/messaging': minor
29+
'@firebase/messaging-compat': minor
30+
'@firebase/messaging-interop-types': minor
31+
'@firebase/performance': minor
32+
'@firebase/performance-compat': minor
33+
'@firebase/performance-types': minor
34+
'@firebase/remote-config': minor
35+
'@firebase/remote-config-compat': minor
36+
'@firebase/remote-config-types': minor
37+
'@firebase/storage': minor
38+
'@firebase/storage-compat': minor
39+
'@firebase/storage-types': minor
40+
'@firebase/template': minor
41+
'@firebase/template-types': minor
42+
'@firebase/util': minor
43+
'@firebase/webchannel-wrapper': minor
44+
'firebase': minor
45+
---
46+
47+
Update TypeScript version to 4.7.4.

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

+4-1
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

+4-1
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

+4-1
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

+5-3
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

+40-12
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

+40-12
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';

e2e/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"devDependencies": {
2222
"@babel/core": "7.17.10",
2323
"@babel/preset-env": "7.19.4",
24-
"@types/chai": "4.3.3",
24+
"@types/chai": "4.3.4",
2525
"@types/mocha": "9.1.1",
2626
"babel-loader": "8.2.5",
2727
"chai": "4.3.6",

0 commit comments

Comments
 (0)