Skip to content

improve big routers performance - #1218

Merged
KATT merged 27 commits into
mainfrom
katt/createQueryHooks-perf
Nov 11, 2021
Merged

KATT merged 27 commits into
mainfrom
katt/createQueryHooks-perf

Conversation

@KATT

@KATT KATT commented Nov 5, 2021 •

Copy link
Copy Markdown
Member

Screenshot 2021-11-11 at 10 56 01

Screenshot 2021-11-11 at 10 55 53

@vercel

vercel Bot commented Nov 5, 2021 •

Copy link
Copy Markdown

Comment on lines +88 to +103
export type MakeRouter<TRouter extends AnyRouter> = {
TQueryValues: inferProcedures<TRouter['_def']['queries']>;
TMutationValues: inferProcedures<TRouter['_def']['mutations']>;
TError: TRPCClientErrorLike<TRouter>;
TInfiniteQueryNames: inferInfiniteQueryNames<TRouter['_def']['queries']>;
TRouter: TRouter;
};

export function createReactQueryHooks2<TQuick extends MakeRouter<any>>() {
type TRouter = TQuick['TRouter'];
type TSubscriptions = TRouter['_def']['subscriptions'];
type TError = TRPCClientErrorLike<TRouter>;
type TInfiniteQueryNames = TQuick['TInfiniteQueryNames'];

type TQueryValues = TQuick['TQueryValues'];
type TMutationValues = TQuick['TMutationValues'];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

cc @mgreenw

maybe these lookups will make it faster

@KATT KATT added the 🚧 wip work in progress label Nov 7, 2021
@KATT KATT mentioned this pull request Nov 8, 2021
25 of 60 tasks

@mgreenw mgreenw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for investigating this @KATT!

@KATT
KATT merged commit cd94904 into main Nov 11, 2021
@KATT
KATT deleted the katt/createQueryHooks-perf branch November 11, 2021 15:21
@github-actions

github-actions Bot commented Oct 8, 2022

Copy link
Copy Markdown
Contributor

This pull request has been locked because it had no new activity for 30 days. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 8, 2022

This branch was successfully deployed

3 active deployments
Preview – www — 11117e9d Deployed Nov 11, 2021 by vercel[bot]
Preview – todomvc — 11117e9d Deployed Nov 11, 2021 by vercel[bot]
Preview – next-prisma-starter — 11117e9d Deployed Nov 11, 2021 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants