Skip to content

1.1.0 Dynamic Partial Resolution

Choose a tag to compare

@theodorejb theodorejb released this 27 Mar 04:09
· 32 commits to master since this release

Added

  • HelperOptions::hasPartial(): check whether a named partial is registered at runtime.
  • HelperOptions::registerPartial(): register a compiled partial closure from within a helper, enabling the same lazy-loading pattern as Handlebars.registerPartial() in Handlebars.js (#5, zordius/lightncandy#296).

Fixed

  • Nested {{> @partial-block}} calls from runtime partials.
  • Failover rendering for {{> partial}}fallback{{/partial}} blocks where the partial is also called conditionally earlier in the template.
  • isset($options->fn) and isset($options->inverse) now correctly return true for all block helper calls, even when the block is inverted or lacks an {{else}} clause.
  • Closures at complex paths without any arguments (e.g. {{#obj.fn}}) are no longer passed a HelperOptions argument (matching Handlebars.js behavior).
  • Inverted sections with literal block paths (e.g. {{^"foo"}}) now correctly route through blockHelperMissing.
  • With knownHelpersOnly enabled, inverted sections now correctly skip dispatch to unregistered runtime helpers.
  • ../ expressions inside an {{else}} body now correctly resolve to the block helper's scope when there is no enclosing block context.
  • .length lookup on block param variables and in strict mode.