Skip to content
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

Support for Handlebars 3.0.0 #400

Closed
saamalik opened this issue Aug 22, 2015 · 12 comments
Closed

Support for Handlebars 3.0.0 #400

saamalik opened this issue Aug 22, 2015 · 12 comments
Milestone

Comments

@saamalik
Copy link

Hi,
Handlebars 3.0.3 is out. Will the latest version of Handlebars receive any love? =)

-Saad

@saamalik
Copy link
Author

@jknack
Copy link
Owner

jknack commented Aug 22, 2015

it is already there:

Handlebars hbs = new Handlebars();

hbs.handlebarsJsFile("/handlebars-v3.0.3.js");

Just download handlebars-v3.0.3.js and add it to the root of your classpath

@saamalik
Copy link
Author

That's cool-- any plans to make 3.0.0 the new default for handlebars-maven-plugin? So we don't have to download and maintain our own copy?

@jknack
Copy link
Owner

jknack commented Aug 24, 2015

yea, 3.0.0 will be the new default once handlebars.java 3.0.0 gets out!

but there is no release date yet... I'm busy working on http://jooby.org which I invited you to try and play :)

@denis111
Copy link

maybe straight to 4.x ? :)

@tgolden-andplus
Copy link

+1 for 4.x support. Your embedded ANTLr grammar doesn't appear to support the block syntax for partials which was added (the error message isn't fantastic either; I thought I was using the wrong handlebars.js file at first and didn't realize the error was actually coming from inside the Maven plugin itself).

@jknack
Copy link
Owner

jknack commented Oct 27, 2015

Hi guys, can you collect what are the new feature of handlebars.js 4.x? For example, I don't know what is: block syntax for partials.

Thanks

@tgolden-andplus
Copy link

If you reference http://handlebarsjs.com/partials.html, one of the new features is the ability to supply fallback / additional content to a partial by invoking it in "block" form, like so:

The normal behavior when attempting to render a partial that is not found is for the implementation to throw an error. If failover is desired instead, partials may be called using the block syntax.

{{#> myPartial }}
  Failover content
{{/myPartial}}

Which will render Failover content if the myPartial partial is not registered.
This block syntax may also be used to pass templates to the partial, which can be executed by the specially named partial, @partial-block. A template of

{{#> layout }}
  My Content
{{/layout}}

with the layout partial containing

Site Content
{{> @partial-block }}

Would render

Site Content
My Content

@tgolden-andplus
Copy link

It also seems like support for partial variables doesn't work either? I get different results compiling with handlebars from npm when using a construct like:

{{> myPartial foo="bar"}}

If I'm interpreting handlebars-lang/handlebars.js#410 correctly this was actually added back in the 2.x release line.

@jknack
Copy link
Owner

jknack commented Oct 27, 2015

partial params does work! do you have problem with handlebar.js integration ?

@tgolden-andplus
Copy link

Hrm, perhaps my configuration of the Maven plugin is wrong then? I'm telling it to use the 3.0.3 handlebars.js file, but my outputted templates.js file does not include the proper hash params. I'll see if I can put together a self-contained test case.

@jknack jknack added this to the 3.0.0 milestone Nov 1, 2015
@jknack
Copy link
Owner

jknack commented Nov 1, 2015

handlebars.java 3.0.0 will comes with handlebars.js 3.0.0 as default

@jknack jknack closed this as completed in 4e06ad8 Nov 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants