NProgress gets almost 5 million downloads a week. Its last release, 0.2.0, came out in May 2015, and it doesn't ship TypeScript types, so another 1.5 million downloads a week go to @types/nprogress . It still works, and in a Vue 3 app it usually looks like this:
import NProgress from 'nprogress' import 'nprogress/nprogress.css'
router . beforeEach ( ( ) => { NProgress . start ( ) } ) router . afterEach ( ( ) => { NProgress . done ( ) } )
Enter fullscreen mode
Exit fullscreen mode
That setup has two problems you've probably seen without naming them.
Problem 1: it flashes on fast navigations
start() shows the bar right away. When the next route is already loaded, or its data comes from cache, the navigation takes 30ms and the user sees a thin line blink at the top of the page. That blink makes a fast app look slow.
Problem 2: parallel requests end it too early
People also call NProgress around their own requests:
async function load ( url : string ) { NProgress .…