5 ms·
Structured Page Fragments by YouTube (2017)
- neoeldex 8y agoWhat's the reason for posting this? It's been posted before (https://news.ycombinator.com/item?id=10667783 https://news.ycombinator.com/item?id=10667783) and the repo seems to be dead since beginning 2017 (4 open PR's from 2017). It also looks like it doesn't fit the current web-meta anymore :)
- speps 8y agoIt's still used on youtube.com today[1], what's your problem with something not being updated? The PRs are trivial stuff, the issues don't seem too bad either. [1] <script src="https://s.ytimg.com/yts/jsbin/spf-vflhSOzLf/spf.js" https://s.ytimg.com/yts/jsbin/spf-vflhSOzLf/spf.js" type="text/javascript" name="spf/spf" ></script>
- panoply 8y agoJust because a library isn't updated, it doesn't mean it's broken. smh.
- neoeldex 8y agoI'm not saying that.
- triskweline 8y agoUnpoly [1] lets you achieve the same effect without having to wrap your content in a JSON transport envelope. There are no two cases for static and dynamic navigation. The HTML you already have is used for transport, fragments are targeted with CSS selectors. [1]: https://unpoly.com/ https://unpoly.com/
- simula67 8y agoHow does this compare to PJAX : https://github.com/defunkt/jquery-pjax https://github.com/defunkt/jquery-pjax ?
- triskweline 8y agoWith pjax you choose a selector that is updated. This is usually a <div> in your layout that houses the main page content. spfjs lets you target multiple containers with a single update, e.g. in YouTube the video area and the sidebar with related content.
- creo 8y agoIsn't this whole idea flawed? How is dynamic JS content update easier for browser than static HTML5 content? Overall amount of CPU time and RAM used will be larger so if anything it's not faster or lighter. Also turning off JS for site using this lib makes it unusable.
- c3833174 8y agoWell, youtube does manage to play the video instantly but having to wait 5+ seconds for recommended videos and comments to load is pretty awful and distracting once they load
- Rjevski 8y agoThe worst is that on Safari (at least, might also affect other browsers), when navigating to a different page and setting the player to fullscreen, it will go back to windowed mode when the other page components (related videos, etc) load. It's a nightmare.
- c3833174 8y agoThat too, and it also happens on firefox
- Rjevski 8y ago> A [...] framework for fast navigation and page updates Not sure what the criteria for "fast" is, but on my 12' MacBook with Safari, it's consistently faster (and less glitchy) to just load a new Youtube page than to let this "fast" navigation do it. Using Youtube is actually painful because of this.
- kerberos84 8y agoI can't agree more. These JS shits makes the web pages unusable day-by-day.
- spiderfarmer 8y agoI have a strong feeling this isn’t actually faster in most cases, but I’ll try and see. Maybe it’s the fact that your main content can in theory load faster than the page parts that are not as important.
- azr79 8y agoEven YouTube isn't using it anymore