-
Notifications
You must be signed in to change notification settings - Fork 168
Firestore customizable encoding for where clauses and update methods #607
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
Open
Daeda88
wants to merge
29
commits into
GitLiveApp:master
Choose a base branch
from
splendo:feature/field-value-encoding
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
6251476
Moves ValueWithSerializer back into public API
Daeda88 6378db9
Merge branch 'master' into feature/public-ValueWithSerializer
nbransby 1c28ed3
Adding support for encoded queries
Daeda88 f682e3e
Merge remote-tracking branch 'origin/feature/public-ValueWithSerializ…
Daeda88 bf8680c
Add support for customizing encoding behaviour when updating Values a…
Daeda88 3fde0f5
Improves DSL for updating firestore references
Daeda88 dd19681
Merge remote-tracking branch 'GitLiveApp/master' into feature/field-v…
Daeda88 6e0a4de
Slight api format change for readability
Daeda88 c612f9c
Fixed some bugs and adding tests
Daeda88 90f870c
Added several tests to stabilize tests
Daeda88 431bdb8
Merge remote-tracking branch 'GitLiveApp/master' into feature/field-v…
Daeda88 1877b02
Merge remote-tracking branch 'GitLiveApp/master' into feature/field-v…
Daeda88 ebe3198
Merge remote-tracking branch 'GitLiveApp/master' into feature/field-v…
Daeda88 5332e61
Merge remote-tracking branch 'GitLiveApp/master' into feature/field-v…
Daeda88 4176fe6
Make builders abstract to allow for testing
Daeda88 a138c10
Revert "Make builders abstract to allow for testing"
Daeda88 a8904da
Merge remote-tracking branch 'GitLiveApp/master' into feature/field-v…
Daeda88 99806bb
PR remarks
Daeda88 012f958
Fixed broken test
Daeda88 818fe38
Disable QueryTest for android unit tests
Daeda88 0da0fd6
Merge remote-tracking branch 'GitLiveApp/master' into feature/field-v…
Daeda88 6d72b0d
Expanded documentation
Daeda88 ee34197
Refactored buildSettings variable to encodeNextWith cli
Daeda88 545eea2
Merge remote-tracking branch 'GitLiveApp/master' into feature/field-v…
Daeda88 59fb0fd
Use different encodeSettings approach
Daeda88 3a28cbe
Fixed actually getting values
Daeda88 cfb885b
Lint fix
Daeda88 2262309
Corrected Filter implementation
Daeda88 aceb6c1
Small bugfix on Filter
Daeda88 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@Daeda88 can you suggest a better name for this? I find buildSettings confusing in this context
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.
Good point. I've refactored it to a method called 'encodeNextWith'.
Usage:
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.
why not just add encodeWith as an optional arg to the
to
function?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.
Because then you'd have to add the same block to every call to 'to':
Just looks less clean in my opinion.
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.
yes thats not great either. But the
blockThatAffectsEverythingBelowIt {}
pattern doesn't feel that intuitive to me.What about
updateFields
taking the encode settings as optional arguments in addition to being able to pass them into the to function, so it would become:Although that does beg the question why not just have the encode settings as optional arguments in the
to
function also, making it simply:thoughts?
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.
so
withEncodeSettings
is just to restrict the settings to certain properties otherwise you can just set the encodeSettings at the root level? e.g: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.
Correct. You can set the encodeSettings directly in the root dsl as well. The
withEncodeSettings
block allows for setting custom settings that apply only to the values added within the block. Seems like the nicest way to me. Its flexible and relatively readable.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.
Yeah it's much better - I even think it's not necessary to also accept the settings as optional arguments to
updateFields
, so:becomes:
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.
Was already like that :)
Edit: I see I wrote the wrong pseudo code earlier, but it works like your last example now
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 update the readme with that latest syntax? In particular, setting the encode settings at root level