All Versions
13
Latest Version
Avg Release Cycle
74 days
Latest Release
561 days ago

Changelog History
Page 1

  • v0.13.1

    September 26, 2018

    πŸ› Bug Fixes

    • πŸ›  Fixed a bug in Stencil 0.13 where tags without spaces were incorrectly parsed.
      David Jennes #252
  • v0.13.0

    September 25, 2018

    πŸ’₯ Breaking

    ✨ Enhancements

    • You can now use parentheses in boolean expressions to change operator precedence.
      Ilya Puchka #165
    • βž• Added method to add boolean filters with their negative counterparts.
      Ilya Puchka #160
    • Now you can conditionally render variables with {{ variable if condition }}, which is a shorthand for {% if condition %}{{ variable }}{% endif %}. You can also use else like {{ variable1 if condition else variable2 }}, which is a shorthand for {% if condition %}{{ variable1 }}{% else %}{{ variable2 }}{% endif %}
      Ilya Puchka #243
    • Now you can access string characters by index or get string length the same was as if it was an array, i.e. {{ 'string'.first }}, {{ 'string'.last }}, {{ 'string'.1 }}, {{ 'string'.count }}.
      Ilya Puchka #245

    πŸ› Bug Fixes

    • πŸ›  Fixed the performance issues introduced in Stencil 0.12 with the error log improvements.
      Ilya Puchka #230
    • Now accessing undefined keys in NSObject does not cause runtime crash and instead renders empty string.
      Ilya Puchka #234
    • for tag: When iterating over a dictionary the keys will now always be sorted (in an ascending order) to ensure consistent output generation.
      David Jennes #240

    Internal Changes

  • v0.12.1

    August 30, 2018

    Internal Changes

    • ⚑️ Updated the PathKit dependency to 0.9.0 in CocoaPods, to be in line with SPM.
      David Jennes #227
  • v0.12.0

    August 26, 2018

    ✨ Enhancements

    • βž• Added an optional second parameter to the include tag for passing a sub context to the included file.
      Yonas Kolb #214
    • πŸ‘ Variables now support the subscript notation. For example, if you have a variable key = "name", and an object item = ["name": "John"], then {{ item[key] }} will evaluate to "John".
      David Jennes #215
    • βž• Adds support for using spaces in filter expression.
      Ilya Puchka #178
    • πŸ‘Œ Improvements in error reporting.
      Ilya Puchka #167

    πŸ› Bug Fixes

  • v0.11.0

    April 04, 2018

    ✨ Enhancements

    • βž• Added support for resolving superclass properties for not-NSObject subclasses.
      Ilya Puchka #152
    • The {% for %} tag can now iterate over tuples, structures and classes via their stored properties.
      Ilya Puchka #172
    • βž• Added split filter.
      Ilya Puchka #187
    • πŸ‘ Allow default string filters to be applied to arrays.
      Ilya Puchka #190
    • Similar filters are suggested when unknown filter is used.
      Ilya Puchka #186
    • βž• Added indent filter.
      Ilya Puchka #188
    • πŸ‘ Allow using new lines inside tags.
      Ilya Puchka #202
    • βž• Added support for iterating arrays of tuples.
      Ilya Puchka #177
    • βž• Added support for ranges in if-in expression.
      Ilya Puchka #193
    • βž• Added property forloop.length to get number of items in the loop.
      Ilya Puchka #171
    • Now you can construct ranges for loops using a...b syntax, i.e. for i in 1...array.count.
      Ilya Puchka #192

    πŸ› Bug Fixes

    • πŸ›  Fixed rendering {{ block.super }} with several levels of inheritance.
      Ilya Puchka #154
    • πŸ›  Fixed checking dictionary values for nil in default filter.
      Ilya Puchka #162
    • πŸ›  Fixed comparing string variables with string literals, in Swift 4 string literals became Substring and thus couldn't be directly compared to strings.
      Ilya Puchka #168
    • Integer literals now resolve into Int values, not Float.
      Ilya Puchka #181
    • πŸ›  Fixed accessing properties of optional properties via reflection.
      Ilya Puchka #204
    • No longer render optional values in arrays as Optional(..).
      Ilya Puchka #205
    • πŸ›  Fixed subscription tuples by value index, i.e. {{ tuple.0 }}.
      Ilya Puchka #172
  • v0.10.1

    November 17, 2017

    ✨ Enhancements

    • βž• Add support for Xcode 9.1.
  • v0.10.0

    October 28, 2017

    ✨ Enhancements

    • βž• Adds counter0 to for loop context allowing you to get the current index of the for loop 0 indexed.
    • Introduces a new DictionaryLoader for loading templates from a Swift Dictionary.
    • βž• Added in expression in if tag for strings and arrays of hashable types
    • You can now access the amount of items in a dictionary using the count property.

    πŸ› Bug Fixes

    • πŸ›  Fixes a potential crash when using the {% for %} template tag with the incorrect amount of arguments.
    • πŸ›  Fixes a potential crash when using incomplete tokens in a template for example, {%%} or {{}}.
    • πŸ›  Fixes evaluating nil properties as true
  • v0.9.0

    April 18, 2017

    ✨ Enhancements

    • πŸ‘ for block now can contain where expression to filter array items. For example {% for item in items where item > 1 %} is now supported.
    • if blocks may now contain else if (elif) conditions.
      {% if one or two and not three %}
        one or two but not three
      {% elif four %}
        four
      {% else %}
        not one, two, or four
      {% endif %}
    
    • for block now allows you to iterate over array of tuples or dictionaries.
      {% for key,value in thing %}
        <li>{{ key }}: {{ value }}</li>
      {% endfor %}
    

    πŸ› Bug Fixes

    • You can now use literal filter arguments which contain quotes. #98
  • v0.8.0

    February 18, 2017

    πŸ’₯ Breaking

    • It is no longer possible to create Context objects. Instead, you can pass a dictionary directly to a Templates render method.
      - try template.render(Context(dictionary: ["name": "Kyle"]))
      + try template.render(["name": "Kyle"])
    
    • Template loader are no longer passed into a Context, instead you will need to pass the Loader to an Environment and create a template from the Environment.
      let loader = FileSystemLoader(paths: ["templates/"])
    
      - let template = loader.loadTemplate(name: "index.html")
      - try template.render(Context(dictionary: ["loader": loader]))
      + let environment = Environment(loader: loader)
      + try environment.renderTemplate(name: "index.html")
    
    • Loaders will now throw a TemplateDoesNotExist error when a template is not found.

    • 🚚 Namespace has been removed and replaced by extensions. You can create an extension including any custom template tags and filters. A collection of extensions can be passed to an Environment.

    ✨ Enhancements

    • πŸ”§ Environment is a new way to load templates. You can configure an environment with custom template filters, tags and loaders and then create a template from an environment.

    Environment also provides a convenience method to render a template directly.

    • FileSystemLoader will now ensure that template paths are within the base path. Any template names that try to escape the base path will raise a SuspiciousFileOperation error.

    • πŸ†• New {% filter %} tag allowing you to perform a filter across the contents of a block.

      {% filter lowercase %}
        This Text Will Be Lowercased.
      {% endfilter %}
    
    • You can now use {{ block.super }} to render a super block from another {% block %}.

    • Environment allows you to provide a custom Template subclass, allowing new template to use a specific subclass.

    • If expressions may now contain filters on variables. For example {% if name|uppercase == "TEST" %} is now supported.

    πŸ—„ Deprecations

    • πŸ—„ Template initialisers have been deprecated in favour of using a template loader such as FileSystemLoader inside an Environment.

    • πŸ—„ The use of whitespace inside variable filter expression is now deprecated.

      - {{ name | uppercase }}
      + {{ name|uppercase }}
    

    πŸ› Bug Fixes

    • βͺ Restores compatibility with ARM based platforms such as iOS. Stencil 0.7 introduced compilation errors due to using the Float80 type which is not available.
  • v0.7.2

    December 01, 2016