-
-
Notifications
You must be signed in to change notification settings - Fork 245
feat: init client-ofetch
#2642
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: init client-ofetch
#2642
Conversation
|
🦋 Changeset detectedLatest commit: 0e4a063 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@brolnickij is attempting to deploy a commit to the Hey API Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2642 +/- ##
==========================================
+ Coverage 24.36% 25.26% +0.89%
==========================================
Files 378 385 +7
Lines 36466 37085 +619
Branches 1640 1781 +141
==========================================
+ Hits 8885 9369 +484
- Misses 27568 27703 +135
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
commit: |
I plan to get to this later today |
9214aea
to
ef329e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really well done! Thank you!
Introduction
client-ofetch
came out of this discussion #2618 (comment), the problem in #2619, and extra compatibility issues betweenclient-nuxt
and the@pinia/colada
plugin (#2595)Besides fixing all of the above,
client-ofetch
also grows the Hey API built-in toolbox with another popular HTTP clientofetch
.Features
client-ofetch
is a universal (runtime-agnostic) ofetch‑based clientclient-ofetch
supports nativeofetch
hooks,retry
/timeout
/dispatcher
/agent
, SSE,responseStyle
/throwOnError
,parseAs
/responseType
Problem details
Right now,
client-nuxt
is tailored for Nuxt own composables (useAsyncData
/useFetch
/ etc). At the same time,@pinia/colada
is a more advanced way to work with the apps infra layer in vue.js projects.The tight coupling of
client-nuxt
to Nuxt itself (imports fromnuxt/app
/vue
) makes it a bad fit for Nitro server routes / SSR and for universal libraries like@pinia/colada
.Also, trying to stretch
client-nuxt
to be "universal" leads to higher coupling and hacks in codegen (branching onisNuxtClient
in@pinia/colada
and in the SDK). This bloats types and makes the codebase harder to maintain.In conclusion, it would be nice to have a standalone
ofetch
, without any ties to Nuxt.Migration plan
defineQueryOptions
#2610 and feat: initclient-ofetch
#2642 land in main, we need to clean up the@pinia/colada
plugin to decouple it fromclient-nuxt
once and for all (remove everyisNuxtClient
and make them fully independent).client-nuxt
for components &client-ofetch
for server routes?*