
Some time ago we
wrote that a new interface had appeared in Yandex.Mail that uses template data in the browser. Few major services dared to do this, but we still consider this solution as the most successful. It not only accelerated the operation of the interface, but also allows you to save user traffic and more efficiently spend the processor time of the servers.
Then we used XSL as a template engine, and the data was transmitted in XML format. Having transferred the project to a new interface, we started looking for other ways to speed up the work of the Yandex.Mail interface.
Recently we transferred all Mail to JS template engine and JSON data.
Reasons for not using XML / XSLWe are very fond of XSL, it is expressive, it is really convenient to write templates for large services with complex connections, a large number of reusable blocks and the ability to redefine or extend blocks. But he has a number of significant drawbacks:
')
- Does not develop
If you look at browser browsers, the latest mentions of XSL mentioned by developers are dated 2004 (the problem in Chrome is especially obvious on the graphs below).
-, , , IE IE. , , , xsl:call-template
, — . xsl:output
.
.
XSL- — , , , , , .- C
xslt , exslt, , - . - XML-
, E4X – , spidermonkey. E4X JSON.
( , ) , :
yate,
handlebars,
jade,
dust ajaxslt.
json- , .
(, , , , , ), /. .
, (handlebars, jade, dust) , «», . XSL , .
, yate ajaxslt. , , ajaxslt yate 500 .
200 :
YateYate — , - . , . Yate XSL: js- (match, apply), , jpath — XPath JSON. javascript , .
XSL yate:

, , yate — , JavaScript XSL-. , , JS , .
yate, 40% , . … 1200%!
, .
– JS-, , :

, , .
, , , , , :

, – 200. 30 , :

— - ,
debugger
, .
log
, , .
, . yate . , , , , HTML.

yate , , . , JavaScript :

. .
, , JSON, E4X XML2JSON. , , XSL/XML, . . , «» :

:

, , .
DIY, yate . yate ,
npm install yate
.
jpath. XPath JSON (
jpath no.path)
vim Sublime Text. XSL-, , yate
xsl2yate.