Skip to content

Releases: vapor/leaf-kit

Release Candidate 1

01 Mar 16:58
d195379
Compare
Choose a tag to compare
Release Candidate 1 Pre-release
Pre-release

Update to Swift 5.2 and macOS 10.15. Add additional CI + README updates.

Release candidates represent the final shift toward focusing on bug fixes and documentation. Breaking changes will only be accepted for critical issues. We expect a final release of this package shortly after Swift 5.2's release date.

Add support for nested key paths in loops

12 Feb 21:33
14014a1
Compare
Choose a tag to compare

Added support for using nested paths when specifying the right-hand expression of a for loop in Leaf templates.

For example with the following code:

struct Show: Content {
    let title: String
    let cast: [CastMember]
    
    struct CastMember: Content {
        let name: String
        let characterName: String
    }
}

let thirthyRock = Show(title: "30 Rock", cast: [
    Show.CastMember(name: "Tina Fey", characterName: "Liz Lemon"),
    Show.CastMember(name: "Alec Baldwin", characterName: "Jack Donaghy"),
    ...
])

...
req.view.render("ShowInfo", [thirthyRock])
...

It is now possible to use a Leaf template such as:

#for(show in shows):
    <h2>#(show.title)</h2>
    <h4>Cast</h2>
    #for(castMember in show.cast):
        <p>#(castMember.name) as #(castMember.characterName)</p>
    #endfor
#endfor

Add isEnabled Flag to LeafCache

04 Feb 20:21
58819c3
Compare
Choose a tag to compare
Pre-release

Adds a settable isEnabled flag to LeafCache to allow for caching to be turned on and off during runtime. (#29)

LeafKit 1.0.0 Beta 2

09 Dec 20:32
0094f15
Compare
Choose a tag to compare
LeafKit 1.0.0 Beta 2 Pre-release
Pre-release
  • Fixed an issue with nested tags (#21)

  • Renamed LeafConfig to LeafConfiguration (#25)

  • Publicized LeafCache protocol (#25)

  • Enabled test discovery on Linux (#26)

LeafKit 1.0.0 Alpha 1

22 Aug 20:06
Compare
Choose a tag to compare