Lightweight alternative to AngularFire

First of all, let me say that if you already use AngularFire and don’t have any issues with it, then you should probably continue doing so, as it is the official Angular library for Firebase.

Having said that, let’s see why you might consider an alternative: ng-firebase-lite.

AngularFire is a quite big library that wraps all or most API’s from Firebase SDK with a goal to make them easier to use in the Angular context and take advantage of RxJS power. ng-firebase-lite, on the other hand, doesn’t attempt to wrap any API’s, but just provides a convenient way to access Firebase SDK in a form of a simple FirebaseApp service that you can inject anywhere in your app.

In fact, it is almost not worth having a library at all, as it is so small (just one module) that you can just copy it to your project and have full control over how you work with Firebase SDK.

Now, the reasons why you might opt into this more lightweight approach might include:

  • Bundle size. As mentioned above, this library doesn’t add much on top of Firebase SDK, so the footprint is tiny.

All in all, I would say that personally for me the added convenience of observable API that AngularFire provides wasn’t worth the cost. From very beginning it seemed a little strange having a wrapper API on top of another “official” JavaScript API from Firebase SDK. It just seems that it is bound to having inconsistencies and all sorts of strange bugs.

If any of the above sounds familiar, go ahead and give ng-firebase-lite a try, or as I said above, the library is so tiny that you can just copy the code to you project and have full control over how you integrate Firebase into your app. The main point is to use Firebase SDK as directly as possible.

Programmer. Full stack, with a focus on UI. JavaScript/TypeScript, Angular, Node.js, .NET

Programmer. Full stack, with a focus on UI. JavaScript/TypeScript, Angular, Node.js, .NET