Skip to content

Releases: chharvey/template-processor

v2.0.0-beta.0

v2.0.0-beta.0 Pre-release
Pre-release

Choose a tag to compare

@chharvey chharvey released this 05 Sep 15:02

Breaking

  • introduce new type param to ProcessingFunction{,Async}, which defines the type of content being processed (either Document or DocumentFragment)
  • The ProcessingFunction and ProcessingFunctionAsync types are now context-less function types. This means when sending a function in for your instructions argument, it must not have a this context. The recommended way to enforce this is to use arrow () => {} syntax:
     new Processor<T, U>(template, (frag: DocumentFragment, data: T, opts: U): void => {
     	//...
     })
    This change is breaking if your code uses this inside a function and expects it to be called with a this context.

New Features

  • static .process() and .processAsync() param @frag takes a Document type in addition to DocumentFragment

v1.3.0

Choose a tag to compare

@chharvey chharvey released this 25 Jan 20:32
  • extend aefd74a to all options param types: type object by default
  • minor updates, fixes, optimizations

v1.2.0

Choose a tag to compare

@chharvey chharvey released this 25 Feb 16:44

Features

  • all-new static methods Processor.populateList{,Async} can be used to populate <ol>, <ul>, <dl>, <table>, <thead>, <tbody>, <tfoot>, and <tr> elements with a sequence of data. See TypeDoc comments in /src/class/Processor.class.ts:populateList for details, and see README for examples.
  • static method .processAsync() and instance method #processAsync() now accept promises for the @data and @opts params
  • type parameter @U on Processor constructor is type object by default

Fixes

  • if an async instructions function was specified on construction, calling #process() (synchronously) used to log a warning; it now logs an info
  • update & improve README

v1.1.0

Choose a tag to compare

@chharvey chharvey released this 05 Jan 18:37

Features

  • add asynchronous capability (see readme for docs)
  • add new static methods .process() and .processAsync() — equivalent to the instance methods, but helpful when you don’t have a <template> element
  • ProcessingFunction{,Async} now extend CallableFunction (TypeScript v3.2+) by default, improving type inference with --strictBindCallApply

Fixes

  • upgrade to TypeScript v3.2
  • upgrade to Gulp v4
  • update documentation, comments, & dependencies

v1.0.1

Choose a tag to compare

@chharvey chharvey released this 05 Sep 14:24

Fixes

  • forgot to deploy dist to npm
  • update readme