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.
Angular: ^2.0.0
Firebase: ^3.5.0
AngularFire: 2.0.0-beta.5
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.
I think it will be with a new version: see commit: https://github.com/angular/angularfire2/commit/c3a954cd857fc297438f53d3a1e3bf69b6af01c2
@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
Most helpful comment
@tonyymk yup, and firebase is still not a peer dependency