Skip to content

Releases: nderscore/runty

v0.2.1

15 Mar 03:49
Compare
Choose a tag to compare
  • Types improvements
    • Replaced ReturnTypes generic slot with internal types based on the shape of the variable dictionary and fns option
    • Made array templates and dictionaries with arrays more usable for TS users

v0.2.0

14 Mar 02:55
Compare
Choose a tag to compare

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:

https://runty.js.org/docs/migrating-from-0-1-x

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: {%$$$.$$$}
    • After:
      • Valid: {%$$$.$$$}
  • Fix: Removed configuration dotfiles from final npm package
  • Enhancement: Optimized single character regular expressions into simple character equality checks
  • Enhancement: Use new exports property in package.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

05 Oct 04:01
Compare
Choose a tag to compare
  • Fixes handling of empty function arguments that occur after a nested function call.

v0.1.6

05 Oct 03:41
Compare
Choose a tag to compare
  • fns and function class exports are now no longer dependent on the same imports (results in smaller bundles)

v0.1.5

04 Oct 18:23
Compare
Choose a tag to compare
  • Fixed support for empty function arguments - {$f(,,,)} calls f with arguments ['', '', '', '']
  • Removed jsconfig.json from npm package. Package should only contain a readme/license and esm/cjs build folders now.

v0.1.4

03 Oct 07:12
Compare
Choose a tag to compare
  • Set sideEffects: false in package.json - enables tree-shaking of imports in webpack

v0.1.3

03 Oct 01:23
Compare
Choose a tag to compare

v0.1.2

02 Oct 06:52
Compare
Choose a tag to compare
  • Minor updates to parser to reach "100%" 😏 test coverage.

v0.1.1

28 Sep 04:24
Compare
Choose a tag to compare
  • Feature-complete release