Skip to content

Commit

Permalink
Merge master into release
Browse files Browse the repository at this point in the history
  • Loading branch information
google-oss-bot authored Dec 6, 2022
2 parents ef47884 + 649e7f3 commit 853e0d7
Show file tree
Hide file tree
Showing 181 changed files with 6,001 additions and 1,619 deletions.
7 changes: 7 additions & 0 deletions .changeset/breezy-wombats-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@firebase/firestore': minor
'@firebase/firestore-compat': minor
'firebase': minor
---

Upgrade TypeScript to 4.7.4 (was 4.2.2)
5 changes: 5 additions & 0 deletions .changeset/eighty-ants-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'firebase': patch
---

Modify entry point ESM bundles to conform to Node ESM specs.
6 changes: 6 additions & 0 deletions .changeset/empty-doors-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@firebase/database': patch
'@firebase/database-compat': patch
---

Use new wire protocol parameters for startAfter, endBefore.
8 changes: 8 additions & 0 deletions .changeset/lucky-games-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@firebase/firestore": minor
"firebase": minor
---

Functions in the Firestore package that return QueryConstraints (for example: `where(...)`, `limit(...)`, and `orderBy(...)`)
now return a more specific type, which extends QueryConstraint. Refactoring and code that supports future features is also
included in this release.
2 changes: 2 additions & 0 deletions .changeset/rotten-peaches-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 5 additions & 0 deletions .changeset/six-brooms-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/auth': patch
---

move selenium-webdriver to devDependencies
5 changes: 5 additions & 0 deletions .changeset/three-glasses-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/util': patch
---

Fix for third party window content that cannot access IndexedDB if the browser is set to never accept third party cookies on Firefox.
47 changes: 47 additions & 0 deletions .changeset/tidy-games-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
'@firebase/analytics': minor
'@firebase/analytics-compat': minor
'@firebase/analytics-interop-types': minor
'@firebase/analytics-types': minor
'@firebase/app': minor
'@firebase/app-check': minor
'@firebase/app-check-compat': minor
'@firebase/app-check-interop-types': minor
'@firebase/app-check-types': minor
'@firebase/app-compat': minor
'@firebase/app-types': minor
'@firebase/auth': minor
'@firebase/auth-compat': minor
'@firebase/auth-interop-types': minor
'@firebase/auth-types': minor
'@firebase/component': minor
'@firebase/database': minor
'@firebase/database-compat': minor
'@firebase/database-types': minor
'@firebase/functions': minor
'@firebase/functions-compat': minor
'@firebase/functions-types': minor
'@firebase/installations': minor
'@firebase/installations-compat': minor
'@firebase/installations-types': minor
'@firebase/logger': minor
'@firebase/messaging': minor
'@firebase/messaging-compat': minor
'@firebase/messaging-interop-types': minor
'@firebase/performance': minor
'@firebase/performance-compat': minor
'@firebase/performance-types': minor
'@firebase/remote-config': minor
'@firebase/remote-config-compat': minor
'@firebase/remote-config-types': minor
'@firebase/storage': minor
'@firebase/storage-compat': minor
'@firebase/storage-types': minor
'@firebase/template': minor
'@firebase/template-types': minor
'@firebase/util': minor
'@firebase/webchannel-wrapper': minor
'firebase': minor
---

Update TypeScript version to 4.7.4.
5 changes: 4 additions & 1 deletion .github/workflows/test-changed-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ jobs:
run: xvfb-run yarn test:changed auth
test-firefox:
name: Test Auth on Firefox If Changed
runs-on: ubuntu-latest
# Whatever version of Firefox comes with 22.04 is causing Firefox
# startup to hang when launched by karma. Need to look further into
# why.
runs-on: ubuntu-20.04

steps:
- name: install Firefox stable
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test-changed-firestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ jobs:

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

steps:
- name: install Firefox stable
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ jobs:

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

steps:
- name: Checkout Repo
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,16 @@ scope](https://www.npmjs.com/search?q=scope%3Afirebase) on NPM.

### Testing the SDK Locally

Please be sure to build your repo before proceeding any further.
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)
In order to manually test your SDK changes locally, you must use [yarn link](https://classic.yarnpkg.com/en/docs/cli/link):

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

This will create a symlink and point your `<my-test-app-dir>` to the locally built version of the firebase SDK.
Expand Down
52 changes: 40 additions & 12 deletions common/api-review/firestore-lite.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@ export class DocumentSnapshot<T = DocumentData> {
export { EmulatorMockTokenOptions }

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

// @public
export function endAt(...fieldValues: unknown[]): QueryConstraint;
export function endAt(...fieldValues: unknown[]): QueryEndAtConstraint;

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

// @public
export function endBefore(...fieldValues: unknown[]): QueryConstraint;
export function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint;

// @public
export class FieldPath {
Expand Down Expand Up @@ -222,10 +222,10 @@ export function increment(n: number): FieldValue;
export function initializeFirestore(app: FirebaseApp, settings: Settings): Firestore;

// @public
export function limit(limit: number): QueryConstraint;
export function limit(limit: number): QueryLimitConstraint;

// @public
export function limitToLast(limit: number): QueryConstraint;
export function limitToLast(limit: number): QueryLimitConstraint;

export { LogLevel }

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

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

// @public
export type OrderByDirection = 'desc' | 'asc';
Expand Down Expand Up @@ -275,9 +275,32 @@ export class QueryDocumentSnapshot<T = DocumentData> extends DocumentSnapshot<T>
data(): T;
}

// @public
export class QueryEndAtConstraint extends QueryConstraint {
readonly type: 'endBefore' | 'endAt';
}

// @public
export function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;

// @public
export class QueryFieldFilterConstraint extends QueryConstraint {
readonly type = "where";
}

// @public
export class QueryLimitConstraint extends QueryConstraint {
readonly type: 'limit' | 'limitToLast';
}

// @public
export type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint;

// @public
export class QueryOrderByConstraint extends QueryConstraint {
readonly type = "orderBy";
}

// @public
export class QuerySnapshot<T = DocumentData> {
get docs(): Array<QueryDocumentSnapshot<T>>;
Expand All @@ -287,6 +310,11 @@ export class QuerySnapshot<T = DocumentData> {
get size(): number;
}

// @public
export class QueryStartAtConstraint extends QueryConstraint {
readonly type: 'startAt' | 'startAfter';
}

// @public
export function refEqual<T>(left: DocumentReference<T> | CollectionReference<T>, right: DocumentReference<T> | CollectionReference<T>): boolean;

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

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

// @public
export function startAfter(...fieldValues: unknown[]): QueryConstraint;
export function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint;

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

// @public
export function startAt(...fieldValues: unknown[]): QueryConstraint;
export function startAt(...fieldValues: unknown[]): QueryStartAtConstraint;

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

// @public
export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryConstraint;
export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint;

// @public
export type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-contains' | 'in' | 'array-contains-any' | 'not-in';
Expand Down
52 changes: 40 additions & 12 deletions common/api-review/firestore.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ export function enableMultiTabIndexedDbPersistence(firestore: Firestore): Promis
export function enableNetwork(firestore: Firestore): Promise<void>;

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

// @public
export function endAt(...fieldValues: unknown[]): QueryConstraint;
export function endAt(...fieldValues: unknown[]): QueryEndAtConstraint;

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

// @public
export function endBefore(...fieldValues: unknown[]): QueryConstraint;
export function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint;

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

// @public
export function limit(limit: number): QueryConstraint;
export function limit(limit: number): QueryLimitConstraint;

// @public
export function limitToLast(limit: number): QueryConstraint;
export function limitToLast(limit: number): QueryLimitConstraint;

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

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

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

// @public
export class QueryEndAtConstraint extends QueryConstraint {
readonly type: 'endBefore' | 'endAt';
}

// @public
export function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;

// @public
export class QueryFieldFilterConstraint extends QueryConstraint {
readonly type = "where";
}

// @public
export class QueryLimitConstraint extends QueryConstraint {
readonly type: 'limit' | 'limitToLast';
}

// @public
export type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint;

// @public
export class QueryOrderByConstraint extends QueryConstraint {
readonly type = "orderBy";
}

// @public
export class QuerySnapshot<T = DocumentData> {
docChanges(options?: SnapshotListenOptions): Array<DocumentChange<T>>;
Expand All @@ -442,6 +465,11 @@ export class QuerySnapshot<T = DocumentData> {
get size(): number;
}

// @public
export class QueryStartAtConstraint extends QueryConstraint {
readonly type: 'startAt' | 'startAfter';
}

// @public
export function refEqual<T>(left: DocumentReference<T> | CollectionReference<T>, right: DocumentReference<T> | CollectionReference<T>): boolean;

Expand Down Expand Up @@ -494,16 +522,16 @@ export interface SnapshotOptions {
}

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

// @public
export function startAfter(...fieldValues: unknown[]): QueryConstraint;
export function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint;

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

// @public
export function startAt(...fieldValues: unknown[]): QueryConstraint;
export function startAt(...fieldValues: unknown[]): QueryStartAtConstraint;

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

// @public
export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryConstraint;
export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint;

// @public
export type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-contains' | 'in' | 'array-contains-any' | 'not-in';
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"devDependencies": {
"@babel/core": "7.17.10",
"@babel/preset-env": "7.19.4",
"@types/chai": "4.3.3",
"@types/chai": "4.3.4",
"@types/mocha": "9.1.1",
"babel-loader": "8.2.5",
"chai": "4.3.6",
Expand Down
Loading

0 comments on commit 853e0d7

Please sign in to comment.