Skip to content
This repository has been archived by the owner on May 1, 2021. It is now read-only.

query-string dependency should not be a peerDependency #32

Closed
jasonk opened this issue Sep 17, 2020 · 3 comments
Closed

query-string dependency should not be a peerDependency #32

jasonk opened this issue Sep 17, 2020 · 3 comments

Comments

@jasonk
Copy link

jasonk commented Sep 17, 2020

pbeshai/use-query-params#127

pbeshai added a commit that referenced this issue Sep 17, 2020
Add a dev check to ensure query-string is installed correctly #32
@pbeshai
Copy link
Owner

pbeshai commented Sep 17, 2020

Addressed via #33 by throwing an exception when the wrong version is present. Available in v1.2.3

@pbeshai pbeshai closed this as completed Sep 17, 2020
@amireynoso
Copy link

Hey @pbeshai, would you mind explaining your rationale for throwing an exception instead of setting query-string to be a dependency? If this library needs query-string to function, then it should be added to its dependencies. If it doesn't, why is it listed as a peerDependency and/or why would you throw an exception?

I'm not quite sure I understand why the responsibility of installing this supporting library is pushed to the consumers.

Appreciate your work. 🙏

@pbeshai
Copy link
Owner

pbeshai commented Apr 7, 2021

Hey, thank you for a very politely worded question! The reason why it's a peer dependency and not a direct dependency is that historically some people needed v5 to support older browsers, while some people wanted v6 to work with newer features. I couldn't get the "you choose your version" to work while listing it as a direct dependency, so I let people choose. I do hope in a new version to make this more obvious / use something like the built-in URLSearchParams as a default, but I need to investigate it more still.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants