query icon indicating copy to clipboard operation
query copied to clipboard

[WIP] Typings optimizations

Open roblabat opened this issue 1 year ago • 3 comments

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
    • [x] 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

roblabat avatar Jan 08 '24 15:01 roblabat

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

vercel[bot] avatar Jan 08 '24 15:01 vercel[bot]

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 9814cc39e015a043701233ecb8e0881e56c71fb6. 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.

nx-cloud[bot] avatar Jan 08 '24 15:01 nx-cloud[bot]

@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.

roblabat avatar Jan 08 '24 15:01 roblabat