dustjs icon indicating copy to clipboard operation
dustjs copied to clipboard

Compile Templates

Open zlegein opened this issue 14 years ago • 3 comments

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

zlegein avatar May 15 '12 20:05 zlegein

What error do you get when you run your plugin?

brikis98 avatar May 15 '12 20:05 brikis98

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

zlegein avatar May 15 '12 21:05 zlegein

Yup, fixed a little while back: https://github.com/linkedin/dustjs/commit/e1962b6e7d41fcdcc8509514b4a5374bec4d19c1

brikis98 avatar May 15 '12 21:05 brikis98