tildeio / htmlbars

A variant of Handlebars that emits DOM and allows you to write helpers that manipulate live DOM nodes
MIT License
1.6k stars 193 forks source link

Fix compile and run #325

Closed chancancode closed 9 years ago

chancancode commented 9 years ago

Some recent changes broke compile-and-run, I think I fixed it! (see the commit messages for details about each change)

chancancode commented 9 years ago

By the way, attempting to invoke a non-existent helper (e.g. putting {{#if ...}} in the demo) now blows up with an undefined.call(...). I haven't digged deep enough to know if that is expected or not. I might need to pass something more sophisticated than an empty POJO to render, unsure. But before my commit it was blowing up for a different reason (passing undefined as helper, so it did something like undefined["if"] in lookupHelper), so this is at least a partial fix.

mmun commented 9 years ago

Now that idempotent-rerender has been merged helpers should look the same across all "implementations" of HTMLBars. We could (should?) bake in the basic ones (if, each, etc).

chancancode commented 9 years ago

Second pass:

Should be good to go! (The if, each thing could come later, and is unrelated to this patch :smile:)

mmun commented 9 years ago

Thanks. We really need to improve the top-level ergonomics :sweat_smile: