Replies: 3 comments
-
At that point, you could do SSG: https://github.com/antfu/vite-ssg which will give you the perf boost you want while still having a static server |
Beta Was this translation helpful? Give feedback.
-
@cawa-93 In certain use cases you can try using îles, which will prerender all components and hydrate only the ones you specify should be interactive. Supporting partial hydration in Vue core would be very powerful and unlock the same benefits for a wider range of use cases. |
Beta Was this translation helpful? Give feedback.
-
so.. can Vue3 do this or not? |
Beta Was this translation helpful? Give feedback.
-
I was wondering why and is it possible at all to partially render some of the components in project "compile-time"?
I'd better explain with an example. A typical template looks something like this:
Note that I'm not talking about server side rendering, but generation during build with tools like webpack or vite.
So now these tools generate an empty root element and JS which creates content after loading.
However, there are scenarios where some part of the pattern from the root element to the depth is mostly static. Why not render HTML in advance, and in runtime just hydrate these parts?
In my example, the generated HTML might look something like this:
This could be a very big improvement on the first rendering.
Beta Was this translation helpful? Give feedback.
All reactions