Skip to content

Stricter template validation and executor refactor

Compare
Choose a tag to compare
@rur rur released this 09 Aug 05:59
· 16 commits to master since this release
2c83783

A refactor of executors, with stricter template validation.

Breaking Changes

  • A template will be rejected with an error if it does not contain a template or block declaration
    for all defined sub-view names.

      tErr.Error()
      => template example.html.tmpl: missing template declaration(s) for sub view blocks: "my-block"
    
    • The above can be corrected by adding {{ template "my-block" .MyBlock }} to example.html.tmpl.

Added

  • New treetop.ServeClientLibrary handler serving an embedded copy of the treetop-client JS, for convenience sake

  • Add view.HasSubView method to assert the existence of a sub view name without specifying a template.

      myPage := treetop.NewView("base.html.tmpl", BaseHandler)
      myPage.HasSubView("sidebar") // no template or handler specified
    

Housekeeping

  • Add test coverage for DeveloperExecutor forced reloading
  • Major refactor of Executors to remove duplicate code. The behavior of all executors should remain the same!
  • Replace deprecated use of HeaderMap in favor of .Header()