Skip to content

Releases: bem/bem-xjst

4.3.1

19 Jan 13:40
Compare
Choose a tag to compare

Order of execution matches was changed. Example:

// BEMJSON: { block: 'b' }
// Template:
block('b')(
  // this.ctx.opa is undefined
  match(function() { return this.ctx.opa; })(
    content()(
      // this match will not executed because of match before
      match(function() { return true; })(function() {
        return 'nope';
      })
    )
  )
);
// Result: <div class="b"></div>

4.3.0

19 Jan 13:39
Compare
Choose a tag to compare

BEM-XJST will explicitly throw error if you try to pass arguments to shortcuts for predicates (attrs, bem, cls, content, js, mix, tag and etc).

// Incorrect!
block('b').tag('span'); // Will throw `BEMHTML error: Predicate should not have arguments`

// Correct:
block('b').tag()('span');

Commits:

  • [efa223d413] - Throw error if args passed to shortcut predicates (Vladimir Grinenko)·
  • [059c0b9bfb] - Context: Remove unused BEM field (Vladimir Grinenko)·
  • [351896b840] - util: Remove unused NAME_PATTERN variable (Vladimir Grinenko)·