Skip to content

Curly 2.0.0

Compare
Choose a tag to compare
@dasch dasch released this 01 Jul 16:17
· 228 commits to main since this release

This is the second major release of Curly, and there's some awesome new stuff in there as well as some breaking changes.

Breaking Changes
  • Some methods and exceptions have been renamed to emphasize the nomenclature used by Curly: components consist of a name, an optional identifier and a set of attributes.
  • The syntax checker is now stricter. If a presenter method has a required argument, a component must specify an identifier. If the method doesn't have an argument, a component must not specify an argument.
New Features
  • Components can now have attributes, e.g. {{widget width=200px height=100px title="Hello there!"}}. Any attribute specified on a component must be present as a keyword argument on the presenter method. If the keyword argument is required, the attribute must be specified.
  • Collection blocks allow you to enumerate a collection right within a Curly template! Using the special {{*<component>}} block syntax, e.g. {{*comments}}<li>{{body}} -- {{author}}{{/comments}}, you can specify a sub-template that is used to render each item in the collection returned by the presenter method. The presenter class used to render the sub-template is deduced based on the component name; in this case, CommentPresenter.