2 ms·
I presume you're referring to your EJSRB project: http://github.com/aaronblohowiak/ejsrb/ http://github.com/aaronblohowiak/ejsrb/ I think that the usual way t
by jashkenas 16y ago
I presume you're referring to your EJSRB project:
http://github.com/aaronblohowiak/ejsrb/ http://github.com/aaronblohowiak/ejsrb/
I think that the usual way to share views between different languages is to use a language-agnostic templating engine, like Mustache, or Liquid.
How does EJSRB differ?
- aaronblohowiak 16y agoEJSRB is a full javascript context, and javascript is a language you probably already know. While our views are separate from controllers and models, they often need more advanced string manipulation than liquid or mustache give you. The fact that it is a full javascript context means you can define your own helpers, and have them still work on the client side. For instance, say you want to generate element ids from the json data. This belongs in a function that is accessible to your view layer, but you shouldn't have to program this twice (once for server, once for client.) AFAIK, there isn't a great way to accomplish this code sharing yet.