davecoates / rn-firebase-bridge

React Native Firebase Bridge
59 stars 8 forks source link

Good enough for production use? #22

Closed cmrichards closed 8 years ago

cmrichards commented 8 years ago

Is this library good enough for production use at the moment? How much of a work-in-progess is it in its current state?

Apologies if this isn't the right place to ask this, but I didn't know where else to ask.

Thanks!

davecoates commented 8 years ago

To my knowledge it hasn't been used in production so take that as you will. The API it self shouldn't change much from here on out except to extend it by adding missing functionality (eg. analytics functions, storage etc).

There's also some things I'm not sure about implementing - namely transactions for database. You can fall back to native code for this of course but it's a limitation. Most the other auth and database functionality is implemented.

If you don't need offline persistence or any of the other functionality the native iOS/Android SDK's offer that the web SDK does you'd be better off just using the official web SDK which now works with React Native (it didn't when I initially started this).

Having said all that in the end this is all just all a wrapper over the native SDK so in theory it's a reasonably safe bet that any issues can be relatively easily addressed. The main complication is that everything is async so some things don't map directly (this is why I'm not sure if implementing transaction support is possible). Another example is database forEach behaviour - we support stopping iteration by returning true same as native SDK but in our case we don't actually use the native forEach (you can't return if you need to call JS asynchronously). So we just manually iterate over children and stop iterating if true is returned. As to whether this matters I have no idea - possibly there's some implications for large collections in terms but I really don't know.

I'm using it for a project but it's early days so take that as you will.

Sorry if that's not much help!

cmrichards commented 8 years ago

Thanks for the response.

I'll think I'll just try it and see how it works. I'll only be using the basic auth and basic database features. It's the offline persistence that I really need that the web skd doesn't provide. It's a shame they haven't added this yet. According to them, it's browser fragmentation that's making the problem so hard to solve in JS, which makes sense, but I think they could at-least give us something to use in react-native.

davecoates commented 8 years ago

No worries, let me know if you have problems