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

Question: package peerDependencies #94

Closed
gluck opened this issue Jun 27, 2019 · 2 comments · Fixed by #102
Closed

Question: package peerDependencies #94

gluck opened this issue Jun 27, 2019 · 2 comments · Fixed by #102
Labels
has fix A fix has been crafted

Comments

@gluck
Copy link

gluck commented Jun 27, 2019

Hi,

currently the npm package declares a peerDependency to preact at the root level (/package.json) and no peerDependency at react or preact level (/[p]react/package.json).
Is it on purpose (e.g. that some bundlers/tools do not support peerDeps on sub packages) or should it be fixed ?

Cheers !

@developit
Copy link
Owner

Hi @gluck - the issue is more that npm itself doesn't support peerDependencies in sub-packages. The fact that we have a peerDep for preact at the root is mostly due to htm previously only shipping a Preact variant. As far as I'm aware, the only solution here to avoid everyone getting warnings in their console when installing is simply to remove the peerDependencies altogether.

developit added a commit that referenced this issue Jul 9, 2019
It's not great, but we weren't going to be using them to limit version compat anyway.
Fixes #94.
@developit developit added the has fix A fix has been crafted label Jul 9, 2019
@gluck
Copy link
Author

gluck commented Jul 10, 2019

Hi ! Thanks for the fix at root level.
Right now npm mostly ignores sub-packages entirely, no ? (only the bundler, or node, or whoever resolves the import statement cares)
I'd add the peerDep on sub-package, because that's how it'd be if the package was shipped on its own (e.g. lerna ?), but I don't think anyone really cares today.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has fix A fix has been crafted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants