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

support for peer dependencies #880

Open
skoshx opened this issue Dec 28, 2024 · 2 comments
Open

support for peer dependencies #880

skoshx opened this issue Dec 28, 2024 · 2 comments

Comments

@skoshx
Copy link

skoshx commented Dec 28, 2024

Currently there is no way to define peer dependencies for packages published on JSR.

This is a major problem if we're authoring a package for React or Effect, where we want the end-user to be able to use different versions of React without errors.

Currently all dependencies are handled like direct dependencies, and in Deno there is no concept of peer dependencies.

Nonetheless, there should be some way to add peer dependencies, otherwise you simply can't publish usable packages on JSR for React, Effect + many other ecosystem libraries.

@github-project-automation github-project-automation bot moved this to Needs Triage in JSR Dec 28, 2024
@lucacasonato
Copy link
Member

Peer dependencies and regular dependencies are pretty much the same (also in NPM). Peer dependencies are just regular dependencies with very broad version ranges. As long as the version range of your dependency is broad, you will not get a duplicate copy.

This is actually exactly what npm does right now too. Since NPM version 7, peerDependencies and dependencies in package.json are actually treated in exactly the same way.

@skoshx
Copy link
Author

skoshx commented Jan 10, 2025

Okay, I didn't actually know that, thanks!! So basically let's say I wanna have end-users of my package able to use any effect@3 version, I should just do deno add npm:effect@3, then republish on JSR, and then there will no longer be any issues with having to install the exact same version?

Might be helpful to write a docs page on JSR or something, I don't think this is understood by most devs :D

Should I keep this open or close?

@crowlKats crowlKats removed the status in JSR Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants