Angularfire: Why is firebase not a peerDependency?

Created on 18 Oct 2016  路  7Comments  路  Source: angular/angularfire

From https://github.com/angular/angularfire2/blob/c3a954cd857fc297438f53d3a1e3bf69b6af01c2/tools/rewrite-published-package.js

Firebase SDK should be a dependency since it's not required that
projects will install/use the SDK directly. And since Firebase uses
semver, the version restriction is more permissive. This means if the user
has installed Firebase already, npm is more likely to find a matching version.

From https://github.com/angular/angularfire2/blob/master/docs/1-install-and-setup.md

npm install angularfire2 firebase --save

Installing firebase currently resolves [email protected], which is incompatible in some cases with 3.3.0.

Not listing firebase as a peerDependency gives me no warning that this is not the case, resulting in some headache.

Version info

Angular: ^2.0.0

Firebase: ^3.5.0

AngularFire: 2.0.0-beta.5

Test case

Example that doesn't work with different firebase versions:

import * as firebase from 'firebase';
import { AngularFire } from 'angularfire2';

@Injectable()
export class TestService {
    constructor(private af: AngularFire) {
        this.af.auth.subscribe(user => {
            //Following line will fail since I'm sending an object created with [email protected] into [email protected], which are not compatible
            user.auth.linkWithPopup(new firebase.auth.GoogleAuthProvider());
        }
    }
}

So, why isn't firebase a peerDependency? It seems quite crucial that the versions are the same for some use cases.

builpipeline

Most helpful comment

@tonyymk yup, and firebase is still not a peer dependency

All 7 comments

@Maistho @tonymk Will we be moving to a peerDependency in an upcoming release.

@davideast is there a timeframe on that?

@tonymk when is new release coming ?

Still not in beta.6. Would you accept the (probably very simple) PR for it, or is something else blocking?

beta.6 is out now @Maistho @govi2010 @JT-Bruch

@tonyymk yup, and firebase is still not a peer dependency

Was this page helpful?
0 / 5 - 0 ratings