Open itsravenous opened 10 years ago
I totally agree, ace is already opinionated so if you are using it, you might as well use it!
I also think that:
ace_include atom logo
would be a really elegant solution
On 18 Jun 2014, at 14:42, Tom Jenkins notifications@github.com wrote:
Currently, including a component from another is a little ugly, and dependent on relative paths, meaning any future changes to the directory structure would break includes
_header.jade:
include ../../atoms/_logo/_logo Wouldn't it be nice if we could do something like this:
_header.jade
ace_include atom logo Point of consideration: We'd have to use Grunt to replace these with real includes, as Jade categorically does not support dynamic/variable-based includes (the templates are compiled before the data is passed in, soany variable used in a mixin will be empty at include-time). This would mean that ACE would no longer be something you can bootstrap a Jade project with, then drop, as the Grunt task would be required to keep the custom includes working. Is this something we are worried about? I feel like ACE is already a pretty highly-opinionated build stack, so I'm not sure I care too much that it would stop users from using Gulp instead, for example.
What doth @pjhauser think?
— Reply to this email directly or view it on GitHub.
Fantastic. Will get on that.
Having looked into this, we'd need to write a wrapper task for Jade which read in the files, expanded the concise form into real jade includes, and then passed that through to jade.compile
. Non-trivial, but possible, I guess.
Currently, including a component from another is a little ugly, and dependent on relative paths, meaning any future changes to the directory structure would break includes
_header.jade:
Wouldn't it be nice if we could do something like this:
_header.jade
Point of consideration: We'd have to use Grunt to replace these with real includes, as Jade categorically does not support dynamic/variable-based includes (the templates are compiled before the data is passed in, soany variable used in a mixin will be empty at include-time). This would mean that ACE would no longer be something you can bootstrap a Jade project with, then drop, as the Grunt task would be required to keep the custom includes working. Is this something we are worried about? I feel like ACE is already a pretty highly-opinionated build stack, so I'm not sure I care too much that it would stop users from using Gulp instead, for example.
What doth @pjhauser think?