Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does @firebase/[email protected] do and when should I use it?

On the phase where yarn is linking its dependencies I get the following block of warnings:

warning "firebase > @firebase/[email protected]" has unmet peer dependency "@firebase/[email protected]".  
warning "firebase > @firebase/[email protected]" has unmet peer dependency "@firebase/[email protected]".  
warning "firebase > @firebase/[email protected]" has unmet peer dependency "@firebase/[email protected]".
...

some more unment peer dependency warnings about "@firebase/[email protected]" from different firebase packages I removed here for the sake of better readability.

...  
warning " > [email protected]" has unmet peer dependency "dom-tools@^0.1.1".  
warning " > [email protected]" has unmet peer dependency "wolfy87-eventemitter@^4.3.0".  

Even though I did read The docs about dependency types, I still do not understand:

1) What are peer dependencies? [now I do... please read edit below]
2) Why and how are they used? [now I do... please read edit below]

This lack of understanding also leads to me being uncertain about what I should do about those warnings provided by yarn.

3) Should I add @firebase/[email protected], dom-tools@^0.1.1 and wolfy87-eventemitter@^4.3.0 as dependencies?
4) if so then should those be normal or dev dependencies?

Edit:
It was suggested that this is a duplicate of Why use peer dependencies in npm for plugins? so I went and read it. I now understand better what peer dependencies are in general and I do recommend everyone reaching this Q that does no understand what peer dependencies are to go ahead and read said Question and answer provided there.

Never the less, I still don't know how to resolve said warning and Q's 3 and 4 are still let unanswered for me.

I do understand that @firebase/[email protected] expects me to somhow use that code in @firebase/[email protected] when communicating with it... but I do not knwo where, when am I how I am expected to do so.

The fact that I don't use it could mean that its something optional that I don't actually need and this makes it "an implementation detail" (to use language from https://stackoverflow.com/a/34645112/25412 ) or that I am missing something in how I am using @firebase/[email protected].

I am not asking about the peer dependencies of plotjs because plotjs is not something that I am using directly to begin with so I am guessin the first option of an optional "implementation detail" applies here (at least for now).

So maybe someone can provide more insight into what @firebase/[email protected] does and how and when it can/should be used?

like image 385
epeleg Avatar asked May 01 '18 06:05

epeleg


People also ask

What is Appcheck in Firebase?

App Check and Firebase Authentication are complementary parts of your app security story. Firebase Authentication provides user authentication, which protects your users, whereas App Check provides attestation of app or device authenticity, which protects you, the developer.

What is the purpose of Firebase?

Firebase helps you develop high-quality apps, grow your user base, and earn more money. Each feature works independently, and they work even better together.

How do I know if an app is connected to Firebase Android?

If you want to know if the client is connected to the server before calling setValue() , you can attach a listener to . info/connected .


1 Answers

According to one of the collaborators maintaining the firebase javascript sdk, this warning is generated by a known bug in yarn. See this related issue in the firebase-js-sdk:

After a quick google search, It appears to be a known issue with yarn. If a peer dependency is installed by a dependency's dependency (I know it's a mouthful), yarn will complain about it. Your product is totally safe, there is nothing to worry about. You can also use npm install instead, and there is no warning.

In conclusion: ignore the "@firebase/..." has unmet peer dependency "@firebase/[email protected]". warnings.

like image 159
John Avatar answered Sep 21 '22 08:09

John