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

List react-query v4 as a peer dependency #134

Open
IsaacLeeWebDev opened this issue Jul 24, 2024 · 2 comments
Open

List react-query v4 as a peer dependency #134

IsaacLeeWebDev opened this issue Jul 24, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@IsaacLeeWebDev
Copy link

IsaacLeeWebDev commented Jul 24, 2024

Is your feature request related to a problem? Please describe.

Right now, this tool generates code that imports react-query like this:

import { UseQueryResult } from "@tanstack/react-query";

These imports don't work if you've installed a version of react-query before v4, whose imports have to look like this:

import { UseQueryResult } from "react-query";

Describe the solution you'd like
List react-query v4 and up as a peer dependency of this package

Describe alternatives you've considered
This tool could also support generating v3-style imports with a CLI option. That said, I could see how supporting old versions of react-query could go far beyond this one incompatibility, and I could see officially how providing that support could potentially significantly increase the maintenance demand of this package.

I suppose I could also run a string-replace to change @tanstack/react-query to react-query on every generated file.

Additional context

@seriouslag
Copy link
Collaborator

Our api does not support that version of react query. That package should be changed to use the package under the @TanStack name.

@IsaacLeeWebDev
Copy link
Author

IsaacLeeWebDev commented Aug 2, 2024

Our api does not support that version of react query. That package should be changed to use the package under the TanStack name.

That's fine! That's why I suggested listing the tanstack-named package as a peer dependency, so that those using older versions get a warning message when they install the package.

@7nohe 7nohe added the enhancement New feature or request label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants