Skip to content

Releases: canjs/can-stache

portal() helper

17 Dec 18:38
Compare
Choose a tag to compare

This release introduces the portal helper. This is a helper that allows you to render HTML to somewhere else in the document.

For example, given this ViewModel:

const ViewModel = DefineMap.extend({
   head: {
     default: () => document.head
   }
});

You can now render to the document.head within the template:

{{# portal( head ) }}
  <title>Cart page</title>
  <meta og:title="Cart page">
{{ /portal }}

<p>Rest of the template here...</p>

For more information, check out the portal helper docs.

bracket (ob[key]) infinite recursion fix

15 Dec 17:00
Compare
Choose a tag to compare

This Pull Request fixes a bug that would cause infinite recursion with bracket operators like:

{{let a = prop[ref]}} {{a}}

Literals work in magic tags

14 Dec 16:34
Compare
Choose a tag to compare

This works now {{0}}.

#644

Ordering of for/let/converters causing tests to fail

03 Dec 17:59
Compare
Choose a tag to compare

for and let are now created as part of builtInHelper as they were being removed when __resetHelpers was run and was causing lot's of failures when the order

I also moved most of helpers/converters into core, so that it can be created in the same way as helpers. So that when __resetHelpers is run throughout tests all the helper and converters are added correctly and won't cause tests to fail due to missing helpers.

fix for scope change in case when inside an #each

29 Nov 22:12
Compare
Choose a tag to compare

lazy evaluation and scope issue in partials

29 Nov 17:50
Compare
Choose a tag to compare

#632 Adds lazy evaluation in most scenarios. This will be most obvious in and() and or() helpers. For example, if this.foo in {{#and( this.foo, this.bar )}} is falsy, this.bar will never be evaluated.

Note that some expressions are evaluated no matter what. For example: foo[bar] is evaluated no matter what and so is looking up the method in a call expression like foo(arg1, arg2).

#639 Fixes a scope issue in partials where the scope would change.

not using firstElementChild since it is not supported on fragments in IE11

27 Nov 22:23
Compare
Choose a tag to compare

filenames work in text sections

14 Nov 01:42
Compare
Choose a tag to compare

In a text section like: <div class='{{aValue}}'></div>, the filenames were not working.

#628

SVG rendering

09 Nov 22:49
Compare
Choose a tag to compare

Handle namespace attributes for svg #604

[] in call expressions and recursive inline partials work