Skip to content

Commit fc0362f

Browse files
committed
Merge branch 'master' into feature-firebaseserverapp
2 parents 3037b86 + 9ea0e3b commit fc0362f

File tree

69 files changed

+433
-177
lines changed

Some content is hidden

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

69 files changed

+433
-177
lines changed

.changeset/cold-carpets-sing.md

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

.changeset/itchy-chicken-cry.md

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

.changeset/long-rats-walk.md

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

.changeset/purple-cooks-explode.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/util': patch
3+
---
4+
5+
Fix isSafari() throwing on React Native

.changeset/quick-peas-guess.md

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

.changeset/shaggy-garlics-leave.md

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

.changeset/yellow-houses-happen.md

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

.github/workflows/check-changeset.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ jobs:
4747
yarn ts-node-script scripts/ci/check_changeset.ts
4848
id: check-changeset
4949
- name: Print changeset checker output
50-
run: echo "${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}"
50+
run: |
51+
cat << 'eof_delimiter_that_will_never_occur_in_CHANGESET_ERROR_MESSAGE'
52+
${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}
53+
eof_delimiter_that_will_never_occur_in_CHANGESET_ERROR_MESSAGE
5154
- name: Print blocking failure status
5255
run: echo "${{steps.check-changeset.outputs.BLOCKING_FAILURE}}"
5356
- name: Find Comment

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414

1515
name: Test Firestore
1616

17-
on: pull_request
17+
on:
18+
workflow_dispatch:
19+
pull_request:
1820

1921
env:
2022
artifactRetentionDays: 14
@@ -138,7 +140,7 @@ jobs:
138140
test-name: ["test:browser:nightly"]
139141
runs-on: ubuntu-latest
140142
needs: build
141-
if: ${{ needs.build.outputs.changed == 'true'}}
143+
if: ${{ github.event_name != 'pull_request' }}
142144
steps:
143145
- name: Set up Node (16)
144146
uses: actions/setup-node@v3

docs-devsite/firestore_.firestoredataconverter.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Converter used by `withConverter()` to transform user objects of type `AppModelT
1414

1515
Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.
1616

17+
In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as `symbol` and `bigint`<!-- -->), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement `FirestoreDataConverter` and register the converter with Firestore objects, such as `DocumentReference` or `Query`<!-- -->, to automatically convert `AppModel` to `DbModel` when storing into Firestore, and convert `DbModel` to `AppModel` when retrieving from Firestore.
18+
1719
<b>Signature:</b>
1820

1921
```typescript
@@ -24,15 +26,17 @@ export declare interface FirestoreDataConverter<AppModelType, DbModelType extend
2426

2527
| Method | Description |
2628
| --- | --- |
27-
| [fromFirestore(snapshot, options)](./firestore_.firestoredataconverter.md#firestoredataconverterfromfirestore) | Called by the Firestore SDK to convert Firestore data into an object of type <code>AppModelType</code>. You can access your data by calling: <code>snapshot.data(options)</code>.<!-- -->Generally, the data returned from <code>snapshot.data()</code> can be cast to <code>DbModelType</code>; however, this is not guaranteed as writes to the database may have occurred without a type converter enforcing this specific layout. |
29+
| [fromFirestore(snapshot, options)](./firestore_.firestoredataconverter.md#firestoredataconverterfromfirestore) | Called by the Firestore SDK to convert Firestore data into an object of type <code>AppModelType</code>. You can access your data by calling: <code>snapshot.data(options)</code>.<!-- -->Generally, the data returned from <code>snapshot.data()</code> can be cast to <code>DbModelType</code>; however, this is not guaranteed because Firestore does not enforce a schema on the database. For example, writes from a previous version of the application or writes from another client that did not use a type converter could have written data with different properties and/or property types. The implementation will need to choose whether to gracefully recover from non-conforming data or throw an error.<!-- -->To override this method, see . |
2830
| [toFirestore(modelObject)](./firestore_.firestoredataconverter.md#firestoredataconvertertofirestore) | Called by the Firestore SDK to convert a custom model object of type <code>AppModelType</code> into a plain JavaScript object (suitable for writing directly to the Firestore database) of type <code>DbModelType</code>. To use <code>set()</code> with <code>merge</code> and <code>mergeFields</code>, <code>toFirestore()</code> must be defined with <code>PartialWithFieldValue&lt;AppModelType&gt;</code>.<!-- -->The <code>WithFieldValue&lt;T&gt;</code> type extends <code>T</code> to also allow FieldValues such as [deleteField()](./firestore_.md#deletefield) to be used as property values. |
2931
| [toFirestore(modelObject, options)](./firestore_.firestoredataconverter.md#firestoredataconvertertofirestore) | Called by the Firestore SDK to convert a custom model object of type <code>AppModelType</code> into a plain JavaScript object (suitable for writing directly to the Firestore database) of type <code>DbModelType</code>. Used with [setDoc()](./firestore_.md#setdoc_ee215ad)<!-- -->, and with <code>merge:true</code> or <code>mergeFields</code>.<!-- -->The <code>PartialWithFieldValue&lt;T&gt;</code> type extends <code>Partial&lt;T&gt;</code> to allow FieldValues such as [arrayUnion()](./firestore_.md#arrayunion_7d853aa) to be used as property values. It also supports nested <code>Partial</code> by allowing nested fields to be omitted. |
3032

3133
## FirestoreDataConverter.fromFirestore()
3234

3335
Called by the Firestore SDK to convert Firestore data into an object of type `AppModelType`<!-- -->. You can access your data by calling: `snapshot.data(options)`<!-- -->.
3436

35-
Generally, the data returned from `snapshot.data()` can be cast to `DbModelType`<!-- -->; however, this is not guaranteed as writes to the database may have occurred without a type converter enforcing this specific layout.
37+
Generally, the data returned from `snapshot.data()` can be cast to `DbModelType`<!-- -->; however, this is not guaranteed because Firestore does not enforce a schema on the database. For example, writes from a previous version of the application or writes from another client that did not use a type converter could have written data with different properties and/or property types. The implementation will need to choose whether to gracefully recover from non-conforming data or throw an error.
38+
39+
To override this method, see .
3640

3741
<b>Signature:</b>
3842

0 commit comments

Comments
 (0)