English | 简体中文

Upgrade log

  • Fixed bug: Single quotes in CSS, it will do two escaped #6
  • map() method supported, which allows the user to custom template syntax that can parse most languages such as PHP and JSP
  • Fix the compile tools bug, when template file extention is not .tpl
  • According to AMD/CMD, support synchronous invocation (require), on the basis of continued to support asynchronous invocation (nodetpl.get), users can according to oneself circumstance to decide synchronous or asynchronous
  • Security for XSS injection filter, new syntax "==" added.
  • Precompiled tools encoding setting supportted.
  • Most of the code refactoring, optimize the rendering mechanism to improve rendering performance
  • css, the root element selectors can no longer use the blank expressed as: {dispay: block;} should be written $ ROOT {display: block;}
  • Template attribute references, it is no longer recommended to write directly attribute name, you need to add the attribute name in front of the "@", such as: <?=@title?>, but still be allowed non-strict mode
  • Adjust the command line tools related input parameter names
  • Under AMD / CMD / CommonJs / ES6 mode, you can not run directly dependent node tpl
  • Optimization algorithm template js code
  • Optimization for node.js require function, supports relative path references
  • Optimization nodetpl for node.js, resolved anomalies bug which can cause the application to crash
  • Optimization nodetpl for node.js, the template files can be run in a sandbox
  • Fixed several bug when using nodetpl in exporess.js
  • Optimization of a modular loading (CMD / AMD), improve compilation performance
  • $ROOT / $SUBROOT is deprecated, if you use jQuery, you can use $(ROOT) and $(SUBROOT) instead of $ROOT, $SUBROOT important changes
  • config.vars property is deprecated
  • get() method enhanced to support direct read template code, suspend rendering
  • Add exec method
  • Perfect CMD support, improve operational efficiency at the scene of modular code
  • render method of increasing the synchronous, asynchronous two ways

    Conventional usage (asynchronous):

    nodetpl.render(..., data, function(d){
      // Here is the compilation results

    Synchronization method (insecure, consider adapting more scenes, does not support the use of such rendering method, use asynchronous):

    var html = nodetpl.render(..., data);
  • Perfection <?=..?> variable function, automatically determine whether the reference is undefined
2.1 to 2.2
  • Compilation tools to do a major upgrade, no longer asked to enter -o attribute, supporting documents monitor, supports the specified template suffixes
2.0 to 2.1
  • Keyword "@" can be omitted, in a future version to be deprecated
1.x to 2.0
  • Support flexible configuration by config engine switch
  • Built _fixcss method soon abandoned, compiled using version 1.x templates need to be recompiled
  • Official support CMD modular development
  • Multiple templates referenced by the "require" keyword to "include", the original "require" keyword is deprecated
  • Add a keyword ROOT, on behalf of the native DOM nodes
  • By default, $ROOT point to a jQuery object (selector $("#~")), for the use of other libraries, manually config settings
      vars: {
        root: '...'