Replies: 2 comments 1 reply
-
Exploration: https://github.com/florian-lefebvre/astro-loading-indicator |
Beta Was this translation helpful? Give feedback.
1 reply
-
As of 1.4.2 The Bag offers a loading indicator that lets the favicon pulse in the upper right corner. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is about an improvement that gives visual feedback that Astro got the click!
There is a crude tech demo of what we could do at https://events-3bg.pages.dev/loading/one/ that fulfills the most basic requirements:
could show real progress of loadingNot worth the effortWe haven't thought much about canceling and interrupting view transitions yet.Cancelation is now supported by the core. There may also be changes for long loading processes.Astro view transitions feel a bit more clumsy than transitions without because you get no reaction until the animation kicks in, which is not before the target DOM is completely loaded. Without view transitions the browser can start rendering the page as soon as the bytes are streamed in.
First things that might come to mind for loading indicators are spinners, load progress bars, and skeleton pages.
Spinners is simple: activate an animated gif/avif on click and remove it before the view transition. See https://events-3bg.pages.dev/loading/one/
load progress bar is a bit more difficult if it should be meaningful: See https://events-3bg.pages.dev/docs/Practical/#i-want-to-use-a-loader-that-can-output-percentage-events-during-loading
content-length
headers as streamed headers have no idea of the final lengthcontent-length
header when they compress the responseSkeleton pages allow the user to quickly deliver a sketch of the target page. This is typical approach when rendered client-side and loading fragments. For a static Astro site loading a skeleton might be as slow as loading the real thing. Here the Portal Demo might point in an interesting direction: The cached portal page can be shown immediately. It might even copy over some persisted areas from the original page & show some placeholders. Next.js does something similar with its
loading.js
support.Beta Was this translation helpful? Give feedback.
All reactions