Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript framework for pushstate "hijax"

All our apps are php mvc and with a very simple js behavioral layer on top at the client side. We want to structure the javascript more and stop requesting "snippets" to execute simple behaviour (like, loading different jquery plugins all over the place). We do not use javascript MVC frameworks and looking into a best-fit solution for our new apps.

One of the most appealing solution is to keep rendering server side for us, like Twitter does. They call it "Hijax + server-side rendering". We prefer not to have a full blown mvc framework in javascript but these quotes from the blog are very appealing to us:

By contract, our components attach themselves to a single DOM node, listen to events via delegation, fire events on the DOM, and those events are broadcast to other components via DOM event bubbling. [...] Secondly, all of our components are defined using AMD.

We have been trying to build something our own, but without high level javascript expertise we can't get far in this. Something like jquery-pjax seems a good solution for very simple cases too.

We are looking for:

  1. A UI / data segregation to loosly couple XHR with the DOM
  2. Event driven UI, so devs can attach listeners to all kind of DOM objects

Is there something like a javascript framework for this? With pushState getting more and more attention, I hope something will be available. Any ideas?

like image 694
Jurian Sluiman Avatar asked Jan 22 '13 10:01

Jurian Sluiman


1 Answers

You may want to checkout History.js and Amplifyjs (and possibly microjs for some components to put together)

like image 57
dwright Avatar answered Sep 23 '22 21:09

dwright