I've been working with Firestore and firestoreConnect in the latest v2 (rc1) and it would be great to get "populate" functionality working with Firestore.
I see that firesoreConnect is using redux-firebase's setListeners function. I also checked out the Firebase functions for watchEvent, promisesForPopulate, and the utils/populate.js file. The functionality for Firebase populates is pretty comprehensive.
I think we can use most of the functions in utils/populate.js and update the getPopulateChild function to work with Firestore. But perhaps the best approach will be handling populates within redux-firebase library.
@prescottprue Did you have any particular approach for this planned yet? I'd be happy to take a stab at it if you can point me in the right direction.
Aware of the fact that this is wanted, but haven't started on it yet.
Like you are saying, most of the utils used with redux/connect should work the same, but setListener within redux-firestore will need support for creating other listeners associated with population (similar to how watchEvent does now).
If you have the time to work on it, that would be great! I would start by adding something like promisesForPopulate to the then block of setListener. If you do end up starting, feel free to reach out if you wanted to talk about implementation.
Hi @JeremyPlease
Do you have any example project, maybe on github, with a documented sample model structure, where i could join working on it?
Hey @ralcon
I haven't had a chance to dive into this yet. And, unfortunately, I don't have any public example data to work with right now. If you start working on this, please update this issue.
Are there any updates for this feature?
Any Updates for this features :D ?
I'm not able to work on this at the moment. But I hope that someone else can implement it given the details in this issue 馃槂
Hey folks! I have been working on overhauling the state storage as part of v1.0.0 on the alpha branch. I can also look into adding populate. Honestly I had forgotten that this wasn't already in.
Thanks to everyone for the pings/posts. It is really helpful in understanding which features people want most.
Here is the issue on redux-firestore tracking this feature.
Work on this has been started for this and it will most likely make it into v0.6.0-* pre-releases since it will only be enabled when passing populates to your queries. While getting things working, I have still been pulling populate from react-redux-firebase, but the plan is to make it available in redux-firestore as well.
This is a huge feature for me and I would love to see it implemented. Would you be able to update this thread with details when they are available as I am literally champing at the bit to use this functionality!
Thanks for your work on the lib, it's a great toolkit!
@MattJakeman Good to know that it is wanted so bad. The initial swing is really close, just need to test a bit more, but it should be out this week like I was saying.
If you are using yarn you may be able to install directly from the github branch mentioned above.
@prescottprue That's fantastic. Thanks for that. Looking forward to getting back on that project shortly and giving it a try!
@MattJakeman Perfect timing!
I actually just published as part of v0.6.0-alpha.3 a second ago 馃嵕
Here are the docs: https://github.com/prescottprue/redux-firestore/tree/next#population. It is basically a direct port over from react-redux-firebase, and you actually still pull populate (used to construct state with data loaded form populates) from react-redux-firebase.
Going to close this for now since it is in pre-release, but I'll still update this thread when releasing it to latest. Everyone should feel free to reach out (either here or over gitter) if anything isn't working as expected or just to say "It works!"
Typical that I'm on another project today... Will hopefully be able to give it a try tonight. Thanks again!
Just had a really quick try at pulling in with :
yarn add prescottprue/redux-firestore#next
But it has pulled in [email protected] which I am presuming is the tagged version. Am I doing something stupid? Not really used yarn with git repo's before..
EDIT : The Commit has seemed to work :+1:
@MattJakeman The repo reference isn't necessary anymore since it has been published to npm. You should be able to install directly with yarn add redux-firestore@next or npm i --save redux-firestore@next. This will install whatever is tag as next (like you mentioned, that is currently 0.6.0-alpha.3) and add it to your package file.
@prescottprue Thanks Scott. I'd missed the publish to npm somehow so I have it pulled in now. It doesn't seem to be populating the data for me at the moment, but that is quite likely a late night problem...
Most helpful comment
Are there any updates for this feature?