Releases: chharvey/template-processor
Releases · chharvey/template-processor
Release list
v2.0.0-beta.0
Breaking
- introduce new type param to
ProcessingFunction{,Async}, which defines the type of content being processed (eitherDocumentorDocumentFragment) - The
ProcessingFunctionandProcessingFunctionAsynctypes are now context-less function types. This means when sending a function in for yourinstructionsargument, it must not have athiscontext. The recommended way to enforce this is to use arrow() => {}syntax:This change is breaking if your code usesnew Processor<T, U>(template, (frag: DocumentFragment, data: T, opts: U): void => { //... })
thisinside a function and expects it to be called with athiscontext.
New Features
- static
.process()and.processAsync()param@fragtakes aDocumenttype in addition toDocumentFragment
v1.3.0
v1.2.0
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:populateListfor details, and see README for examples. - static method
.processAsync()and instance method#processAsync()now accept promises for the@dataand@optsparams - type parameter
@UonProcessorconstructor is typeobjectby 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
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 extendCallableFunction(TypeScript v3.2+) by default, improving type inference with--strictBindCallApply
Fixes
- upgrade to TypeScript v3.2
- upgrade to Gulp v4
- update documentation, comments, & dependencies