-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat(cloud_firestore): experimental setIndexConfiguration()
API
#9928
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
// Only when back online will this trigger | ||
controller.add(true); | ||
}); | ||
test( |
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 updated this file so that web is skipped for each individual e2e test rather than for the entire file hence why it looks like a lot of changes.
skip: kIsWeb, | ||
); | ||
|
||
test('setIndexConfiguration()', () 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.
This is the integration test for setIndexConfiguration()
.
/// The index entries themselves are created asynchronously. You can continue to use queries that | ||
/// require indexing even if the indices are not yet available. Query execution will automatically | ||
/// start using the index once the index entries have been written. | ||
Future<void> setIndexConfiguration({ |
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 use the experimental flag 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.
Good point, I think we should 👌
setIndexConfiguration()
APIsetIndexConfiguration()
API
Description
This feature allows users to set index configurations on cached data when querying offline. This is aimed at improving query speed when offline.
It follows the Cloud Firestore Definition Index set out here.
All platforms expect a JSON string following the above definition. If JSON string is in the incorrect format, it will throw an error.
I have created an index definition file with the relevant classes that correspond to the above definition to make it easy to construct the correct JSON string.
I have updated the inline documentation, but we don't have control over Firestore documentation on the main website. We need to raise this in the next meeting.
Related Issues
See this discussion: #9913
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).This will ensure a smooth and quick review process. Updating the
pubspec.yaml
and changelogs is not required.///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?