It'd be a bit jarring to have certain features suddenly disappear on the next page load, just because your resources dropped below certain thresholds decided by the developer?
Deactivating features based on battery life? That’s absolutely still a thing on native apps. If you throw Windows into battery saver mode, for example, the acrylic material becomes opaque; if you put Android into power saver mode, native controls will shut off their gratuitous animations, things like that. Nothing major, but a bunch of small things.
The post offers something else: vague heuristics, different on each website, and no feedback or ways to override.
See the difference?
At least the iOS App Store I believe supports splitting up assets and loading them after initial install (optionally?)
Native applications lack this kind of polish because all software lacks polish, not because it's a bad idea. "Can the application be improved in any way if it were to query battery life, connection strength, metered vs unmetered bandwidth, remaining disk space?" are thoughtful questions for any developer to ask, even if the answer is ultimately "No."
I suspect the answer is typically "Yes, but putting this level of thought into any other area of development would have been more worthwhile".
Also because of the nature of these features (depending on use case), you can use them in a progressively enhanced manner.
What we need is ways to mark content as optional or offering it in multiple levels, that the navigator can pick from. This would be similar to how videos are served.
I also want to point out the Save-Data header which is a step in the right direction.
Just because you only visit Hacker News it doesn’t mean that every website can do its job with an equivalent amount of JS.
The whole point of such APIs is to automatically provide the right content to people: Lightweight on slow connections, beautiful on the rest of them.
I don't see this strategy being adopted by most websites, but I reckon it's a technique worth knowing about. I've worked on WebGL visualisations where the device RAM played a big role on performance for example.
And it is probably better if power consumption increases on the server side rather on the client side, because you can locate your server facilities in connection to good clean energy, compared to all client users in the world.
After inspecting I saw over 100 .js files were being requested by require.js, but because each module required yet another set of .js files and those files required another set, and so on. The server was serving them up plenty fast (<50ms) but because they were being loaded in waves the load time ended up being between 5 and 7 seconds.
Many of these issues arise from being fancy and people tend to want to fix it with fancy stuff. But sometimes you need to stop being fancy and just fix the damn problem in an old fashioned way (concatenate, minify, allow local caching).
We recently blogged about that on the example of Matomo (Google Analytics alternative). The main part is the following code:
if (navigator.doNotTrack !== '1') { /* load script */ }
Here is the link if you are interested in the details: https://frontaid.io/blog/matomo-dnt-do-not-track/No https://www.w3.org/TR/tracking-dnt/ The problem with DNT is not its specification but that the largest chunk of the industry does not adhere to it. Instead they nag their users with annoying cookie overlays.
> Isn't DNT [...] just not supported in browsers any more?
It is supported by all common browsers except Safari: https://caniuse.com/do-not-track
I had to stop viewing my favorite website recently because it’s no longer viewable with JavaScript disabled.
navigator.deviceMemory
navigator.hardwareConcurrency
Oh great, more ways to track users.How about: if you don't need the JS, don't load it.
I know you don't need most of it because I use NoScript, and most sites work fine with a good chunk of JS disabled. As a generally observed pattern, the more JS they load from more sites, the more you can disable and still use them.