-
Notifications
You must be signed in to change notification settings - Fork 928
Allow type T in WithFieldValue<T> #5675
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 detectedLatest commit: f2acddc The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Size Analysis ReportAffected Products
|
class ObjectWrapper<T> { | ||
withFieldValueT(value: WithFieldValue<T>): void { | ||
// eslint-disable-next-line no-console | ||
console.log(value); |
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.
Do we need to log here?
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.
Removed.
? T | ||
: T extends {} | ||
? { [K in keyof T]: WithFieldValue<T[K]> | FieldValue } | ||
: Partial<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.
Unrelated to this PR, but why do we allow Partial here? Does that mean a user can omit properties as long as they are nested?
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.
This should technically be never
. Fixed.
Binary Size ReportAffected SDKs
Test Logs |
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.
Found one typo, otherwise LGTM!
(Reviewing for Mark, who is out today)
.changeset/short-mice-itch.md
Outdated
'@firebase/firestore': minor | ||
--- | ||
|
||
Expanded `Firestore.WithFieldValue<T>` to include `T`. This allows developers to delegate `WithFieldValue<T>` inside a wrappers of type `T` to avoid exposing Firebase types beyond Firebase-specific logic. |
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.
I think "a wrappers" should just be "wrappers"
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. thanks for catching
Co-authored-by: Feiyang <[email protected]>
…dk into bc/withfieldvalue
Fixes #5661. Thanks @gustavohenke for proactively bringing up the fix!
This change allows developers to pass an object of type
T
intoWithFieldValue<T>
.