Compile Templates
Hey All,
We are using the https://github.com/akdubya/dustjs version of dust js in our grails project and we would like to move to the linked in version of this project.
The problem is we created a plugin to precompile templates, which evals a slightly modified version of the dust-full.js file. This works fine. But due to the linkedin version hijacking the 'if' reserved word for the builtin helpers you can't eval the script. The code that is evaling the script in the plugin can be found here: https://github.com/zlegein/dustjs-plugin/blob/master/grails-app/services/DustjsEngineService.groovy
Is there a workaround for this or can you think of a way we can do this with the linkedin. I realize using node would be one way of doing this, but I don't see why we need node just for this.
Thanks, -zach
What error do you get when you run your plugin?
HI Yevgeniy,
I was just looking at the code that was causing us problems and it looks like you may have fixed it
In the file: https://github.com/linkedin/dustjs/blob/master/dist/dust-full-0.4.0.js
The offending line looks like it has been changed since i looked at this awhile back.
line ~532: "if": function( chunk, context, bodies, params ){
I think this was changed to include the quotes around the if. Let me try it again and confirm
-zach
On Tue, May 15, 2012 at 3:50 PM, Yevgeniy Brikman [email protected] wrote:
What error do you get when you run your plugin?
Reply to this email directly or view it on GitHub: https://github.com/linkedin/dustjs/issues/32#issuecomment-5727009
Yup, fixed a little while back: https://github.com/linkedin/dustjs/commit/e1962b6e7d41fcdcc8509514b4a5374bec4d19c1