You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently loading.js placeholder pages only show up on client navigation if the target route has been prefetched. This is not ideal in a website with many links (for example in a docs website with a sidebar).
Prefetching links before showing loading.js shouldn't be needed If the navigated page is the same as the current one.
For example let's say the current page is [[...slug]].js, the user navigates to another page in [[...slug]].js. If the target page has not been prefetched the loading.js skeleton won't be shown.
But given that the loading.js is the same for all [[...slug]].js pages there is no need to prefetch these links before showing the skeleton, because this component should already be available.
Goals:
Make it possible to show loading.js even if prefetching is disabled
Make it possible to show loading.js even if prefetching hasn't completed
Non-Goals
No response
Background
I am building a docs website where there are many links on the page, i want to disable prefetching to not trigger tons of requests on the first load but by disabling prefetching the user can no longer see the loading.js skeleton.
Proposal
Use the already available loading.js component if the navigated page uses the same loading.js as the current one (same route, for example [[...slug]].js)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Currently loading.js placeholder pages only show up on client navigation if the target route has been prefetched. This is not ideal in a website with many links (for example in a docs website with a sidebar).
Prefetching links before showing loading.js shouldn't be needed If the navigated page is the same as the current one.
For example let's say the current page is
[[...slug]].js
, the user navigates to another page in[[...slug]].js
. If the target page has not been prefetched theloading.js
skeleton won't be shown.But given that the
loading.js
is the same for all[[...slug]].js
pages there is no need to prefetch these links before showing the skeleton, because this component should already be available.Goals:
loading.js
even if prefetching is disabledloading.js
even if prefetching hasn't completedNon-Goals
No response
Background
I am building a docs website where there are many links on the page, i want to disable prefetching to not trigger tons of requests on the first load but by disabling prefetching the user can no longer see the
loading.js
skeleton.Proposal
Use the already available
loading.js
component if the navigated page uses the sameloading.js
as the current one (same route, for example[[...slug]].js
)Beta Was this translation helpful? Give feedback.
All reactions