Skip to content

Releases: rur/treetop

Patch fix for Vary header assignment

03 Oct 06:48
@rur rur
af44153
Compare
Choose a tag to compare

Patch fix an issue with the assignment of the Vary header and improve test coverage for
user defined headers.

Bugfix

  • Do not clobber user defined Vary header values when responding from a dual fragment/page endpoint

Stricter template validation and executor refactor

09 Aug 05:59
@rur rur
2c83783
Compare
Choose a tag to compare

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()

FS executor bug fix for RC zero

25 Jun 04:44
@rur rur
0d0690d
Compare
Choose a tag to compare
Pre-release

Quick fix for an issue in the previous release affecting the FS executor.

Bugfix

  • FileSystemExecutor was memoizing template contents
    • This is of little benefit since it only helps at startup time
    • The template contents stay in memory for the lifetime of the app

Housekeeping

  • Add test coverage for DeveloperExecutor forced reloading

Executors Refactor & Template Validation

20 Jun 22:15
@rur rur
90bf27e
Compare
Choose a tag to compare

A refactor of executors, with stricter template validation which may cause breakage.

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
    

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.

Housekeeping

  • 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()

Housekeeping update

11 Apr 02:22
@rur rur
1fdc1d5
Compare
Choose a tag to compare

Bug fixes and minor new features

08 Apr 16:57
@rur rur
5eaaf34
Compare
Choose a tag to compare

New Features

  • FileExecutor and FileSystemExecutor now have an optional KeyedString property to mix files with hard coded templates
  • Added Template interface so that TemplateHandler no longer depends directly on html/template

Bugfix

  • Template cache not used/not working when constructing template in file executors
  • Files not being closed properly in FS executor

API and implementation overhaul, first stable candidate

11 Mar 05:37
@rur rur
1b786b8
Compare
Choose a tag to compare

A quality focused overhaul from the prototype implementation, with many breaking API changes. This release is intended to establish a clear scope for the project and a viable candidate to stabilize.

Views and Executors

Focus library towards constructing endpoints using views, as abstract definitions; and executors to plumb everything together. Executor API was made as extensible as possible to avoid future scope creep for this project.

HTML Template Protocol

For page view hot-swapping, use the content-type header "application/x.treetop-html-template+xml"

Treetop Client v0.9.0 was created to accommodate changes in the protocol introduced in this release.

Review the CHANGELOG.md for more details.

Add clarifications to the prototype library API and improve code docs.

25 Feb 18:28
@rur rur
17227eb
Compare
Choose a tag to compare

Bugfix

  • Writer implementation was not including query in response URL header

Breaking API Changes

  • Remove treetop.Renderer type, unnecessary since it only wraps TemplateExec
  • Add TemplateExec parameter to treetop.NewView.. API method for creating base views
  • Rename treetop.TreetopWriter interface to treetop.Writer to conform to naming guidelines
  • Remove treetop.Test, testing recipes and resources belong elsewhere
  • Split treetop.Writer function into treetop.NewPartialWriter and treetop.NewFragmentWriter and remove the confusing isPartial flag
  • Change treetop.View from an interface to a struct and expose internals to make debugging easier
  • Rename HandlePartial method to HandleSubView in treetop.Response interface to be consistent with the view builder
  • Rename Done method to Finished in treetop.Response interface
  • Rename HandlerFunc signature type to ViewHandlerFunc to make a clearer association with the view builder