[major] BEM-XJST: modifier templates should apply before def()#490
Open
miripiruni wants to merge 2 commits into
Open
[major] BEM-XJST: modifier templates should apply before def()#490miripiruni wants to merge 2 commits into
miripiruni wants to merge 2 commits into
Conversation
Contributor
Author
|
Looks like it’s patch… but I still have doubt about it. |
qfox
reviewed
Oct 30, 2017
| The `def` mode (short for "default") has a special status. It is responsible for generating the result as a whole. This mode defines the list of other modes and the order to go through them, as well as the build procedure for getting the final representation of the HTML element or BEMJSON from the parts generated in the other modes. | ||
|
|
||
| This is a special mode that shouldn’t be used unless truly necessary. A user-defined template that redefines `def` disables calls of the other modes by default. | ||
| This is a special mode that shouldn’t be used unless truly necessary. A user-defined template that redefines `def` disables calls of the other modes by default, exept `mods`, `elemMods`, `addMods` and `addElemMods`. |
miripiruni
force-pushed
the
issue-482__mod-templates
branch
from
October 30, 2017 18:53
020fa6a to
fad15d2
Compare
tadatuta
approved these changes
Nov 16, 2017
Contributor
Author
Contributor
|
Turbo? ;) |
miripiruni
force-pushed
the
issue-482__mod-templates
branch
2 times, most recently
from
February 5, 2018 13:00
8664edb to
12575ca
Compare
miripiruni
force-pushed
the
issue-482__mod-templates
branch
from
February 5, 2018 13:02
12575ca to
0892028
Compare
miripiruni
force-pushed
the
issue-482__mod-templates
branch
from
February 5, 2018 13:06
364a5e8 to
e542cd7
Compare
Contributor
Author
|
@zxqfox it’s a major changes. Integration tests are red. https://nda.ya.ru/3TwoUQ Template from turbo: block('list')(
def()((node, ctx) => applyNext({ items: [].concat(ctx.content || []) })),
addMods()((node, ctx) => {
const mods = { [ctx.ordered ? 'ordered' : 'unordered']: true };
ctx.ordered && node.items.length > 10 && (mods['wide-numbers'] = true);
// у ВинФонов в шрифтах нет некоторых символов, используемых для маркеров
if ((node.data.reqdata.device_detect.OSFamily || '').toLowerCase() === 'windowsphone') {
mods['alt-markers'] = true;
}
return mods;
}),
… |
Member
|
Okay, let's consider this as breaking, but it's a bad code on their side, they can't guarantee they have 😢 but true. |
Contributor
Author
|
PR is locked and waiting next major release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #482