Live data from Hacker News

Twitter to move away from Hashbangs

storify.com

51–60 of 82 posts

Re: Twitter to move away from Hashbangs

#51

Even though Twitter has decided it's either "pushstate or bust" what sort of fallback for pushstate exists for those of us who care about all our users, not just the ones with good browsers?

The fallback is a normal web request and page refresh. This seems far more caring for all of their users than the high load that the hash-bang design placed on client computers.

Re: Twitter to move away from Hashbangs

#52
post #39
post #20

Earlier quoted context omitted.

I'm hoping that they plan to serve up the HTML and CSS for the basic page as quickly as possible, then load the JS that adds the pushState / interactive stuff asynchronously. A page with a single tweet on really shouldn't need to pull down much code. The JS can all be cached by the browser (far future expires headers etc) and there are some neat tricks you can do with app cache and localStorage to make that work even…

This is what they do.

Nope.

At the moment if you go to https://twitter.com/#!/twitter then it loads up the HTML for https://twitter.com/, if you're logged in it will be the tweets of those you follow. Then the javascript magic loads in @twitter's profile dynamically.

PushState will allow twitter to load in the static HTML for @twitter's profile at https://twitter.com/twitter/ and then progressively enhance it with javascript. The net gain will be that the page will be available much faster on initial page load.

Re: Twitter to move away from Hashbangs

#53
post #24

I thought this was about twitter moving away from hashtags. For some reason I got a bit excited, may be because I find vast majority of hashtags to be annoying noise. That said, I know they serve a purpose in specific use cases and donno a better alternative.

Dropping hashtags would be suicide. It's one of the elements that make Twitter unique, and it's even managed to break into mainstream culture in most countries. It doesn't matter that they're full of noise, people just love to tag #somerandomstuff and see it spread (or not), gives them a feeling of belonging, the holy grail of social networks.

Us nerds, we won't care one way or the other anyway.

Re: Twitter to move away from Hashbangs

#54

Even though Twitter has decided it's either "pushstate or bust" what sort of fallback for pushstate exists for those of us who care about all our users, not just the ones with good browsers?

The fallback is a normal web request and page refresh. This seems far more caring for all of their users than the high load that the hash-bang design placed on client computers.

In their case, yes, but the potential speed gain by pushing a lot to the client-side is great when properly harnessed.

Re: Twitter to move away from Hashbangs

#57
post #20
post #16

Earlier quoted context omitted.

It doesn't sound like they're switching to rendering on the backend, though. So you're most likely still going to have to execute a huge chunk of javascript before displaying the page, though hopefully it will get faster.

I'm hoping that they plan to serve up the HTML and CSS for the basic page as quickly as possible, then load the JS that adds the pushState / interactive stuff asynchronously. A page with a single tweet on really shouldn't need to pull down much code. The JS can all be cached by the browser (far future expires headers etc) and there are some neat tricks you can do with app cache and localStorage to make that work even…

this will certainly happen, at least in the places it will be most useful.

Re: Twitter to move away from Hashbangs

#58
post #45
post #31

Earlier quoted context omitted.

That would make sense to me. I always thought it was odd that you weren't allowed to attach a link as metadata, causing the rise of all the various URL shorteners.

The tweet still needs to fit into 140 characters, including any metadata you want visible to the recipient. Think SMS. Hence, might as well make it a user-manageable item in the tweet itself.

I know that was the original idea, but I wonder how many people in the last year or two receive tweets via SMS. If I was in charge, it's a tradeoff I'd be willing to make.

Re: Twitter to move away from Hashbangs

#59
post #7

Earlier quoted context omitted.

~6 months ago IIRC they constantly had problems with their redesign and the last update involved removing the hashbangs

This sounds about right, if not a little earlier. Experimental work for this was done by me here: https://github.com/ianvanness/html5history I believe there were further tweaks for additional pages that needed to be supported (whereas I had only solved, and most likely not very elegantly, the rudimentary issue) that took additional time before the hash bang removal was actually launched.

Thanks - I was estimating off the top of my head - the site was in flux for a while at the time. They also went back and forward with keeping the story sidebar at fixed positioning and it seems they settled on it not floating.

I check the site every couple of weeks because I was interested in how the redesign would work out. It seems they eventually got it right, I like it. A lot of the other blogs have home and article pages that are just too heavy and slow.

Re: Twitter to move away from Hashbangs

#60
post #18
post #16

Earlier quoted context omitted.

It doesn't sound like they're switching to rendering on the backend, though. So you're most likely still going to have to execute a huge chunk of javascript before displaying the page, though hopefully it will get faster.

Dan doesn't say anything about where the rendering will happen. Most sites these day (including Facebook, Gmail, etc) have to execute "a huge chuck of js" before displaying the page. I have been told by some people in the know that they have come up with a system similar to pjax for certain page components, though that may have changed.

True for Gmail, though Google+ renders most of the initial page view in static HTML/CSS, then progressively enhances subsequent pages using JS and a variety of techniques, including embedded frames and pushState. There's a lot that goes into making G+ so fast, and pre-rendering a big is part of it.

By way of comparison, view the following two links in a javascript-less browser (or just view source):

  $ w3m http://twitter.com/#!/danwrong/status/171680703824662528

  $ w3m https://plus.google.com/117377434815709898403/posts/f35f8QvHab7
The first link contains nothing but boilerplate and the JS that lazily loads the real content, whereas the second contains the actual content ready for the client to render immediately (and index, if you're a crawler).

This is a good move by Twitter. I wholeheartedly endorse it.

Post reply on HN