Skip to content
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

Firestore (Android) #162

Open
natario1 opened this issue May 15, 2020 · 1 comment
Open

Firestore (Android) #162

natario1 opened this issue May 15, 2020 · 1 comment

Comments

@natario1
Copy link

natario1 commented May 15, 2020

Link to project (GitHub): https://github.com/natario1/Firestore

Describe the project in 2-3 sentences: A lightweight, efficient library to manage Firestore model data as reactive, observable objects that adapt to your Firestore schema and provide type safety and efficiency. Written in Kotlin, with built-in data-binding and Parcelable support.

Why would Firebase developers be interested in this project?: The library is a needed companion to the official Firestore SDK. It uses annotation processing to generate type-safe, null-safe, efficient (no reflection) objects around your Firestore model. It leverages Kotlin syntax, so declaring a property is as simple as var name: String by this.

Controlling the model class lets the engine do many things much more efficiently, for example:

  • parsing data from snapshot: the library will cache and reuse as many objects as possible, plus use generated setters instead of reflection
  • saving data to server: saves time and bandwidth by keeping track of dirty fields and uploading them, instead of the whole object.

In addition, each model class automatically offers a @Parcelable implementation and it works with Android's databinding out of the box, by simply declaring fields as bindable:

@FirestoreClass
class Message : FirestoreDocument() {
    // You can use {message.text} and {message.comment} in XML layouts
    // and they will be updated automatically when the model changes.
    @get:Bindable var text: String by this
    @get:Bindable var author: String by this
}
@samtstern
Copy link
Contributor

@natario1 looks great! Happy to add this to the site. Just add an .opensource/project.json file to your project, I suggest looking at other firebasopensource projects for examples.

Also when making that file try to pick a more descriptive name than 'Firestore' so that Firebase developers can tell your library apart from otherrs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants