You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide all the methods listed in BEMXJST.prototype.locals in exactly the same order to exported function
Make first empty call of compile as first template is always considered to be string
E.g.
// b1.bemtree.jsmodule.exports=function(match,block,elem,mod,elemMod,oninit,xjstOptions,…){block('b1').content()('i am b1');};// server.node.jsconstbemtree=require('bem-xjst').bemtree;constb1=require('./blocks/b1.bemtree');consttmpl=bemtree.compile()// this is the second point, expected to be not necessary .compile(b1);constbemjson=tmpl.apply({block: 'b1'});
Let's support possibility to call template function with just one object argument having all needed methods so it could be used like this:
module.exports=function({block}){block('b1').content()('i am b1');};
I believe it should be possible to support such behavior as an option to make it backward compatible .
The text was updated successfully, but these errors were encountered:
Now to use templates in commonJS format one must:
BEMXJST.prototype.locals
in exactly the same order to exported functioncompile
as first template is always considered to be stringE.g.
Let's support possibility to call template function with just one object argument having all needed methods so it could be used like this:
I believe it should be possible to support such behavior as an option to make it backward compatible .
The text was updated successfully, but these errors were encountered: