# Stencil Changelog ## Master ### Enhancements - Added an optional second parameter to the `include` tag for passing a sub context to the included file. [Yonas Kolb](https://github.com/yonaskolb) [#214](https://github.com/stencilproject/Stencil/pull/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](https://github.com/djbe) [#215](https://github.com/stencilproject/Stencil/pull/215) - Adds support for using spaces in filter expression. [Ilya Puchka](https://github.com/ilyapuchka) [#178](https://github.com/stencilproject/Stencil/pull/178) - Improvements in error reporting. [Ilya Puchka](https://github.com/ilyapuchka) [#167](https://github.com/stencilproject/Stencil/pull/167) ### Bug Fixes - Fixed using quote as a filter parameter. [Ilya Puchka](https://github.com/ilyapuchka) [#210](https://github.com/stencilproject/Stencil/pull/210) ## 0.11.0 (2018-04-04) ### Enhancements - Added support for resolving superclass properties for not-NSObject subclasses. [Ilya Puchka](https://github.com/ilyapuchka) [#152](https://github.com/stencilproject/Stencil/pull/152) - The `{% for %}` tag can now iterate over tuples, structures and classes via their stored properties. [Ilya Puchka](https://github.com/ilyapuchka) [#172](https://github.com/stencilproject/Stencil/pull/173) - Added `split` filter. [Ilya Puchka](https://github.com/ilyapuchka) [#187](https://github.com/stencilproject/Stencil/pull/187) - Allow default string filters to be applied to arrays. [Ilya Puchka](https://github.com/ilyapuchka) [#190](https://github.com/stencilproject/Stencil/pull/190) - Similar filters are suggested when unknown filter is used. [Ilya Puchka](https://github.com/ilyapuchka) [#186](https://github.com/stencilproject/Stencil/pull/186) - Added `indent` filter. [Ilya Puchka](https://github.com/ilyapuchka) [#188](https://github.com/stencilproject/Stencil/pull/188) - Allow using new lines inside tags. [Ilya Puchka](https://github.com/ilyapuchka) [#202](https://github.com/stencilproject/Stencil/pull/202) - Added support for iterating arrays of tuples. [Ilya Puchka](https://github.com/ilyapuchka) [#177](https://github.com/stencilproject/Stencil/pull/177) - Added support for ranges in if-in expression. [Ilya Puchka](https://github.com/ilyapuchka) [#193](https://github.com/stencilproject/Stencil/pull/193) - Added property `forloop.length` to get number of items in the loop. [Ilya Puchka](https://github.com/ilyapuchka) [#171](https://github.com/stencilproject/Stencil/pull/171) - Now you can construct ranges for loops using `a...b` syntax, i.e. `for i in 1...array.count`. [Ilya Puchka](https://github.com/ilyapuchka) [#192](https://github.com/stencilproject/Stencil/pull/192) ### Bug Fixes - Fixed rendering `{{ block.super }}` with several levels of inheritance. [Ilya Puchka](https://github.com/ilyapuchka) [#154](https://github.com/stencilproject/Stencil/pull/154) - Fixed checking dictionary values for nil in `default` filter. [Ilya Puchka](https://github.com/ilyapuchka) [#162](https://github.com/stencilproject/Stencil/pull/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](https://github.com/ilyapuchka) [#168](https://github.com/stencilproject/Stencil/pull/168) - Integer literals now resolve into Int values, not Float. [Ilya Puchka](https://github.com/ilyapuchka) [#181](https://github.com/stencilproject/Stencil/pull/181) - Fixed accessing properties of optional properties via reflection. [Ilya Puchka](https://github.com/ilyapuchka) [#204](https://github.com/stencilproject/Stencil/pull/204) - No longer render optional values in arrays as `Optional(..)`. [Ilya Puchka](https://github.com/ilyapuchka) [#205](https://github.com/stencilproject/Stencil/pull/205) - Fixed subscription tuples by value index, i.e. `{{ tuple.0 }}`. [Ilya Puchka](https://github.com/ilyapuchka) [#172](https://github.com/stencilproject/Stencil/pull/172) ## 0.10.1 ### Enhancements - Add support for Xcode 9.1. ## 0.10.0 ### 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 ## 0.9.0 ### 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. ```html+django {% 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. ```html+django {% for key,value in thing %}