Hacker News new | past | comments | ask | show | jobs | submit login
Structured Page Fragments by YouTube (2017) (github.com)
27 points by palerdot 10 months ago | hide | past | web | favorite | 17 comments

What's the reason for posting this? It's been posted before (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 :)

It'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" type="text/javascript" name="spf/spf" ></script>

When a PR isn't merged or closed within a couple of months at least, the project doesn't look healthy to me. It might still function. Just wondering what the reason of reposting this would be.

Youtube.com migrated to polymer in 2017

Just because a library isn't updated, it doesn't mean it's broken. smh.

I'm not saying that.

Unpoly [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/

> 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.

I can't agree more. These JS shits makes the web pages unusable day-by-day.

Isn'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.

Well, 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

The 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.

That too, and it also happens on firefox

I 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.

How does this compare to PJAX : https://github.com/defunkt/jquery-pjax ?

With 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.

Even YouTube isn't using it anymore

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact