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
WIP: RTDB Swift Combine #7544
WIP: RTDB Swift Combine #7544
Conversation
Hi @mortenbekditlevsen - sorry for closing this. We were expecting any in-flight PRs to automatically retarget to Can you do this manually, and re-open the PR? Thanks, |
I reopened and changed the base branch to master. Make sure you resync the local branch. |
07e00bc
to
f889a83
Compare
I force pushed a commit that just contains the additions that were originally made on this branch. It had become too hard to clean up. |
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 generally looking good!
I just have a few nit-picky comments/questions. My Combine intuition isn't yet developed enough for the naming questions. Maybe @peterfriese has some suggestions?
- I believe
@available
checks are needed to build. See https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseCombineSwift/Sources/Auth/Auth%2BCombine.swift#L15
FirebaseCombineSwift/Tests/Unit/Database/DatabaseReferenceTests.swift
Outdated
Show resolved
Hide resolved
FirebaseTestingSupport/Database/Tests/DatabaseReferenceFakeTests.swift
Outdated
Show resolved
Hide resolved
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 added some thoughts to the naming discussion, but would like to hear @ryanwilson's opinion as well.
Also, some doc comments are missing.
FirebaseCombineSwift/Sources/Database/DatabaseReference+Combine.swift
Outdated
Show resolved
Hide resolved
FirebaseCombineSwift/Sources/Database/DatabaseReference+Combine.swift
Outdated
Show resolved
Hide resolved
FirebaseCombineSwift/Sources/Database/DatabaseReference+Combine.swift
Outdated
Show resolved
Hide resolved
FirebaseCombineSwift/Sources/Database/DatabaseReference+Combine.swift
Outdated
Show resolved
Hide resolved
Latest commit addresses the latest batch of comments regarding doc comments and adds an overload of |
Question: #6940 uses I initially modeled Should we unify this behavior? |
What are the advantages and disadvantages of the two different API styles? |
The most important thing is of course the consistency, since the difference between the two is so small. If I should argue for my favorite ( It's subtle and I'd say that most people would be ok with either choice. :-) I also personally like the equality between:
(Even though the returned void in the last case would not be spelled out...) |
@mortenbekditlevsen Given the minor differences, I'm fine going with your preference. If something compelling comes up in the future, we can change then. |
SGTM as well, apologies for the delay in response. |
@paulb777 Is this PR still relevant for the Swift Modernisation efforts? It's marked as 'Changes requested', but I can't find any concrete suggestions that are not already addressed. |
@mortenbekditlevsen Sorry for losing track of this PR. It looks like it needs to be rebased or merged with master. @peterfriese Do you see anything else to resolve before merging? Combine is not in scope for the Swift Modernization first phase, but we'd like to continue working with the community on it. |
I'd like to see some sample snippets added to FirebaseCombineSwift/README.md. Also - if possible - it'd be great to add a sample screen to the SwiftUI example app at Example/CombineSample. Morten - any chance you could add these? If you're pressed for time, we can merge this and add sample code later. |
public extension DatabaseReference { | ||
// MARK: - Setting values on a DatabaseReference | ||
|
||
/** |
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.
For new Swift code, we've been using triple-slash comments, see https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseCombineSwift/Sources/Firestore/CollectionReference%2BCombine.swift#L31, for example.
Can you update all comments in this PR accordingly?
@@ -5,7 +5,7 @@ | |||
|
|||
Pod::Spec.new do |s| | |||
s.name = 'FirebaseDatabaseSwift' | |||
s.version = '7.9.0-beta' | |||
s.version = '8.0.0-beta' |
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.
Needs to be updated.
/// written to the server. This block will not be called while | ||
/// the client is offline, though local changes will be visible | ||
/// immediately. | ||
/** Encode an `Encodable` instance and write it to this Firebase Database location. |
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.
Comment style
s.summary = 'Firebase SDKs testing support types and utilities.' | ||
|
||
s.description = <<-DESC | ||
Type declarations and utilities needed for unit testing of the code dependent on Firebase SDKs |
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.
Make sure to add info that the podspecs are just there for testing. See 397215b#diff-221380d0cac6c2109a93596f5086bc8691024208216ff59d18546a8162162550R7
Hey @mortenbekditlevsen, I'm going to close this as it hasn't been discussed for >1.5 years and async/await and |
I agree that that is a good idea. 😊 I could look into extensions for returning async sequences or an Observable model wrapper type. I’m experimenting with a |
This is basically a merge of two other works-in-progress: #6976 and #6568
Just so that we have a place to start experimenting with RTDB/Combine.