Skip to content

Commit a962368

Browse files
committed
Merge branch 'markduckworth/or-queries' into markduckworth/or-queries-pr-4
2 parents 3501135 + bf21b93 commit a962368

File tree

235 files changed

+4121
-1408
lines changed

Some content is hidden

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

235 files changed

+4121
-1408
lines changed

.changeset/hot-insects-wink.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/firestore': minor
3+
---
4+
5+
Implement count query for internal use.

.changeset/selfish-worms-glow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/app-check': patch
3+
---
4+
5+
Fix timer issues in App Check that caused the token to fail to refresh after the token expired, or caused rapid repeated requests attempting to do so.

.changeset/smart-crabs-warn.md

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

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
* @dwyfrequency @hsubox76 @firebase/jssdk-global-approvers
3737

3838
# Database Code
39-
packages/database @maneesht @jsdt @firebase/jssdk-global-approvers
40-
packages/database-compat @maneesht @jsdt @firebase/jssdk-global-approvers
41-
packages/database-types @maneesht @jsdt @firebase/jssdk-global-approvers
39+
packages/database @maneesht @jsdt @IanWyszynski @firebase/jssdk-global-approvers
40+
packages/database-compat @maneesht @jsdt @IanWyszynski @firebase/jssdk-global-approvers
41+
packages/database-types @maneesht @jsdt @IanWyszynski @firebase/jssdk-global-approvers
4242

4343
# Firestore Code
4444
packages/firestore @firebase/firestore-js-team @firebase/jssdk-global-approvers

.github/workflows/deploy-config.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy Project Config
2+
3+
on: pull_request
4+
5+
# Detects if any project config files (rules or functions) have changed,
6+
# and deploys them to the test project used for CI if so.
7+
# Run this in its own workflow instead of as a step before each test
8+
# workflow to avoid too many deploys, possibly causing race conditions.
9+
# Since the build step of each test workflow takes a long time, this
10+
# this should finish before the tests begin running.
11+
12+
jobs:
13+
test:
14+
name: Deploy Firebase Project Rules and Functions
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout Repo
19+
uses: actions/checkout@master
20+
with:
21+
# This makes Actions fetch all Git history so run-changed script can diff properly.
22+
fetch-depth: 0
23+
- name: Set up Node (14)
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: 14.x
27+
- name: Yarn install
28+
run: yarn
29+
- name: Deploy project config if needed
30+
run: yarn ts-node scripts/ci-test/deploy-if-needed.ts
31+
env:
32+
FIREBASE_CLI_TOKEN: ${{secrets.FIREBASE_CLI_TOKEN}}

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

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,62 @@ env:
77
DETECT_CHROMEDRIVER_VERSION: true
88

99
jobs:
10-
test:
11-
name: Test Auth If Changed
10+
test-chrome:
11+
name: Test Auth on Chrome and Node If Changed
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
16-
- name: install Chrome stable
17-
run: |
18-
sudo apt-get update
19-
sudo apt-get install google-chrome-stable
20-
- name: Checkout Repo
21-
uses: actions/checkout@master
22-
with:
23-
# This makes Actions fetch all Git history so run-changed script can diff properly.
24-
fetch-depth: 0
25-
- name: Set up Node (14)
26-
uses: actions/setup-node@v2
27-
with:
28-
node-version: 14.x
29-
- name: Bump Node memory limit
30-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
31-
- name: Test setup and yarn install
32-
run: |
33-
cp config/ci.config.json config/project.json
34-
yarn
35-
- name: build
36-
run: yarn build:changed auth
37-
- name: Run tests on changed packages
38-
run: xvfb-run yarn test:changed auth
15+
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
16+
- name: install Chrome stable
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install google-chrome-stable
20+
- name: Checkout Repo
21+
uses: actions/checkout@master
22+
with:
23+
# This makes Actions fetch all Git history so run-changed script can diff properly.
24+
fetch-depth: 0
25+
- name: Set up Node (14)
26+
uses: actions/setup-node@v2
27+
with:
28+
node-version: 14.x
29+
- name: Bump Node memory limit
30+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
31+
- name: Test setup and yarn install
32+
run: |
33+
cp config/ci.config.json config/project.json
34+
yarn
35+
- name: build
36+
run: yarn build:changed auth
37+
- name: Run tests on changed packages
38+
run: xvfb-run yarn test:changed auth
39+
test-firefox:
40+
name: Test Auth on Firefox If Changed
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- name: install Firefox stable
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install firefox
48+
- name: Checkout Repo
49+
uses: actions/checkout@master
50+
with:
51+
# This makes Actions fetch all Git history so run-changed script can diff properly.
52+
fetch-depth: 0
53+
- name: Set up Node (14)
54+
uses: actions/setup-node@v2
55+
with:
56+
node-version: 14.x
57+
- name: Bump Node memory limit
58+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
59+
- name: Test setup and yarn install
60+
run: |
61+
cp config/ci.config.json config/project.json
62+
yarn
63+
- name: build
64+
run: yarn build:changed auth
65+
- name: Run tests on auth changed packages
66+
run: xvfb-run yarn test:changed auth
67+
env:
68+
BROWSERS: 'Firefox'

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

Lines changed: 56 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,62 @@ name: Test Firestore
33
on: pull_request
44

55
jobs:
6-
test:
7-
name: Test Firestore If Changed
6+
test-chrome:
7+
name: Test Firestore on Chrome and Node If Changed
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- name: Checkout Repo
12-
uses: actions/checkout@master
13-
with:
14-
# This makes Actions fetch all Git history so run-changed script can diff properly.
15-
fetch-depth: 0
16-
- name: Set up Node (14)
17-
uses: actions/setup-node@v2
18-
with:
19-
node-version: 14.x
20-
- name: install Chrome stable
21-
run: |
22-
sudo apt-get update
23-
sudo apt-get install google-chrome-stable
24-
- name: Bump Node memory limit
25-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
26-
- name: Test setup and yarn install
27-
run: |
28-
cp config/ci.config.json config/project.json
29-
yarn
30-
- name: build
31-
run: yarn build:changed firestore
32-
- name: Run tests if firestore or its dependencies has changed
33-
run: yarn test:changed firestore
11+
- name: Checkout Repo
12+
uses: actions/checkout@master
13+
with:
14+
# This makes Actions fetch all Git history so run-changed script can diff properly.
15+
fetch-depth: 0
16+
- name: Set up Node (14)
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 14.x
20+
- name: install Chrome stable
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install google-chrome-stable
24+
- name: Bump Node memory limit
25+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
26+
- name: Test setup and yarn install
27+
run: |
28+
cp config/ci.config.json config/project.json
29+
yarn
30+
- name: build
31+
run: yarn build:changed firestore
32+
- name: Run tests if firestore or its dependencies has changed
33+
run: yarn test:changed firestore
34+
35+
test-firefox:
36+
name: Test Firestore on Firefox If Changed
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- name: install Firefox stable
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install firefox
44+
- name: Checkout Repo
45+
uses: actions/checkout@master
46+
with:
47+
# This makes Actions fetch all Git history so run-changed script can diff properly.
48+
fetch-depth: 0
49+
- name: Set up Node (14)
50+
uses: actions/setup-node@v2
51+
with:
52+
node-version: 14.x
53+
- name: Bump Node memory limit
54+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
55+
- name: Test setup and yarn install
56+
run: |
57+
cp config/ci.config.json config/project.json
58+
yarn
59+
- name: build
60+
run: yarn build:changed firestore
61+
- name: Run tests if firestore or its dependencies has changed
62+
run: xvfb-run yarn test:changed firestore
63+
env:
64+
BROWSERS: 'Firefox'

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# This file is pre-built and need not be formatted
2-
packages/auth
32
packages/firebase/firebase*
43
packages/firestore/scripts
54
dist

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ command, as follows:
126126

127127

128128
```bash
129-
# Select the Firebase project via the text-based UI.
129+
# Select the Firebase project via the text-based UI. This will run tools/config.js
130+
# and deploy from config/ to your Firebase project.
130131
$ yarn test:setup
131132

132133
# Specify the Firebase project via the command-line arguments.

common/api-review/auth.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ export function parseActionCodeURL(link: string): ActionCodeURL | null;
538538

539539
// @public
540540
export interface ParsedToken {
541-
[key: string]: string | object | undefined;
541+
[key: string]: any;
542542
'auth_time'?: string;
543543
'exp'?: string;
544544
'firebase'?: {

common/api-review/database.api.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ export class DataSnapshot {
3333
child(path: string): DataSnapshot;
3434
exists(): boolean;
3535
exportVal(): any;
36-
forEach(action: (child: DataSnapshot & {
37-
key: string;
38-
}) => boolean | void): boolean;
36+
forEach(action: (child: DataSnapshot) => boolean | void): boolean;
3937
hasChild(path: string): boolean;
4038
hasChildren(): boolean;
4139
get key(): string | null;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ export function getDoc<T>(reference: DocumentReference<T>): Promise<DocumentSnap
176176
export function getDocs<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
177177

178178
// @public
179-
export function getFirestore(app?: FirebaseApp): Firestore;
179+
export function getFirestore(): Firestore;
180+
181+
// @public
182+
export function getFirestore(app: FirebaseApp): Firestore;
180183

181184
// @public
182185
export function increment(n: number): FieldValue;

common/api-review/firestore.api.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,16 @@ export function getDocsFromCache<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
231231
export function getDocsFromServer<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
232232

233233
// @public
234-
export function getFirestore(app?: FirebaseApp): Firestore;
234+
export function getFirestore(): Firestore;
235+
236+
// @public
237+
export function getFirestore(app: FirebaseApp): Firestore;
235238

236239
// @public
237240
export function increment(n: number): FieldValue;
238241

239242
// @public
240-
export function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore;
243+
export function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
241244

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

config/database.rules.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"rules": {
33
".read": true,
4-
".write": true
4+
".write": true,
5+
"testing": {
6+
".indexOn": "testIndex"
7+
}
58
}
69
}

e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "",
1717
"license": "ISC",
1818
"dependencies": {
19-
"firebase": "9.8.1"
19+
"firebase": "9.9.2"
2020
},
2121
"devDependencies": {
2222
"@babel/core": "7.17.10",

0 commit comments

Comments
 (0)