Replies: 0 comments 9 replies
-
How about streaming SSR of universal async components? Are they planned, or included in the whole server components plan? |
Beta Was this translation helpful? Give feedback.
-
I don't know if this is something already planned in Server Components or Hybrid Rendering features, but another common technique nowadays in Nuxt is using LazyHydrate (nuxt-lazy-hydrate package). Pretty much like Astro's directives.
Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
Is there any ETA on testing the Server Components and/or partial hydration functionality @kissu mentioned in August? Thank you! |
Beta Was this translation helpful? Give feedback.
-
Related:
Why
Website performance plays a major role in the success of any online venture. High-performing sites engage and retain users better than low-performing ones.
As a site begins to load, there's a period of time where users wait for content to appear. Until this happens, there's no user experience to speak of. This lack of experience is fleeting on fast connections. On slower connections, however, users are forced to wait. Users may experience more problems as page resources slowly trickle in.
Universal rendering tends to solve this issue by rendering on the server the HTML so the user does not have to wait for the JS to be loaded to start reading or even interacting with the website content.
Server-side optimizations
Using server-side-rendering, Nuxt is able to optimize the resource delivery by:
Server-only components
We keep pushing forward to make sure Nuxt will deliver the best rendering performance. One of these solutions is server components and selective rendering in order to remove client-side JS for components that do not need hydration on the client-side.
Hybrid caching strategies
Rendering on the server-side is costly and there are different strategies to reduce this cost such as static pre-rendering (
nuxt generate
) and caching headers. With Nuxt 3 we are moving it further to allow setting a combination of this strategy to one website.Client-side optimizations
In order for the website to be interactive, client-side assets need to be loaded. Using a bundler (Vite and Webpack), Nuxt is able to optimize client assets and resources.
<nuxt-link>
framework#4329)Third-party script optimizations
Around 45% of requests from websites served on mobile and desktop are third-party requests, of which 33% are scripts. The size, latency, and loading of third-party scripts can significantly affect a site's performance.
The goal is to provide an API to create scripts with backed-in best practices and defaults to help Nuxt developers include third-party scripts in their applications with the best performance.
So far, we have provided a solution by leveraging Partytown to run third-party scripts from a web worker. Optimizing your third-party script is as simple as using the partytown-module.
<Script> component
Nuxt 3 has a built-in <Script> component.
Upcoming enhancements:
strategy
support (https://github.com/nuxt/framework/discussions/2342)nuxt/scripts
Scripts module
With an upcoming
@nuxt/scripts
module, Nuxt provides presets for 3rd party script integrations (such asgtm
,crisp
, etc.) in a managed way and optimizes integration when possible using lazy script initialization async operations. This project saves time by maintaining each integration as a separate module and ensuring users keep doing best practices out of the box.Goals:
onNuxtReady
,partytown
, etc.We are still discussing the usage internally for providing a good developer experience; we will update this issue as soon as we are open to feedback.
Beta Was this translation helpful? Give feedback.
All reactions