Skip to content
This repository has been archived by the owner on Apr 19, 2019. It is now read-only.

Firebase introduces Cloud Firestore #117

Closed
songololo opened this issue Oct 3, 2017 · 20 comments
Closed

Firebase introduces Cloud Firestore #117

songololo opened this issue Oct 3, 2017 · 20 comments

Comments

@songololo
Copy link

Firebase has released Cloud Firestore which looks to be a significant improvement over the current Realtime Database.

Hopefully, this can be incorporated into Vuexfire?

Related issue at vuejs/vuefire#131

@posva
Copy link
Owner

posva commented Oct 3, 2017

yes, it's something I'll look into and see how to add it

@1337huania
Copy link

1337huania commented Nov 10, 2017

Hey, @posva!

Is there any news about firestore integration in to vuexfire?

@posva
Copy link
Owner

posva commented Nov 12, 2017

Hello, the truth is I got most working a month ago with vuefire but due to personal matters, I couldn't push it forward. I'll get a release for both, vuefire and vuexfire, before 2018 for sure 🙂
The first version will not be complete because firestore has more features, for example, you can add a reference to another document (and I think also collection) inside of a document. This is something I want to add without impacting people not using refs

@bmass02
Copy link
Contributor

bmass02 commented Nov 28, 2017

@posva Would you mind making a branch with those changes? I had started integrating Firestore into vuexfire for my personal use, but ran into some issues with the npm package used for testing not up to date with the Firestore Reference docs. Also, I would like to start testing out the new feature.

@posva
Copy link
Owner

posva commented Nov 28, 2017

It's something I'll add as soon as I can. I don't understand the not up to date with the Firestore Rference docs. They look fine to me

@bmass02
Copy link
Contributor

bmass02 commented Nov 28, 2017

When trying to write tests for vuexfire, I ran into some problems with the Firestore version for web here (I believe the error was something about not being able to load a file; maybe it was just my machine). So I looked at using the NodeJS version here, but that code doesn't meet the reference docs. One specific instance that I ran into was the lack of an options parameter for onSnapshot (here).

Anyways, I'd love to test/use your integration of Firestore. I'll be eagerly awaiting that push. Thanks again for this awesome software!

@posva
Copy link
Owner

posva commented Nov 28, 2017

Oh, if you want to check some existing code you can already check the firestore branch of vuefire

@posva
Copy link
Owner

posva commented Jan 10, 2018

Hello! I ended up working a lot on vuefire before releasing a working version for vuexfire that's why it took so long, good news are it has almost all the features I wanted to add. I just released an alpha version, it supports everything the alpha version of vuefire supports

If you want to try v3.0.0-alpha.0 you can install it with the next tag: npm i vuexfire@next. I will really like to have some testers 🙂
The API didn't change but it now only works with firestore, you can find some examples in the examples folder just in case.

@aspben
Copy link

aspben commented Jan 23, 2018

I modified the demo fiddle to use firestore for those interested : https://jsfiddle.net/c4m4c940/

It's working!

Let me know if there is unnecessary code. Or beginner mistake. Only way i got firestore working was by adding another script tag pointing to firestore.

Thank for making this. I will use it in my app for sure!

@iamareebjamal
Copy link

Just notifying that the options callbacks aren't working right now for firestore

https://jsfiddle.net/mvwcqt43/

I kind of need the document snapshot for collections when they are loaded because pagination in firestore requires that as a param in startAfter and similar methods

@iamareebjamal
Copy link

Also, timestamp fields are being bound as empty objects for some reason.

@posva
Copy link
Owner

posva commented Feb 13, 2018

They return promises now, so no need for callbacks 😉

@iamareebjamal
Copy link

Thanks, it'd be great if you take a look at the timestamp issue

@posva
Copy link
Owner

posva commented Feb 13, 2018

Yes, I will. I saw it already on vuefire, non-plain objects are not converted correctly 😓 . Created #144 for that

@bmass02
Copy link
Contributor

bmass02 commented Feb 16, 2018

@posva Is there a reason you didn't use the functionality from the RTDB version for the Firestore version? I just created the same styled functionality for Firestore that RTDB had (bindings, creating snapshots, etc.). All objects were correctly converted (by Firebase) and just needed to be set to the store. Here is my version of Vuexfire with Firestore added: https://github.com/bmass02/vuexfire/tree/add-firestore-support. I've been using it for the past 3 months without any troubles. Also, I'd be happy to help with getting the Firestore version to production if you're looking for help.

@posva
Copy link
Owner

posva commented Feb 19, 2018

I simply wanted to change too many things to reuse some of the functions

@classikd
Copy link

Thanks it works well and helps me a lot.
But I hope someone will find why that timestamp issue occurs.. :')

@xupateste
Copy link

Awesome! it works! you are a genius bro

@yoonwaiyan
Copy link

Hi, just wondering is there anything missing as I'm testing out the Firestore branch but didn't get to make it work :( This is my script:

<script>
import { dbExpensesRef } from './firebaseConfig';

console.log('dbExpenses', dbExpensesRef);

export default {
  created() {
    this.$store.dispatch('setExpensesRef', dbExpensesRef);
  }
};
</script>

in my firebaseConfig I have the ref set up:

const firebaseDB = firebaseApp.firestore();
// ...
const dbExpensesRef = firebaseDB.collection('expenses');

export { firebaseApp, dbExpensesRef };

but I saw this error in my console log instead:
screen shot 2018-07-07 at 2 30 01 pm

apparently the ref is there but it's undefined in the script. Am I missing out anything?

@posva
Copy link
Owner

posva commented Dec 6, 2018

Firestore has been supported for a long time now.
To track the roadmap check vuejs/vuefire#145

@posva posva closed this as completed Dec 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants