Skip to content

Why is firebase not a peerDependency? #623

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

Closed
Maistho opened this issue Oct 18, 2016 · 7 comments
Closed

Why is firebase not a peerDependency? #623

Maistho opened this issue Oct 18, 2016 · 7 comments

Comments

@Maistho
Copy link
Contributor

Maistho commented Oct 18, 2016

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.

@tonymk
Copy link

tonymk commented Oct 21, 2016

I think it will be with a new version: see commit: https://github.com/angular/angularfire2/commit/c3a954cd857fc297438f53d3a1e3bf69b6af01c2

@davideast
Copy link
Collaborator

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

@JT-Bruch
Copy link

@davideast is there a timeframe on that?

@govi2010
Copy link

@tonymk when is new release coming ?

@Maistho
Copy link
Contributor Author

Maistho commented Nov 3, 2016

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

@tonymk
Copy link

tonymk commented Nov 3, 2016

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

@Maistho
Copy link
Contributor Author

Maistho commented Nov 3, 2016

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

fabien0102 added a commit to fabien0102/angularfire2 that referenced this issue Nov 15, 2016
Avoid incompatibility with project firebase.

Fixes angular#623
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

5 participants