gulp-bem / gulp-bem-xjst

DEPRECATED repository, moved to https://github.com/bem/gulp-bem/tree/master/packages/gulp-bem-xjst
MIT License
6 stars 3 forks source link

Update bem-xjst to version 7.3.0 🚀 #48

Closed greenkeeperio-bot closed 7 years ago

greenkeeperio-bot commented 8 years ago

Hello lovely humans,

bem-xjst just published its new version 7.3.0.

State Update :rocket:
Dependency bem-xjst
New version 7.3.0
Type dependency

This version is not covered by your current version range.

Without accepting this pull request your project will work just like it did before. There might be a bunch of new features, fixes and perf improvements that the maintainers worked on for you though.

I recommend you look into these changes and try to get onto the latest version of bem-xjst. Given that you have a decent test suite, a passing build is a strong indicator that you can take advantage of these changes by merging the proposed change into your project. Otherwise this branch is a great starting point for you to work on the update.

Do you have any ideas how I could improve these pull requests? Did I report anything you think isn’t right? Are you unsure about how things are supposed to work?

There is a collection of frequently asked questions and while I’m just a bot, there is a group of people who are happy to teach me new things. Let them know.

Good luck with your project :sparkles:

You rock!

:palm_tree:


GitHub Release

2016-09-21 v7.3.0, @miripiruni

1. Support mod() and elemMod() without second argument

/**
 * @param {String} modName name of the block modifier
 * @param {String|Boolean} [modVal] value of the block modifier
 */
mod(modName, modVal)

If second argument of mod() was omited then templates with any
non-empty value of modifier will be applied.

block('a').mod('size').tag()('span');

Template will be applied to BEMJSON node if block equals to 'a' and
'size' modifier exists (equals neither to undefined nor to '' nor to false
nor to null).

{ block: 'a', mods: { size: true } },
{ block: 'a', mods: { size: 's' } },
{ block: 'a', mods: { size: 0 } }

But templates will not be applied to entities:

{ block: 'a', mods: { theme: 'dark' /* no `size` modifier */ } },
{ block: 'a', mods: {} },
{ block: 'a', mods: { size: '', } },
{ block: 'a', mods: { size: undefined } },
{ block: 'a', mods: { size: false } },
{ block: 'a', mods: { size: null } }

The same for elemMod() mode.

2. Runtime lint warning for class and data-bem attributes in attrs field in BEMJSON or attrs() template result.

BEMJSON:

// class in attrs
{ block: 'class-attr-bemjson', attrs: { id: 'test', class: 'jquery' } },
{ block: 'class-attr-tmpl' },

// 'data-bem' in attrs
{ block: 'databem-attr-bemjson', attrs: { 'data-bem': { block: 'a', js: true } } },
{ block: 'databem-attr-tmpl' }

Templates:

block('class-attr-tmpl').attrs()(function() {
    return { class: 'wrong' };
});

block('databem-attr-tmpl').attrs()(function() {
    return { 'data-bem': 'wrong' };
});

Now with such templates or such BEMJSON you will get warnings:

BEM-XJST WARNING: looks like you’re trying to set HTML class from attrs field in BEMJSON. Please use cls() mode for it. See documentation: https://github.com/bem/bem-xjst/blob/master/docs/en/5-templates-syntax.md#cls
ctx: {"block":"class-attr-tmpl"}
attrs: {"class":"wrong"}

BEM-XJST WARNING: looks like you’re trying to set data-bem attribute from attrs field in BEMJSON. Please use js() mode for it. See documentation: https://github.com/bem/bem-xjst/blob/master/docs/en/5-templates-syntax.md#js
ctx: {"block":"databem-attr-bemjson","attrs":{"data-bem":{"block":"a","js":true}}}
attrs: {"data-bem":{"block":"a","js":true}}

BEM-XJST WARNING: looks like you’re trying to set data-bem attribute from attrs field in BEMJSON. Please use js() mode for it. See documentation: https://github.com/bem/bem-xjst/blob/master/docs/en/5-templates-syntax.md#js
ctx: {"block":"databem-attr-bemjson","attrs":{"data-bem":{"block":"a","js":true}}}
attrs: {"data-bem":{"block":"a","js":true}}

BEM-XJST WARNING: looks like you’re trying to set data-bem attribute from attrs field in BEMJSON. Please use js() mode for it. See documentation: https://github.com/bem/bem-xjst/blob/master/docs/en/5-templates-syntax.md#js
ctx: {"block":"databem-attr-tmpl"}
attrs: {"data-bem":"wrong"}

Commits:


The new version differs by 73 commits (ahead by 73, behind by 8).

There are 73 commits in total. See the full diff.


This pull request was created by greenkeeper.io.

Tired of seeing this sponsor message? :zap: greenkeeper upgrade

miripiruni commented 7 years ago

See https://github.com/gulp-bem/gulp-bem-xjst/pull/69