Exposing an api to control behaviors loading.js
#86588
SugarDarius
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
loading.jsis displayedloading.jsshould disappearloading.jsand the rendering of the page/layoutNon-Goals
Background
This idea came after implementing multiple
loading.jsfiles in an app where the display felt glitchy on high speed networks.It appears that when the network is fast the time display
loading.jsis very short and makes the UI feel like it's glitch.It would be great to propose an api where we could control the behaviors of
loading.jsto keep a nice look and feel when swapping from the file to the completed streamed content.Proposal
As an api design I first think at something very simple such as:
This means the
loading.jsfile will be displayed for at least 2 seconds with a fading transition to make the UI smooth.Also we could think at an api where it's up to developers to decide when the
loading.jsfile should swap with a guard to avoid to block the UI indefinitely:This means that
loading.jswill be kept on screen for at most 4s but will be swapped when we call the functionswapif the animation is ended before.Thanks 🙏🏻
Beta Was this translation helpful? Give feedback.
All reactions