Releases: nderscore/runty
Releases · nderscore/runty
v0.2.1
v0.2.0
Total library rewrite in TypeScript.
Breaking API changes were introduced, related to how options are set, templates are parsed, and how array output is triggered. The template syntax and everything else is the same though.
Users upgrading from v0.1.x should follow the upgrade guide:
List of changes
⚠️ BREAKING CHANGE:⚠️ New API with distinct methods for generating templates with string or array output. No more separate call to define a client with options - options must be passed for each template (or abstracted into your own wrapper)import { runty, // easy access to both string and array output array, // array only version (tree-shakes better if you only need array output) string // string only version (tree-shakes better if you only need string ouput) } from 'runty'; // define a string-output template: const template = string('some {%template} string', { fns, maxDepth }); // or const template = runty.string('some {%template} string', { fns, maxDepth }); // define an array-output template: const template = array('some {%template} string', { fns, maxDepth }); // or const template = runty.array('some {%template} string', { fns, maxDepth });
⚠️ BREAKING CHANGE:⚠️ Syntax error types are no longer defined as static properties. They are now available via a new enum export,RSyntaxErrorType
⚠️ BREAKING CHANGE:⚠️ Dropped official support for array variable dictionaries (it will probably still work, but is incompatible with types)- Optimization: Replaced array-based AST with safer, object-based AST
- Fix: Calling
$$()
getter function with no arguments returned'[object Object]'
(should return empty string''
) - Fix: Arrays pulled from variable dictionary are no longer automatically collapsed while walking the template tree.
- Fix: Tightened up how regular expressions handled escaped characters (should be faster + less vulnerable to DoS now!)
- Fix: Allow dollar symbol in variable reference property name chains past the first period.
- Before:
- Valid:
{%$$$.bar}
- Syntax error:
{%$$$.$$$}
- Valid:
- After:
- Valid:
{%$$$.$$$}
- Valid:
- Before:
- Fix: Removed configuration dotfiles from final npm package
- Enhancement: Optimized single character regular expressions into simple character equality checks
- Enhancement: Use new
exports
property inpackage.json
for providing esm/commonjs exports - Enhancement: Export TypeScript type definitions with npm package
- Enhancement: Library is now exported as a bundled build instead of a many tiny files, which should improve final bundle impact
v0.1.7
v0.1.6
v0.1.5
v0.1.4
v0.1.3
- Updating website url to https://runty.js.org