Skip to content
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

Remove server-side jank #4

Open
joeybaker opened this issue Dec 3, 2015 · 2 comments
Open

Remove server-side jank #4

joeybaker opened this issue Dec 3, 2015 · 2 comments

Comments

@joeybaker
Copy link
Owner

Maybe we can use https://github.com/commenthol/ua-parser-caps to allow the server to auto-detect screen size?

@jokeyrhyme
Copy link
Collaborator

Making any assumptions about device screen dimensions based on user agent sniffing seems like a terrible idea. The only thing that is remotely accurate from a user agent string is device brand / vendor, and even that can't be depended upon.

So in lieu of user agent sniffing, perhaps a default size should be rendered in a <noscript />, whilst a JavaScript-enabled rendering is initially hidden via CSS. Once JavaScript has the real dimensions and has adjusted accordingly, display the rendering.

I'm not sure that a one-size-fits-all default size can be determined, as this will differ per use case. Maybe assuming the dimensions of a small phone would be a decent fallback? /shrug

If they are available in the request headers, Client Hints might also be useful for this purpose:

@joeybaker
Copy link
Owner Author

Yea! Client Hints are really the answer. I agree that UA sniffing is a terrible idea (though until client hints becomes more supported, it might be the only viable option).

The "default" option you mentioned is already supported!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants