9 points · by alecbenzer · 15y ago · 8 comments
Does something like this already exist, and I just haven't noticed it? And if not, is this a good idea? I've been thinking about trying something like this out in a project, but I have a tendency to overlook things and go ahead doing something that I think is smart but that I later realize has some flaw that makes it not a good idea. So I wanted some other thoughts on this.
https://github.com/danski/spah
What @angryamoeba (danski on github) is trying to do, in so far as i have understood it is to address the problem that say twitter has in that it loads up a dumb empty template, and then you have to wait for the JS app to boot up and populate your page.
Instead what he's tried to do is specify a consistent way to specify data in HTML documents (via data attributes), and a framework for syncing modifications to data between the client and server (and this is bi-directional).
That way, if you're doing a cold boot, data is specified in page, and if the client has already loaded an object, full pages/data don't have to be pulled down to the client when things change, and likewise full page state doesn't have to be shoved up to the server when the client changes something.
I find that stitching my own framework from quality open source components gives me a bit more flexibility than Rails (rails user since version 0.7) and lets me get closer to the metal when I need it. Your mileage may vary :)
And no, you're definitely not retarded.
1> Decoupling. Add APIs / more clients in future 2> Effective use of skills. Many developers specialize in one of the two. 3> Parallel development of client and server 4> Future client side caching, tracking etc. (can be solved with a lot of server code)
This is not to say one should not do it, use cases differ.
To see a working product
https://www.erpnext.com/#!demo
A new version is on the works, if you are interested send me a message via github