Skip to content

Releases: canjs/can-stache

Fixed tests for IE11

08 Nov 20:39
Compare
Choose a tag to compare

Fixes issue with the scope with in an else of a for/of

08 Nov 16:07
Compare
Choose a tag to compare

Not using Array.prototype.includes (for IE11 support)

01 Nov 19:46
Compare
Choose a tag to compare

use can-reflect in makeSimpleHelper function

25 Oct 21:24
Compare
Choose a tag to compare

call expressions re-evaluate

24 Oct 20:06
Compare
Choose a tag to compare

If foo changes in this.foo.doSomething(), the expression re-evaluates.

or, and, not helpers; views are callable, inline partials callable, docs improvements

25 Oct 01:20
Compare
Choose a tag to compare

This passes can-component's tests

This re-orgs the docs towards being use-case first:

image

This also deprecates much of the older ways of doing things:

image

It adds 3 new helpers:

  • or( first, second, third )
  • and( first, second, third )
  • not( value ) - this is a converter copied from can-stache-converters

It makes views callable and wires up nodelists:

const addressView = stache(`<address>{{this.street}}, {{this.city}}</address>`);

const view = stache(`{{ addressView(street=user1.street city=user1.city) }}`)

It makes inline partials callable too:

        {{< addressView }}
            <address>{{ this.street}}, {{ this.city }}</address>
        {{/ addressView }}
        <h2>{{ this.user1.name }}</h2>
        {{ addressView(user1) }}

These were both done with a new can.isView symbol we put on view renderers to know these functions are special. When we see this, we make sure to pass the nodeList.

making Bracket expressions work with keys with multiple dots

16 Oct 19:44
Compare
Choose a tag to compare

3.x - Fix for reading props with multiple dots

16 Oct 20:14
Compare
Choose a tag to compare

Fixes possible XSS attack

04 Oct 15:55
Compare
Choose a tag to compare

There's a reflective xss exploit possible when the programmer makes a programming error. If a template value is initialized as null, and then changed into a string containing some exploited string, the string is rendered as a html snippet instead of text.

For example:

var map = new SimpleMap({
     foo: null
});
var frag = stache("<div>{{foo}}</div>")(map);
map.set("foo", "<p></p>");

frag //-> "<div><p></p></div>"

PR: #601

Root Hashes expressions are parseable directly within an expression

03 Oct 14:41
Compare
Choose a tag to compare

This allows the stache expression parser to parse something like foo=bar zed=ted directly within an expression. Stache was able to parse these when inside another expression like a call or helper expression: method(foo=ted).

This was added to support simple setters directly within stache:

<div on:click="this.todo.name = something"></div>