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

refactor: replace internal types with @tanstack/query-core types #34

Merged
merged 3 commits into from
Jan 12, 2023

Conversation

wconnorwalsh
Copy link
Contributor

Hello, I patched this locally, but figured I would also submit upstream.

This PR replaces the types marked internal in the most recent release with the actual types from @tanstack/query-core.

As of v1.0.3, the types marked internal are still being included in the build. When used in a project alongside TanStack Query, this duplication is causing TS to use the query-key-factory versions in place of (alongside?) the official TanStack types.

This PR should fix those issues and ensure any future changes to TanStack Query's types stay in sync with this package.

@changeset-bot
Copy link

changeset-bot bot commented Nov 12, 2022

🦋 Changeset detected

Latest commit: 094c3c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lukemorales/query-key-factory Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wconnorwalsh wconnorwalsh changed the title Replace internal types with @tanstack/query-core types refactor: replace internal types with @tanstack/query-core types Nov 12, 2022
Copy link
Contributor Author

@wconnorwalsh wconnorwalsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[deleted]

@lukemorales
Copy link
Owner

Thanks for the PR @wconnorwalsh, I briefly considered that before the 1.0.3 release for fixing some issues, but even though the package is deeply connected to Tanstack Query, I'm a bit hesitant to introduce a peer dependency just for the sake of the QueryFunction types (I'm not strongly opinionated on this. I might be overthinking on this matter, but I'm not sure if I'd wanna lose the ability of adding this package to a project just for testing or in a monorepo as a package without needing to add another dependency for it to work).
I know it's a bit more work on maintaining this package in sync with the original, but if there are changes to these types, they would probably be a breaking change anyways.

Could you share a bit more of what conflicts you have experienced? I'd be awesome if you can provide a reproduction as well

@lukemorales lukemorales merged commit abb3596 into lukemorales:main Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants