Skip to content

[cloud_firestore] step 2 in landing FieldValue equality comparison (web) #2062

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

Merged
merged 25 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
12ed4e2
Adds equality comparison to FieldValue
collinjackson Feb 25, 2020
3c40bc5
remove iOS files not intended to be changed
collinjackson Feb 25, 2020
709318e
Update CHANGELOG
collinjackson Feb 25, 2020
3200d39
Avoid a breaking change in the platform interface per suggestion from…
collinjackson Feb 25, 2020
b337942
Code review feedback
collinjackson Feb 25, 2020
0f7ab04
Fix test failures
collinjackson Feb 26, 2020
3531ed5
Remove assert
collinjackson Feb 26, 2020
c00e23c
Update comment
collinjackson Feb 26, 2020
048f545
Simplify FieldValue slightly
collinjackson Feb 26, 2020
92410e5
Reformat
collinjackson Feb 26, 2020
42ae413
Add deprecation warning
collinjackson Feb 26, 2020
3ea2d4b
Temporarily land path dependencies so that tests will pass
collinjackson Feb 26, 2020
7de25a0
Reformat
collinjackson Feb 26, 2020
c200793
Remove unused imports
collinjackson Feb 26, 2020
8bee0d8
Alas, the generic version is a breaking change. Leaving it as dynamic…
collinjackson Feb 26, 2020
4b71c23
Remove type argument from FieldValueFactoryWeb
collinjackson Feb 26, 2020
824c3e4
Reformat
collinjackson Feb 26, 2020
2396a83
Fix grammar in comment
collinjackson Feb 26, 2020
95aff27
Tweak comment
collinjackson Feb 26, 2020
f3177f5
update to published version
collinjackson Feb 26, 2020
5644e78
remove cloud_firestore changes
collinjackson Feb 26, 2020
e981445
Switch to using a caret for platform interface dependency.
collinjackson Feb 26, 2020
5587e4c
Fix spelling
collinjackson Feb 26, 2020
39789ce
Fix CHANGELOG
collinjackson Feb 26, 2020
83d0c09
Merge remote-tracking branch 'origin/master' into fieldvalue_equality_2
collinjackson Feb 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/cloud_firestore/cloud_firestore_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.1.1

* Support equality comparison of field values.
* `FieldValueWeb` no longer extends `FieldValuePlatform`.
* Updated platform interface dependency.

## 0.1.0+4

* Make the pedantic dev_dependency explicit.
Expand All @@ -16,4 +22,4 @@

## 0.1.0

- Initial release
- Initial release
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ import 'package:cloud_firestore_web/src/field_value_web.dart';
/// instance that is [jsify] friendly
class FieldValueFactoryWeb extends FieldValueFactoryPlatform {
@override
FieldValuePlatform arrayRemove(List elements) =>
FieldValueWeb arrayRemove(List elements) =>
FieldValueWeb(web.FieldValue.arrayRemove(elements));

@override
FieldValuePlatform arrayUnion(List elements) =>
FieldValueWeb arrayUnion(List elements) =>
FieldValueWeb(web.FieldValue.arrayUnion(elements));

@override
FieldValuePlatform delete() => FieldValueWeb(web.FieldValue.delete());
FieldValueWeb delete() => FieldValueWeb(web.FieldValue.delete());

@override
FieldValuePlatform increment(num value) =>
FieldValueWeb increment(num value) =>
FieldValueWeb(web.FieldValue.increment(value));

@override
FieldValuePlatform serverTimestamp() =>
FieldValueWeb serverTimestamp() =>
FieldValueWeb(web.FieldValue.serverTimestamp());
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ import 'package:firebase/firestore.dart' as web;

/// Implementation of [FieldValuePlatform] that is compatible with
/// firestore web plugin
class FieldValueWeb extends FieldValuePlatform {
class FieldValueWeb {
/// The js-interop delegate for this [FieldValuePlatform]
web.FieldValue data;

/// Constructs a web version of [FieldValuePlatform] wrapping a web [FieldValue].
FieldValueWeb(this.data) : super();
FieldValueWeb(this.data);

@override
bool operator ==(dynamic other) =>
other is FieldValueWeb && other.data == data;

@override
int get hashCode => data.hashCode;
}
4 changes: 2 additions & 2 deletions packages/cloud_firestore/cloud_firestore_web/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: cloud_firestore_web
description: The web implementation of cloud_firestore
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/cloud_firestore/cloud_firestore_web
version: 0.1.0+4
version: 0.1.1

flutter:
plugin:
Expand All @@ -19,7 +19,7 @@ dependencies:
http_parser: ^3.1.3
meta: ^1.1.7
firebase_core: ^0.4.3+1
cloud_firestore_platform_interface: "^1.0.0"
cloud_firestore_platform_interface: ^1.1.0
js: ^0.6.1

dev_dependencies:
Expand Down