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

feat: type improvements: typeof fetch -> FetchEsque #2728

Closed
4 tasks
KATT opened this issue Sep 16, 2022 · 2 comments · Fixed by #3471
Closed
4 tasks

feat: type improvements: typeof fetch -> FetchEsque #2728

KATT opened this issue Sep 16, 2022 · 2 comments · Fixed by #3471
Labels
😌 QoL Quality of life for contributors @trpc/client

Comments

@KATT
Copy link
Member

KATT commented Sep 16, 2022

Thanks! LGTM. Just a few linting issues, not sure if you care about those. But solution wise, I think it's a good direction!

One other thing I'd like to see is fetch-compatible interface being tRPC-driven, rather than typeof fetch. Maybe I can take a stub at this?

Originally posted by @moltar in #2723 (review)

  • typeof fetch -> FetchEsque
  • typeof AbortController -> AbortControllerEsque
  • Tests for different fetch-implementations
  • Response --> ??? (TBD)
@KATT
Copy link
Member Author

KATT commented Sep 16, 2022

I actually spent a few minutes on this here, @moltar, then I realised we had some global use of Response as extra contextual meta data when we call procedures

@KATT KATT added the 😌 QoL Quality of life for contributors label Sep 16, 2022
@mmkal
Copy link
Collaborator

mmkal commented Sep 16, 2022

When defining this type/interface might make sense to add some expect-type tests to make sure builtin-fetch, node-fetch, isomorphic-fetch, undici-fetch, deno-fetch all are type-compatible with it. Not sure if there are other widely used implementations? Edit: those might all already share a builtin typescript interface too, not sure.

@KATT KATT changed the title type improvements: typeof fetch -> FetchEsque feat: type improvements: typeof fetch -> FetchEsque Nov 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
😌 QoL Quality of life for contributors @trpc/client
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants