Skip to content

[cloud_firestore] migrate to platform interface #1945

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

amrfarid140
Copy link
Contributor

Description

Migrate cloud_firestore to use cloud_firestore_platform_interface

Related Issues

This is part of the changes mentioned in this PR.

It is a follow-up of an the following merged [PR] (#1686)

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.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • If the pull request affects only one plugin, the PR title starts with the name of the plugin in brackets (e.g. [cloud_firestore])
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

- Migrated DocumentReference and CollectionReference to use interfaces
- added where support
- fixed test failure causes
- use any as versions
Created FieldValueFactory to provide platform-specific FieldValue instances
Added NO-OP folders for android & ios in firestore web package
- Removed unnecessary tracking of collection reference delegate and used the more generic query type instead
- fixed breakage
ditman and others added 10 commits February 3, 2020 17:36
Rename SnapshotMetadata and DocumentSnapshot in PlatformInterface to
SnapshotMetadataPlatform and DocumentSnapshotPlatform so they don't
collide with class names exported by the core plugin.
* Web doesn't need it, it can delegate all that logic to the JS client.
* It's only required for MethodChannel. Move it to method_channel/utils.
This change exposes the FieldValuePlatform abstract class to plugin
users, so they can have a way of typing the result of calling the
FieldValue.whatever() methods, without having to keep an internal
'instance' as part of the exposed interface.
Refactor tests and code around the new API.
Changed from FlutterFire Maintainers
@ditman ditman merged commit 1b45082 into firebase:master Feb 6, 2020
@ditman
Copy link
Contributor

ditman commented Feb 6, 2020

Tagged and published cloud_firestore 0.13.1!

@tecbot
Copy link

tecbot commented Feb 15, 2020

This PR introduced a breaking change which is not documented. Before the PR it was possible to add data to the data property in DocumentSnapshot. E.g. we have added the documentID to the data object before calling fromJson methods. Maybe it was not the safest way to do it like this but i could imagine some others have done it as well. Now the data object gets always computed new if accessing so we lost the previously changed data:
1b45082#diff-fe42784719077ee49f318229149be8e7R23

Maybe this should be highlighted.

@collinjackson
Copy link
Contributor

Thanks @tecbot. You're absolutely right that this is confusing, and I've filed #2007 to address it.

@byrek3d
Copy link

byrek3d commented May 3, 2020

Any news on supporting Realtime Database as well?

@ditman
Copy link
Contributor

ditman commented May 4, 2020

@byrek3d work started (but seems to be stalled) here. Your contribution would be very welcome! :D

@firebase firebase locked and limited conversation to collaborators Aug 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants