After migrating to Vue 3 I realized that when I click on button which redirects to a new route, it takes a while for browser to change route. Turns out one page is taking a hot second to mount, upwards of 350 ms
onBeforeMount 1 ms onMounted 185.70000004768372 ms onBeforeUpdate 231.20000004768372 ms onUpdated 233.60000002384186 ms onBeforeUpdate 270.5 ms onUpdated 272.40000009536743 ms
That page is using canvas, absolute positioned divs, loads of callbacks etc., so it is understandable.
To try to better UX and speed up route change I used
defineAsyncComponent to load components, and after the change the route loaded instantly and the rest of the components later. This worked on first load when components needed to load from network, but then after going to that route again it didn’t change the route right away, but instead waited for all the components to mount first and again it took upwards of 350 ms to mount.
How do I tell a page to load the main content right now, but those components at a later time regardless if they have been previously loaded?