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

[WIP] Typings optimizations #6665

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

roblabat
Copy link
Contributor

@roblabat roblabat commented Jan 8, 2024

Working on issues adapting the new queryKey typings inference to Vue. I Found few things that could be optimised on the core package. This PR is for those typings optimisations. See changes below:

  • Many Types relies on useless generic TQueryFnData:
    • clean useless generic TQueryFnData
    • Fix false positive test on queryObserver "should structurally share placeholder data" where placeholder is of type {}while the queryFn returns string(the error is hidden due to useless Generic that catch this bad {} type)
  • work on query result typings, I want to include all | undefined union typings in the Generic TData if no initialData is defined. Then the types DefinedInitialDataOptionsand UndefinedInitialDataOptions in React and Vue packages will be useless which schould solve some issues on Vue due to interactions between & { initialData: T }statement and MaybeRefDeep type
  • propagate changes to framework packages
    • React
    • Vue
    • Solid
    • Svelte
  • Improve Inference from QueryKey in Vue package

Copy link

vercel bot commented Jan 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Jan 8, 2024 3:32pm

Copy link

nx-cloud bot commented Jan 8, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 9814cc3. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx affected --targets=test:eslint,test:lib,test:types,test:build,build --exclude=examples/**

Sent with 💌 from NxCloud.

@roblabat
Copy link
Contributor Author

roblabat commented Jan 8, 2024

@TkDodo I'm starting this PR if you want to have a look at my work on typings. I'm still working on implementing our QueryKey inference system in Vue but there is some bugs that I didn't manage to solve simply so I start some work on cleaning the package typings. I'll try to describe all my changes and ideas in the description. Feel free to argue it if you don't understand what I'm trying to do or if you have other ideas.

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