Replies: 3 comments
-
|
I know prefetch functions were just added in 6.20.0 to support Next SSR: #956 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
how about sveltekit ? I am having some trouble using orval with sveltekit for now. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Would you be able to share your custom client? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
With the massive changes happening around the Frontend Cloud and frameworks like NextJS rapidly moving the entire frontend world to server side rendering, many of the assumptions that frameworks like
axiosare at odds with how the hybrid rendering model works. For example React contexts and ideas registeringinterceptorsanddefaultsin frameworks likeaxiosdon't work (at least as smoothly) as they did in the client side world.This is mostly due to lifecycle issues that server side rendering poses. While frameworks like
nextjs(at least in14.0.3-canary) provide features likeinstrumentationHookwhere one can run bootstrap code on startup, it still does not provide the same seamless setup of the axios client as you would get in a pure client side experience.NextJS 14 in particular is also building upon the native fetch api with extensions for caching, invalidation, etc.
Point for discussion
Orval supports writing custom http client which the generator then uses instead of
axiosor I assume it is possible to write a custombuilderjust like the ones that are supported out of the box.While I am a fan of
axiosand similar frameworks, I personally findaxiosan unnecessary layer whenfetchand other native frameworks are way more mature than they have been in the past. Also with frameworks like Next building right on top of the native web frameworks it would make sense to get close to the metal (so to speak) as possible.At the moment I have been working around
axiosbehaviour with setup and teardown helpers becauseinterceptorsanddefaultsdon't work so well for server side functions.My discussion here is to explore:
Beta Was this translation helpful? Give feedback.
All reactions