-
-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor front-end templates & views #21
Comments
what is the plan? just curious since I'm feeling the pain to read all this jade code 👍 |
Yeah, definitely won't be Jade. I'm not sure what to use yet instead. Any suggestions? /cc'ing @peterbraden for some pointers... |
Yeah, I don't really know what the best template engine for node is at the moment. They all seem to suck in their own ways :) Definitely want to look at a system where you can do modular views with templates so it's easy to add view code as plugins - dashboards etc. |
Templates, almost by definition lack modularity. Something I was trying to address with dolphy.js until I realized I don't have any web apps I want to write in my spare time anymore ;) But the other main benefit was that they are valid JS data structures (JSON), so there is no parser, and you can manipulate them in code. Downside might be lack of beauty (ala Jade), but as I think we've determined, that's only skin deep. |
Anyway if nothing else floats your boat, you can probably convince me to work on dolphy again. The code and tests are solid, but it totally lacks docs and real-world use. Obviously writing some docs would be priority zero. It is designed to work with node and requirejs out of the box, so it could be used both server and client-side. |
Current suggestions:
Thoughts/additional ideas? |
there's always handlebars: http://handlebarsjs.com/ IMHO ejs and swig smell too much like JSPs. |
I'm also curious what soured you on Jade. Can't be the significant whitespace ;) |
Jade syntax is super ugly and hard to parse, I personally detest template I actually like swig - template inheritance is super useful in this sort of handlebars is a little too logicless to be easy to use here - while it's There's also a bunch more engines - I'd be interested to look at some of On 12 March 2013 15:31, Casey Duncan notifications@github.com wrote:
Peter Braden |
What about Bliss (https://github.com/cstivers78/bliss)? Is a javascript implementation of the asp.net razor view engine. Pretty easy. |
I personally don't like template engines that embed a language within another, the less logic the better imho. On Mar 12, 2013, at 8:28 PM, Vinícius Gama notifications@github.com wrote:
|
you're talking about the way it uses javascript inside the view? @function display(product) {
<li>@product.name ($@product.price)</li>
}
<ul>
@products.forEach(display)
</ul> |
Right On Mar 12, 2013, at 9:10 PM, Vinícius Gama notifications@github.com wrote:
|
Think swig makes the most sense. @peterbraden's argument is to use template inheritance for the nascent front-end extension system. |
We're now using swig. Fixed! |
Jade is non-standard and poses a barrier to people contributing, as does the mishmash of backbone, apres and handrolled JS.
Suggestions for better solutions welcome.
The text was updated successfully, but these errors were encountered: