Skip to content

Reduce Blocking time of Nuxt Applications #9061

Discussion options

You must be logged in to vote

I second @voltane idea to leverage lazy-hydration, reducing JS execution time and Chunk splitting is mainly wepack's task so nothing much to do (hopefully would be improved by WP5)

One important tip worth mentioning is that nuxt plugins are usually main reason of blocking render/hydration since nuxt awaits on them before start rendering on client-side and also their dependencies will be added to main (or vendors) chunk which both are necessary to bootstrap too.

(NOTE: All examples below are for .client plugins)

Example 1: Defer plugins with a background task

Bad practice:

export default async function(ctx, inject) {
   await ...
}

Doing task in parallel to render:

async function task(ctx) {}

Replies: 9 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by danielroe
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9 participants
Converted from issue

This discussion was converted from issue #7698 on March 27, 2021 22:56.