Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Single page applications allow for more flexible UI design, and that flexibility allows for lots of potential improvements. Forcibly re-drawing the canvas during transitions is quite limiting, and I don't know any visual or interaction designers who couldn't do a better job without that artificial constraint.

Now, whether the benefits of getting rid of that constraint are worth the costs depends entirely on what you're building.



You do not have to re-draw the canvas during transitions. Believe it or not, it is possible to do AJAX declaratively and with progressive enhancement. My approach is to develop forms normally, then add a directive that intercepts them via AJAX, "cuts" certain pieces of the target page and "pastes" it into the current page. It is a very simple, generic and flexible approach. The markup looks like this:

  <form action="/something" submit-to="#x, #y"></form>
  <div id="x" />
  <div id="y" />
Normally, the only thing I need to add to go from non-AJAX to AJAX is submit-to="[CSS Selector Here]". Possibly, some IDs. Everything else works automatically. The library adds a certain attribute to the "pasted" parts, so I can add visual transitions via CSS3. I can use form's action URL to rewrite current URL via push state.




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

Search: