3 ms·
1. I don't want to dabble with templating on a server. It's annoying, and separates two layers that I don't want separated. 2. It needs to work offline, and fo
by kalms 13y ago
1. I don't want to dabble with templating on a server. It's annoying, and separates two layers that I don't want separated.
2. It needs to work offline, and for me to support that, I would have to double up on work, and maintaining two levels of templating.
3. No framework has made this easy, in fact new frameworks seem hell bent on making it even harder. See http://bone.io http://bone.io
4. Telling us to "do that." is not going to make it happen. It has to be easier, and clearly it is not: Otherwise more developers would be doing it. I want someone to convince me, but I have yet to see a post going in depth on the technical implementation of such a solution (- that adheres to the 3 points mentioned above).
5. Document-oriented sites (blogs, wikis, maybe even forums) should never have been implemented with only JS in mind anyway.
- jaffathecake 13y agohttp://lanyrd.com/mobile/ http://lanyrd.com/mobile/ works offline, without JS, shares templates between the client and the server for updating pages async and rendering offline. Doesn't use a framework so it doesn't have a huge JS payload.
- kalms 13y agoFrameworks doesn't necessarily mean you're delivering a huge JS payload, but more to the point: How was that template sharing achieved? Would love some notes on the technical implementation.
- jaffathecake 13y agoThe templates are mustache, delivered via a single JSON file (https://m.lanyrd.com/templates.v356.js https://m.lanyrd.com/templates.v356.js). They're used on: * The server-rendered web (python) * The enhanced & offline web (javascript) * The ios app, where native views aren't used * The android app, as above The client code is pretty dumb, it knows how to turn a link into an API call, the api response basically says "Render template x or equivalent native view) with this data…"
- bpierre 13y agoAbout #3, DerbyJS [1] seems to precisely address this, while keeping concepts used by Angular / Ember / etc., like declarative events. It seems like a huge step for me, I don’t understand why it’s not more popular on HN. [1] http://derbyjs.com/#introduction http://derbyjs.com/#introduction