
Structured Page Fragments by YouTube (2017) - palerdot
https://github.com/youtube/spfjs
======
neoeldex
What'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
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"](https://s.ytimg.com/yts/jsbin/spf-vflhSOzLf/spf.js")
type="text/javascript" name="spf/spf" ></script>

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

------
triskweline
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/](https://unpoly.com/)

------
Rjevski
> 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
I can't agree more. These JS shits makes the web pages unusable day-by-day.

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

~~~
c3833174
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

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

~~~
c3833174
That too, and it also happens on firefox

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

------
simula67
How does this compare to PJAX : [https://github.com/defunkt/jquery-
pjax](https://github.com/defunkt/jquery-pjax) ?

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

------
azr79
Even YouTube isn't using it anymore

