Closed tadatuta closed 9 years ago
Fixed in 5a26b32, thanks!
I found out that there's still inconsistency in a way how it works in bem-xjst
< 2.0:
For BEMJSON { block: 'b1' }
and templates
block('b1')(
mode('custom')(function() {
console.log(this.block); // b2
return 'in b1';
}),
content()(function() {
return apply('custom', { block: 'b2', trololo: 'blah' });
})
);
block('b2').mode('custom')(function() {
return 'in b2';
});
there will be <div class="b1">in b1</div>
but <div class="b1">in b2</div>
expected.
@tadatuta I think it was our initial plan to make it behave slightly different for performance reasons. What is your use case, is there any workaround for it?
Looks like there's no backward-compatible workarounds. Current use case is kinda global block which provides modes to be called from other blocks. If support for such possibility is performance heavy we'll think if we can drop compatibility in this case.
It could be implemented, but with the price of performance. Let's close this for one, and reopen and do minor version bump if there would be serious issues about it. Thanks!
Is there still a way to do something like this: for BEMJSON
and template
?