-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add support for client hints #121
Comments
Sounds like a good idea. First we have to add a PR to |
@maccesch from what I read it doesn't need any kind of client side feaute. Since everything only via headers. We just need the integration via axum since at first response server responds with critical hints and client retries the request. |
For #101 we only need the server side part indeed because the client side is already handled. But even in that case we're probably interested in being able to read it on the client as well. For a general purpose client hints function we definitely need client side. Pages should work the same as much as possible between being rendered on the server or on the client. This is the client API: https://developer.mozilla.org/en-US/docs/Web/API/User-Agent_Client_Hints_API |
I made a PR for web_sys: rustwasm/wasm-bindgen#3989 |
@maccesch these are the user agent client hints api and I was mostly considerign User preference media features client hints css features where you can get for example Sec-CH-Prefers-Reduced-Motion, Sec-CH-Prefers-Color-Scheme. These already have client side apis. But yeah for the user agent ones that makes sense. |
Yes, but while we're at it we might as well do it right, don't you agree? As far as I read it you're talking about a subset but when we implement this API I'd rather do it all at once. |
@dvtkrlbs I finally fully understood what you meant with existing client APIs. The Sec-CH-Prefers-Color-Scheme is now implemented. |
Thank you very much |
Client hints currently experimental. Maybe we can implement some features of it using a feature flag. Especially the Sec-CH-Prefers-Color-Scheme header could be useful to setup dark mode on the server to prevent flash on non dark mode content.
The text was updated successfully, but these errors were encountered: