-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait for up to 1.5 seconds for external CSS to load #4335
Conversation
It was never anything but `document.head`, and besides the `existing_link` check within the function didn't use it as scope anyway
Refs gradio-app#4332 (part of it anyway)
All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-4335-all-demos |
This isn't the right solution for offline loading and creates other possible issues on slow connections. We'll solve this properly in the near future. |
@pngwn This would fix problems users are having in the meantime though. You could freely revert this when you implement the better solution ☺ |
Unfortunately it would also create problems that don't currently exist. So it isn't a viable approach. |
@pngwn I'm curious – can you elaborate? What external CSS is critical enough to warrant waiting for? 🤔 |
If we don't load the CSS then the UI is basically unusable.While fonts aren't critical, other CSS files are, and this function is used to load many different kinds of CSS, not just fonts. This change would potentially give users on slow connections a broken UI which isn't acceptable since Gradio is primarily a UI tool. While this does solve the offline usecase, that is a very niche usecase, whereas slow connections happen for a variety of reasons from poor infrastructure to poor mobile signal (and many reason in between). Creating a worse experience for those users in order to enable offline usage of gradio (which has been requested a few times but only by a handful of users), is not a good trade-off for the library. We will fix this soon but not at the expense of other users' experience. |
Right, which is why this PR only adds the timeout to CSS that is loaded from an absolute source -- though that could also be changed to something like |
Description
fixedtouched upon: Gradio remains stuck in "Loading" phase in LAN configuration (not connected to the Internet) #4332Checklist: