Skip to content

Commit 5bd6142

Browse files
committed
Merge remote-tracking branch 'origin/master' into HEAD
2 parents 97ca3ee + 36558bd commit 5bd6142

File tree

18 files changed

+331
-439
lines changed

18 files changed

+331
-439
lines changed

.changeset/heavy-starfishes-count.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@firebase/firestore-compat": feat
3+
"@firebase/firestore": feat
4+
---
5+
6+
Relaxing query validation performed by the SDK

.changeset/perfect-colts-scream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/database-compat": patch
3+
---
4+
5+
Solve @firebase/database-compat/standalone resolution issues with astrojs

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ packages/app-check-interop-types @hsubox76 @firebase/jssdk-global-approvers
9696
# Documentation Changes
9797
packages/firebase/index.d.ts @egilmorez @firebase/jssdk-global-approvers
9898
scripts/docgen/content-sources/ @egilmorez @firebase/jssdk-global-approvers
99+
docs-devsite/ @egilmorez @markarndt
99100

100101
# Changeset
101-
.changeset @egilmorez @firebase/jssdk-changeset-approvers @firebase/firestore-js-team @firebase/jssdk-global-approvers
102+
.changeset @firebase/jssdk-changeset-approvers @firebase/firestore-js-team @firebase/jssdk-global-approvers

.github/workflows/check-docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Doc Change Check (Run "yarn docgen devsite" if this fails)
2+
3+
on: pull_request
4+
5+
jobs:
6+
doc-check:
7+
name: Check if reference docs have changed
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout Repo
12+
uses: actions/checkout@master
13+
with:
14+
# get all history for the diff
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: Yarn install
21+
run: yarn
22+
- name: Run doc generation (devsite docs)
23+
run: yarn docgen devsite
24+
- name: Check for changes in docs-devsite dir (fail if so)
25+
run: git diff --exit-code docs-devsite
26+
- name: Reference documentation needs to be updated. See message below.
27+
if: ${{ failure() }}
28+
run: echo "Changes in this PR affect the reference docs. Run \`yarn docgen devsite\` locally to regenerate docs and add them to this PR."

.github/workflows/label-doc-changes.yml

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

docs-devsite/firestore_.aggregatefield.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export declare class AggregateField<T>
2222

2323
| Property | Modifiers | Type | Description |
2424
| --- | --- | --- | --- |
25-
| [type](./firestore_.aggregatefield.md#aggregatefieldtype) | | string | A type string to uniquely identify instances of this class. |
25+
| [type](./firestore_.aggregatefield.md#aggregatefieldtype) | | (not declared) | A type string to uniquely identify instances of this class. |
2626

2727
## AggregateField.type
2828

@@ -31,5 +31,5 @@ A type string to uniquely identify instances of this class.
3131
<b>Signature:</b>
3232

3333
```typescript
34-
type: string;
34+
readonly type = "AggregateField";
3535
```

docs-devsite/firestore_.aggregatespec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# AggregateSpec interface
13-
A type whose property values are all `AggregateField` objects.
13+
Specifies a set of aggregations and their aliases.
1414

1515
<b>Signature:</b>
1616

docs-devsite/firestore_.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ https://github.com/firebase/firebase-js-sdk
134134

135135
| Interface | Description |
136136
| --- | --- |
137-
| [AggregateSpec](./firestore_.aggregatespec.md#aggregatespec_interface) | A type whose property values are all <code>AggregateField</code> objects. |
137+
| [AggregateSpec](./firestore_.aggregatespec.md#aggregatespec_interface) | Specifies a set of aggregations and their aliases. |
138138
| [DocumentChange](./firestore_.documentchange.md#documentchange_interface) | A <code>DocumentChange</code> represents a change to the documents matching a query. It contains the document affected and the type of change that occurred. |
139139
| [DocumentData](./firestore_.documentdata.md#documentdata_interface) | Document data (for use with [setDoc()](./firestore_lite.md#setdoc)<!-- -->) consists of fields mapped to values. |
140140
| [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by <code>withConverter()</code> to transform user objects of type <code>T</code> into Firestore data.<!-- -->Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore. |
@@ -1946,7 +1946,7 @@ The union of all `AggregateField` types that are supported by Firestore.
19461946
<b>Signature:</b>
19471947

19481948
```typescript
1949-
export declare type AggregateFieldType = AggregateField<number>;
1949+
export declare type AggregateFieldType = AggregateField<number | null>;
19501950
```
19511951

19521952
## AggregateSpecData

docs-devsite/firestore_lite.aggregatefield.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export declare class AggregateField<T>
2222

2323
| Property | Modifiers | Type | Description |
2424
| --- | --- | --- | --- |
25-
| [type](./firestore_lite.aggregatefield.md#aggregatefieldtype) | | string | A type string to uniquely identify instances of this class. |
25+
| [type](./firestore_lite.aggregatefield.md#aggregatefieldtype) | | (not declared) | A type string to uniquely identify instances of this class. |
2626

2727
## AggregateField.type
2828

@@ -31,5 +31,5 @@ A type string to uniquely identify instances of this class.
3131
<b>Signature:</b>
3232

3333
```typescript
34-
type: string;
34+
readonly type = "AggregateField";
3535
```

docs-devsite/firestore_lite.aggregatespec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# AggregateSpec interface
13-
A type whose property values are all `AggregateField` objects.
13+
Specifies a set of aggregations and their aliases.
1414

1515
<b>Signature:</b>
1616

docs-devsite/firestore_lite.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ https://github.com/firebase/firebase-js-sdk
108108

109109
| Interface | Description |
110110
| --- | --- |
111-
| [AggregateSpec](./firestore_lite.aggregatespec.md#aggregatespec_interface) | A type whose property values are all <code>AggregateField</code> objects. |
111+
| [AggregateSpec](./firestore_lite.aggregatespec.md#aggregatespec_interface) | Specifies a set of aggregations and their aliases. |
112112
| [DocumentData](./firestore_lite.documentdata.md#documentdata_interface) | Document data (for use with [setDoc()](./firestore_lite.md#setdoc)<!-- -->) consists of fields mapped to values. |
113113
| [FirestoreDataConverter](./firestore_lite.firestoredataconverter.md#firestoredataconverter_interface) | Converter used by <code>withConverter()</code> to transform user objects of type <code>T</code> into Firestore data.<!-- -->Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore. |
114114
| [Settings](./firestore_lite.settings.md#settings_interface) | Specifies custom configurations for your Cloud Firestore instance. You must set these before invoking any other methods. |
@@ -1277,7 +1277,7 @@ The union of all `AggregateField` types that are supported by Firestore.
12771277
<b>Signature:</b>
12781278

12791279
```typescript
1280-
export declare type AggregateFieldType = AggregateField<number>;
1280+
export declare type AggregateFieldType = AggregateField<number | null>;
12811281
```
12821282

12831283
## AggregateSpecData

packages/database-compat/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
},
3131
"./standalone": {
3232
"types": "./dist/database-compat/src/index.standalone.d.ts",
33-
"node": "./dist/index.standalone.js"
33+
"node": "./dist/index.standalone.js",
34+
"default": "./dist/index.standalone.js"
3435
},
3536
"./package.json": "./package.json"
3637
},

packages/firestore-compat/test/validation.test.ts

Lines changed: 0 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -901,47 +901,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
901901
}
902902
);
903903

904-
validationIt(persistence, 'with multiple array filters fail', db => {
905-
expect(() =>
906-
db
907-
.collection('test')
908-
.where('foo', 'array-contains', 1)
909-
.where('foo', 'array-contains', 2)
910-
).to.throw(
911-
"Invalid query. You cannot use more than one 'array-contains' filter."
912-
);
913-
914-
expect(() =>
915-
db
916-
.collection('test')
917-
.where('foo', 'array-contains', 1)
918-
.where('foo', 'array-contains-any', [2, 3])
919-
).to.throw(
920-
"Invalid query. You cannot use 'array-contains-any' filters with " +
921-
"'array-contains' filters."
922-
);
923-
924-
expect(() =>
925-
db
926-
.collection('test')
927-
.where('foo', 'array-contains-any', [2, 3])
928-
.where('foo', 'array-contains', 1)
929-
).to.throw(
930-
"Invalid query. You cannot use 'array-contains' filters with " +
931-
"'array-contains-any' filters."
932-
);
933-
934-
expect(() =>
935-
db
936-
.collection('test')
937-
.where('foo', 'not-in', [2, 3])
938-
.where('foo', 'array-contains', 1)
939-
).to.throw(
940-
"Invalid query. You cannot use 'array-contains' filters with " +
941-
"'not-in' filters."
942-
);
943-
});
944-
945904
validationIt(persistence, 'with != and not-in filters fail', db => {
946905
expect(() =>
947906
db
@@ -963,13 +922,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
963922
});
964923

965924
validationIt(persistence, 'with multiple disjunctive filters fail', db => {
966-
expect(() =>
967-
db
968-
.collection('test')
969-
.where('foo', 'in', [1, 2])
970-
.where('foo', 'in', [2, 3])
971-
).to.throw("Invalid query. You cannot use more than one 'in' filter.");
972-
973925
expect(() =>
974926
db
975927
.collection('test')
@@ -979,36 +931,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
979931
"Invalid query. You cannot use more than one 'not-in' filter."
980932
);
981933

982-
expect(() =>
983-
db
984-
.collection('test')
985-
.where('foo', 'array-contains-any', [1, 2])
986-
.where('foo', 'array-contains-any', [2, 3])
987-
).to.throw(
988-
"Invalid query. You cannot use more than one 'array-contains-any'" +
989-
' filter.'
990-
);
991-
992-
expect(() =>
993-
db
994-
.collection('test')
995-
.where('foo', 'array-contains-any', [2, 3])
996-
.where('foo', 'in', [2, 3])
997-
).to.throw(
998-
"Invalid query. You cannot use 'in' filters with " +
999-
"'array-contains-any' filters."
1000-
);
1001-
1002-
expect(() =>
1003-
db
1004-
.collection('test')
1005-
.where('foo', 'in', [2, 3])
1006-
.where('foo', 'array-contains-any', [2, 3])
1007-
).to.throw(
1008-
"Invalid query. You cannot use 'array-contains-any' filters with " +
1009-
"'in' filters."
1010-
);
1011-
1012934
expect(() =>
1013935
db
1014936
.collection('test')
@@ -1046,51 +968,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
1046968
).to.throw(
1047969
"Invalid query. You cannot use 'not-in' filters with 'in' filters."
1048970
);
1049-
1050-
// This is redundant with the above tests, but makes sure our validation
1051-
// doesn't get confused.
1052-
expect(() =>
1053-
db
1054-
.collection('test')
1055-
.where('foo', 'in', [2, 3])
1056-
.where('foo', 'array-contains', 1)
1057-
.where('foo', 'array-contains-any', [2])
1058-
).to.throw(
1059-
"Invalid query. You cannot use 'array-contains-any' filters with 'in' filters."
1060-
);
1061-
1062-
expect(() =>
1063-
db
1064-
.collection('test')
1065-
.where('foo', 'array-contains', 1)
1066-
.where('foo', 'in', [2, 3])
1067-
.where('foo', 'array-contains-any', [2])
1068-
).to.throw(
1069-
"Invalid query. You cannot use 'array-contains-any' filters with " +
1070-
"'array-contains' filters."
1071-
);
1072-
1073-
expect(() =>
1074-
db
1075-
.collection('test')
1076-
.where('foo', 'not-in', [2, 3])
1077-
.where('foo', 'array-contains', 2)
1078-
.where('foo', 'array-contains-any', [2])
1079-
).to.throw(
1080-
"Invalid query. You cannot use 'array-contains' filters with " +
1081-
"'not-in' filters."
1082-
);
1083-
1084-
expect(() =>
1085-
db
1086-
.collection('test')
1087-
.where('foo', 'array-contains', 2)
1088-
.where('foo', 'in', [2])
1089-
.where('foo', 'not-in', [2, 3])
1090-
).to.throw(
1091-
"Invalid query. You cannot use 'not-in' filters with " +
1092-
"'array-contains' filters."
1093-
);
1094971
});
1095972

1096973
validationIt(
@@ -1110,24 +987,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
1110987
.where('foo', 'in', [2, 3])
1111988
.where('foo', 'array-contains', 1)
1112989
).not.to.throw();
1113-
1114-
expect(() =>
1115-
db
1116-
.collection('test')
1117-
.where('foo', 'in', [2, 3])
1118-
.where('foo', 'array-contains', 1)
1119-
.where('foo', 'array-contains', 2)
1120-
).to.throw(
1121-
"Invalid query. You cannot use more than one 'array-contains' filter."
1122-
);
1123-
1124-
expect(() =>
1125-
db
1126-
.collection('test')
1127-
.where('foo', 'array-contains', 1)
1128-
.where('foo', 'in', [2, 3])
1129-
.where('foo', 'in', [2, 3])
1130-
).to.throw("Invalid query. You cannot use more than one 'in' filter.");
1131990
}
1132991
);
1133992

@@ -1146,29 +1005,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
11461005
"'array-contains-any' filters."
11471006
);
11481007

1149-
expect(() =>
1150-
db
1151-
.collection('test')
1152-
// The 10 element max includes duplicates.
1153-
.where('foo', 'in', [1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9])
1154-
).to.throw(
1155-
"Invalid Query. 'in' filters support a maximum of 10 elements in " +
1156-
'the value array.'
1157-
);
1158-
1159-
expect(() =>
1160-
db
1161-
.collection('test')
1162-
.where(
1163-
'foo',
1164-
'array-contains-any',
1165-
[1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9]
1166-
)
1167-
).to.throw(
1168-
"Invalid Query. 'array-contains-any' filters support a maximum of " +
1169-
'10 elements in the value array.'
1170-
);
1171-
11721008
expect(() => db.collection('test').where('foo', 'in', [])).to.throw(
11731009
"Invalid Query. A non-empty array is required for 'in' filters."
11741010
);

0 commit comments

Comments
 (0)