-
Notifications
You must be signed in to change notification settings - Fork 926
Add set() overrides to lite sdk #3291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset is good to goLatest commit: 4323e7e We got this. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Binary Size ReportAffected SDKs
Test Logs |
e1a25a0
to
9d8219b
Compare
packages/firestore/lite/index.d.ts
Outdated
@@ -45,6 +45,7 @@ export function setLogLevel(logLevel: LogLevel): void; | |||
|
|||
export interface FirestoreDataConverter<T> { | |||
toFirestore(modelObject: T): DocumentData; | |||
toFirestore(modelObject: Partial<T>, options: SetOptions): DocumentData; | |||
fromFirestore(snapshot: QueryDocumentSnapshot): T; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we explicitly type this as QueryDocumentSnapshot<DocumentData>
to make it easier to understand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
}); | ||
}); | ||
|
||
it('WriteBatch.set() supports partials with merge', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move these tests to https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/lite/test/integration.test.ts#L253, which allows you to write one test for WriteBatch, Transaction and set().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -45,6 +45,7 @@ export function setLogLevel(logLevel: LogLevel): void; | |||
|
|||
export interface FirestoreDataConverter<T> { | |||
toFirestore(modelObject: T): DocumentData; | |||
toFirestore(modelObject: Partial<T>, options: SetOptions): DocumentData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this change also need to be made in exp/index.d.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done for converter and SetOptions
.
9d8219b
to
906ac39
Compare
Setting the base as #3254 since it requires the changes to
applyFirestoreDataConverter
. Since this branch sits on top of #3254, I will diff this against master once #3254 goes in.