-
Notifications
You must be signed in to change notification settings - Fork 892
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
app-types is a peerDependency requiring non-TS projects to install it manually. #541
Comments
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight. |
Hey @jahed, this issue is actually not a
That said, the warnings you are seeing from |
Surely then if the code works fine without it, it's an optional dependency
and not a peer dependency?
…On Fri, 2 Mar 2018, 17:13 Josh Crowther, ***@***.***> wrote:
Closed #541 <#541>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#541 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADLTk1i3n0IYU3COLVZNAtOJNeuhWNi8ks5taX3LgaJpZM4SY4fs>
.
|
Not quite:
The code will not compile for TS users without those deps. So it is not an optionalDependency as you suggest. For JS only users (i.e. you aren't using the provided typings at all, including through VSCode or one of the Typings extensions in other editors) it is completely negligible, but it is a use case we support. The point I was making was that the issue here is yarn mishandling peer deps. See yarnpkg/yarn#4850 for more info here. However, the package will function as expected even with the errors as the correct packages are installed. |
Why not make it a regular dependency rather than a peer dependency if you
need TS support? That's how most packages are published when written in
Flow or TS.
The issue linked isn't related to this as I did install app-types and the
warning did go away. The issue in that ticket is about warnings even when
they are installed.
And when using npm, I can see the same warning. The npm documentation also
mentions this.
UPDATE: npm versions 1 and 2 will automatically install peerDependencies
if they are not explicitly depended upon higher in the dependency tree. For
all following versions of npm (starting with ***@***.***), this will no longer be
the case. You will receive a warning that the peerDependency is not
installed instead.
My point is why do I need to install app-types explicitly in my own project
if I don't need it?
Peer Dependencies are for entirely different use cases than what it's being
used for here. It's for plugins and add-ons.
https://nodejs.org/en/blog/npm/peer-dependencies/
…On Fri, 2 Mar 2018, 17:30 Josh Crowther, ***@***.***> wrote:
Not quite:
That said, the warnings you are seeing from yarn, are actually *false
positives* and the code will work just fine.
The code *will not compile* for TS users without those deps. So it is not
an optionalDependency as you suggest. For JS only users (i.e. you aren't
using the provided typings at all, including through VSCode or one of the
Typings extensions in other editors) it is completely negligible, but it is
a use case we support.
The point I was making was that the issue here is *yarn* mishandling peer
deps. See yarnpkg/yarn#4850 <yarnpkg/yarn#4850>
for more info here
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#541 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADLTkwhZIqG8tfM1XlwldJNk-hl1EPdaks5taYGcgaJpZM4SY4fs>
.
|
I may be misunderstanding here a bit. Are you installing |
Apologies, the workaround is straight forward so I thought I'd mention the issue and see what the team thought. I'll bring this issue back up once yarn yarnpkg/yarn#4850 is fixed, as until then it'll be a point of contention. |
Hi, yarnpkg/yarn#4850 was closed and the yarn team indicated that this is not something they can act on. Can the firebase team either follow up or fix the dependency structure? |
I have the same problem, and found the same fix : manually installing
I think we should find a way to fix these unsettling warnings... ! |
- also add @firebase/app-types dependency to eliminate peer-dependency warnings - cf. firebase/firebase-js-sdk#541 (comment)
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
app-types is a peerDependency for all product packages (specifically, their individual -types package). For non-TypeScript projects, it seems unnecessary to require us to include another dependency into our packages when all it does is introduce TypeScript definitions.
Why not include it as an optionalDependency or even just a regular dependency so that non-TS users don't need to care about it?
Steps to reproduce:
Adding any package without app-types. e.g.
Prints the following warnings:
The text was updated successfully, but these errors were encountered: