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
-
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
axios
are at odds with how the hybrid rendering model works. For example React contexts and ideas registeringinterceptors
anddefaults
in frameworks likeaxios
don'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 likeinstrumentationHook
where 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
axios
or I assume it is possible to write a custombuilder
just like the ones that are supported out of the box.While I am a fan of
axios
and similar frameworks, I personally findaxios
an unnecessary layer whenfetch
and 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
axios
behaviour with setup and teardown helpers becauseinterceptors
anddefaults
don't work so well for server side functions.My discussion here is to explore:
Beta Was this translation helpful? Give feedback.
All reactions