URLs should be static, simple, and as short as is reasonable.
URLs should be static, simple, and as short as is reasonable.
This would preserve both the back button as well as bookmarking! Note that this video is more of the hacking nature what fun things can we do with the URL bar, he stated a number of times that it's more cool than actually useful.
[1]: https://developer.mozilla.org/en-US/docs/Web/API/History_API...
The first point about updating the whole URL is easy to render moot: when you push new state using the history API, replicate the effect of location.hash by making sure you only change the hash part.
The second part is the sticky one for the "ain't this cool" factor: the throttle in some browsers effectively limits constant animation to 3fps. This isn't an issue for things like the video progress example though: that only needs to update once per second. If you made a library to wrap this idea for easy reuse you could easily implement change detection and other rapid change throttling to smooth things out (so short bursts of many updates work, but longer bursts don't cause a complete stop until ~30s has passed) rather than having to implement these for each use of the technique. ("if" and "you could", because who in their right mind actually would?!)
Try this in chrome console. And yes, it doesn't throttle at all.
i=0; setInterval(() => history.replaceState('', '', '/' + (i++)), 50);
It's interesting how people will just believe everything, even if the test is 30 seconds away.
So just because it is not throttled when run in the console doesnt necessary imply it wont throttle as part of a regular page as well.