Skip to content
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

Closed
jahed opened this issue Mar 1, 2018 · 9 comments
Assignees

Comments

@jahed
Copy link

jahed commented Mar 1, 2018

[REQUIRED] Describe your environment

  • Operating System version: Windows 10
  • Firebase SDK version: 4.10.1
  • Firebase Product: app, auth, database

[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.

yarn add @firebase/database

Prints the following warnings:

warning "@firebase/database > @firebase/database-types@0.1.2" has unmet peer dependency "@firebase/app-types@^0.1.0".
warning " > @firebase/database@0.1.11" has unmet peer dependency "@firebase/app-types@^0.1.0".
@google-oss-bot
Copy link
Contributor

Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.

@jshcrowthe
Copy link
Contributor

Hey @jahed, this issue is actually not a firebase issue but rather a yarn issue. If you try doing the following, you should see no issues:

npm install @firebase/database @firebase/app

That said, the warnings you are seeing from yarn, are actually false positives and the code will work just fine.

@jahed
Copy link
Author

jahed commented Mar 2, 2018 via email

@jshcrowthe
Copy link
Contributor

jshcrowthe commented Mar 2, 2018

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 for more info here.

However, the package will function as expected even with the errors as the correct packages are installed.

@jahed
Copy link
Author

jahed commented Mar 2, 2018 via email

@jshcrowthe
Copy link
Contributor

I may be misunderstanding here a bit.

Are you installing @firebase/app in your app?

@jahed
Copy link
Author

jahed commented Mar 2, 2018

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.

@kevmo314
Copy link

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?

@theophanemayaud
Copy link

I have the same problem, and found the same fix : manually installing @firebase/app-types. But since it literally states on the npm package page :

This package is not intended for direct usage, and should only be used via the officially supported firebase package.

I think we should find a way to fix these unsettling warnings... !

kswenson added a commit to concord-consortium/collaborative-learning that referenced this issue Sep 7, 2018
- also add @firebase/app-types dependency to eliminate peer-dependency warnings
- cf. firebase/firebase-js-sdk#541 (comment)
@firebase firebase locked and limited conversation to collaborators Oct 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants