Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: gh-pages
Commits on May 20, 2015
  1. Commit 64 (Post Beta)

    - debugMode is now false by default - which means
      that on error, an exception is thrown, rather than
      outputting an error message in the rendered output.
      To obtain previous behavior, set debugMode to true:
    - The $.views.sub.cvt() no longer exists. Use tag.cvtArgs().
    - AMD and CommonJs support for both JsRender and JsViews,
      providing both for NodeJS scenarios, and scenarios in which
      requireJS or similar AMD script loaders are used to load
      JsRender, JsObservable or JsViews.
    - Support for JsRender in NodeJS:
      Support for Express and Hapi view engines using JsRender
      Support for loading templates from file, on Node, using
      the syntax: tmpl="@file.path"
    - $.templates() now has an equivalent alternate name (alias):
      $.views.compile() which allows for immediate integration in some
      frameworks, such as Hapi templated views.
    - Similarly, a compiled template now has an alternative shortcut API
      for the render method. The compiled template is it's own render
      function, so for a compiled template: var tmpl = $.templates(...);
      the following are equivalent:
      tmpl.render(data, helpers);
      tmpl(data, helpers);
    - Support for allowCode has been simplified and improved. Docs to
      follow. You can now enable allowCode globally using
      $.views.settings.allowCode. A new tag: {{*: expression}} will
      return the evaluated expression - like {{: expression}} - but here
      the expression can allow any code.
    - JsRender now has noConflict support, for loading a new instance of
      JsRender, without conflict with an already loaded instance.
    - Tag property names can now include '.' and '_' characters:
      {{myTag _a=3 b.c=4 /}}
    - Support simplified syntax when defining custom tags with just a markup
      string (template), or jsut a render method:
      $.views.tags("myTag", "this is the template");
      $.views.tags("a", function(...){
         //this is the render function
    - The debug helpers: {{dbg:}} {{dbg ...}} {{~dbg()}} now throw and catch,
      rather than including a debugger; statement. To use this feature set
      your browser/debugger to stop on caught exceptions.
      (See also #239)
    - A lot of changes have been made to considerably optimize performance
      when using JsRender to render simple templatesPerf. Optimized template
      will not need to instantiate view objects, and hence will be faster.
      A compiled template has a tmpl.useViews property which shows whether
      it allowed that optimization. (tmpl.useViews false)
    Bug Fixes:
    - #239:
    - #252
      (Improved syntax error message e.g.:
      '{{include}} block has {{/for}} with no open {{for}}'
Commits on Mar 5, 2015
  1. Commit 63 (Post Beta)

    - Removed minor undocumented feature where custom tags
      could return false from init.
    - A new itemVar feature allows you to set a context variable
      on any tag, to provide access to the block context, even
      within nest tag blocks below.
      e.g. {{for people itemVar="~person"}}
      See #256
    - Many new unit tests added for the above new feature.
    - Some small additional bug fixes.
Commits on Feb 9, 2015
  1. Commit 62 (Post Beta)

    - Tag inheritance now supports multi-level inheritance with
      easy invocation of the base class implementation using
      this.base(...) or this.baseApply(arguments):
        baseTag: "for",
        onAfterLink: function() {
      Similarly for callbacks declared declaratively on tags:
      {{for items onAfterLink=~myHelper onUpdate=~dbg}}...
      function myHelper() {
    - Many new unit tests added for the above feature.
    - Some small additional bug fixes.
Commits on Dec 25, 2014
  1. Commit 61 (Post Beta)

    - Improvements and bug fixes for complex templates using
      computed properties, with or without parameters,
      including computed values which return objects, and
      using paths which chain computed values - for example:
      {{:a.b().c.d.e(p, q).f}}
    - Full support for deep paths with computed values and
      optionally involving complex expressions - for example:
      {{:a.b().c.d.e(p + (r - 1), q + 't').f + 'x' + g}}
    - Improved support for custom tag inheritance from
      base tag - e.g.: {baseTag: "for", ...}
    Bug Fixes
    - Several small additional bug fixes.
Commits on Oct 15, 2014
  1. Commit 60 (Post Beta)

    - Sync with updated version 60 of JsViews.
Commits on Sep 30, 2014
  1. Commit 59 (Post Beta)

    - sync with updated version 59 of JsViews.
Commits on Sep 20, 2014
  1. Commit 58 (Post Beta)

    - sync with updated version 58 of JsViews
Commits on Sep 19, 2014
  1. Commit 57 (Post Beta)

    Some small bug fixes and improvements, as well as the following specific
    fix and improvement:
    Bug fixes:
      - ~tag.parents or ~parentTags now includes the current tag
Commits on Aug 11, 2014
  1. Commit 56(Post Beta)

    IMPORTANT: This commit corrects an important IE8 bug that was
    in the previous commit (55)
    This commit also includes some significant updates and improvements:
    - New API for creating derived tags - simply specify "baseTag" on
      the custom tag declaration:
        range: {
          // Inherit from {{for}} tag
          baseTag: $.views.tags["for"],
      See samples:
    - Bug fixes:
Commits on Jul 23, 2014
  1. Commit 55 (Post Beta)

    - Sync with JsViews update 55 (with new 'trigger' feature)
    - Several minor bug fixes
Commits on Jul 11, 2014
  1. Commit 54 (Post Beta)

    Note that this update brings important perf optimizations and many
    significant feature improvements, with corresponding changes to the
    For normal usage patterns these do not correspond to breaking changes.
    However there could possibly be breaking changes on a few advanced
    If appropriate, please file issues if breaking changes are
    observed. See also the samples and unit tests for changes that take
    advantage of new features below.
    New features and improvements
    - Many major performance improvements, including much improved
      performance for {{>...}} - and optimizations allowing extremely
      fast rendering for render() in the case of simple templates.
    - Support for overriding error messages.
      $.views.settings({onError: function(...) {...}});
      (See unit tests. Examples to follow.)
    - BREAKING: {{:expression noError=true}} is no longer supported.
      Replaced by more powerful and extensible 'onError' feature below.
      (onError=null or onError='' replaces previous noError=true)
    - New 'onError' feature: fallback strings or onError handlers for
      any tag instance: e.g. {{:missing.object onError='fallbackString'}}
      or {{myTag onError=myErrorHandler/}}.
      (See unit tests. Examples to follow.)
    - tagCtx.params now provides stuctured information about props and
      args - parameter string for each
    - $.views.sub.parse(parameterExpression) converts any parameter
      expression to corresponding code.
      Include bindingsArray:
      $.views.sub.parse(parameterExpression, bindingArray) to obtain
      list of path expressions for dependencies
    - Custom tags: Having an empty template: "" in tag definition is
      now supported.
    Associated bug fixes for JsViews:
      - Fix for collision with tags which add props() jQuery method:
Commits on May 3, 2014
  1. Commit 53 (Post Beta)

    Bug fixes:
    Small optimization changes - sync with update 53 of JsViews
Commits on Mar 25, 2014
  1. Commit 52 (Post Beta)

    Note that this update brings significant feature improvements
    with corresponding changes to the implementation. For normal
    usage patterns these do not correspond to breaking changes. However
    there could possibly be breaking changes on a few advanced scenarios.
    If appropriate, please file issues if breaking changes are
    observed. See also the samples and unit tests for changes that take
    advantage of new features below.
    New features and improvements
    - {{: xxx}} can now be used without arguments, so {{:}} is equivalent
      to {{:#data}}. This is a similar pattern to {{for}} {{include}} etc.
    - autoBind feature for custom tags allows a custom tag without
      argument to bind to current data context, so {{mytag/}} is
      equivalent to {{mytag #data/}}. This is achieved by setting
      autoBind: true on the tag definition.
    - Can now define a converter for the first arg on any tag - custom
      or built-in. e.g. {{for myarray convert=~reverseArray}}
      or {{mycustomtag name convert='someRegisteredConverter'/}}
      or <div data-link="name convert=formatName" /}} (in this example
      the person object has a name property and a formatName method)
    - Similarly any tag with two-way binding can have a convertBack
      e.g. <input data-link="name convert=~SomeHelper convertBack=SomeMethodOnDataObject" />
      or {^{slider speed convert=~fromMphToKmH convertBack=fromKmHtoMph/}}
      or: {^{myTextBoxTag convert=~myCnvtHelper convertBack='myregisteredConverter'/}}
    - Improved support for rendering arrays without iteration:
      render(array, helpers) will iterate over the array, but you can
      now pass a 'noIteration' boolean. So render(array, true) renders
      anv array without iteration, and similarly, render(array, helpers, true)
      now renders an array without iteration while passing in helpers.
      Within methods and events of custom tags:
      tagCtx.render() renders against the current data object,
      tagCtx.render(someArray) iterates over the array
      tagCtx.render(someArray, true) or tagCtx.render(someArray, helpers, true)
      renders without iteration.
    - In a custom tag, a template can now be assigned (determined
      dynamically) in the init method simply by setting:
      this.template = templateObjectOrMarkupString;
      It is no longer necessary to write:
      this.template = tagCtx.tmpl = templateObjectOrMarkupString;
    - Support for declaring event handlers directly on tags or
      data-link expressions: {{anyTag onXxx=myXxxHandler /}}
      This can be used for standard event handlers such as onUpdate,
      onBeforeChange etc.
      e.g. <textarea data-link="text onUpdate=updateMethodOnViewModelObject"></textarea>
    - There is a new helper utility function for validation of
      HTML markup in JsViews: $.views.utility.validate(markupString)
      This could be used in the following example:
      $.views.helpers("validateMarkup", $.views.utility.validate);
      <textarea data-link="text onBeforeChange=~validateMarkup"></textarea>
    - Improved error message if JsViews or JsObservable is loaded without jQuery
    Bug fixes:
    - Fix for #231
    - Fix for a memory leak issue
    - Fixes for some issues with radio buttons and with multiselect
    - Fixes for bugs in some samples
Commits on Jan 24, 2014
  1. Commit 51 (Post Beta)

Commits on Jan 22, 2014
  1. Commit 50 (Post Beta)

    - Fix for #228
Commits on Jan 17, 2014
  1. Commit 49 (post beta)

    Changing commit number to 49 to align with commit 49 of jsviews - (fix for BorisMoore/jsviews#237)
Commits on Jan 15, 2014
  1. Commit 48 (post beta)

    New features and improvements:
    - {{for}} {{include}} {{props}} now support omitting the data path
      parameter. When omitted, renders current data, - equivalent to
      {{for #data}} etc. {{for}} iterates if current data is an array
      {{include tmpl=…/}} renders template for current data, and does not
      iterate if current data is an array.
    - Improved API for settings, plus bug fixes. Switch debugMode using
      $.views.settings.debugMode(boolean);. Switch other settings such as
      tryCatch using $.views.settings({tryCatch: false}).
    - New support for rendering arrays, without iteration (previously
      "layout = true" mode). Pass in value true for optional 'noIteration'
      parameter as in:
      template.render(data, context[, noiteration])
      tagCtx.render(someArray, context[, noIteration])
    - New support for custom tags with just a template - they no longer need
      a render method. They will iterate over arrays. To render arrays
      without iteration provide a render method which calls
      tagCtx.render(data, options, true);
      Samples to follow.
    - New support for a DataMap feature used by {{props}} implementation.
      More information/samples/documentation and updates to follow.
    - New built-in tag, converter and helper provided for debugging:
      {{dbg/}}, {{dbg:somePath}}  {{myconverter:somePath:dbg}} ~dbg()
      When debugMode is true, the debugger will break at that point during
      template rendering.
    - New {{jsonview/}} sample tag control. Insert anywhere in a template
      and it will render the current data item as JSON syntax.
      Use {{jsonview}} to show JSON
      for nested objects.
    - Whenever the value null is returned from tag, the result is now
      consistently to render nothing (empty string). Previously {{:nullValue}}
      returned the empty string, but {^{:nullValue}}, {{attr:nullValue}} and
      {converterReturningNull:foo}} did not. This is a fix for
    Bug fixes:
    - Fix for #221
    - Fix for #226
    - Fix for #227
Commits on Nov 30, 2013
  1. Commit 47 (post beta)

    Small bug fix (encoding quotes) and unit tests
Commits on Nov 25, 2013
  1. Commit 46 (post beta)

    New features and improvements:
    - New {{props}} tag to iterate through fields/properties of an object:
      {{props}} {{:key}}:  {{:prop}} {{/props}}
    - Use of #index in a nested context (e.g. in an {{if}} block) now produces
     (in debugMode === true) a warning error indicating getIndex() syntax.
      Overriding of global helpers, templates, tags or converters:
      > resources specific to a template (e.g. a helper in the template’s
      helpers collection) now override resources of the same name defined
      globally (e.g. using $.views.helpers("myHelper", ...); ).
      > Helpers passed in as options override both template-specific and global
      helpers of the same name
    - Several bug fixes
    - Many new unit tests
Commits on Oct 29, 2013
  1. Commit 45 (post beta)

    - Fix for bug {{if !true}} evaluates to true. See:
    - Some changes and improvements related to JsViews integration.
Commits on Oct 20, 2013
  1. Commit 44 (post beta)

    - Fix for bug {{else someUndefinedValue}}. See:
    - Fix needed for JsViews issue:
Commits on Oct 8, 2013
  1. Commit 43 (post beta)

    - Added support for rendering (and for binding, when used with JsViews
      to expressions that start with '!' such as:
     {{if !isFoo}}...{{else}} ...{{/if}}
Commits on Sep 23, 2013
  1. Commit 42 (post beta)

    - Several small bug fixes
    - Support for features used by upcoming JsViews Beta (also commit 42),
      including support for editable controls, validation, custom tags
      wrapping widgets or plugins such as the jQuery UI datepicker.
    See details on the JsViews commit 42, and on JsViews,com
Commits on Jul 5, 2013
  1. Commit 40 (post beta)

    - Fix for #206
    - Support for using just CR as newline within templates (as well as
      CRLF or just LF, previously supported)
    - Support for features used by upcoming JsViews Beta, including
      tag controls with onBeforeChange
      support (editable controls, with validation support)
Commits on Jun 19, 2013
Commits on Jun 11, 2013
  1. Final commit for official JsRender Beta release. (Simultaneous with the

    release of the new documentation site at
Commits on May 24, 2013
  1. Commit 38. (Beta Candidate)

    - minor bug fix for encoding of "\" characters.
    - small changes on HTML encoding code...
Commits on Apr 25, 2013
  1. Commit 37. (Beta Candidate)

    - Minor bug fixes.
    - The tag init method is now called just after the constructor, rather than
     being used as constructor, so the this pointer in the init() is a full
     instance with tag.parent and all the other properties already set...
Commits on Apr 13, 2013
  1. Commit 35. (Beta Candidate)

    Removed some TODO comments.
Commits on Apr 10, 2013
  1. Commit 35. (Beta Candidate)

    Some bug fixes, plus some important implementation for supporting richer
    path binding expressions used in JsViews.
    Added additional unit tests for the built-in converters.
Commits on Mar 28, 2013
  1. Commit 34. (Beta Candidate)

    1) Attribute encoder now encodes '>', for compatibility with JsViews parsing.
    2) Fix for sample 07_paths.html (issue #192)
Commits on Mar 14, 2013
  1. Commit 33. (Beta Candidate)

    Small bug fix required for JsViews Issue 153
Commits on Mar 13, 2013
  1. Commit 32. (Beta Candidate)

    1) Fix for white-space-stripping bug
Commits on Mar 10, 2013
  1. Commit 31. (Beta Candidate)

    1) Important fix for 'minor' bug (typo) which prevented data-linking when !== "" - e.g. in jsfiddle samples.
    2) BREAKING change - but only if NOT using jQuery. See #191:
     With this change the JsRender API for with and without jQuery is now
     identical except that with jQuery, window.jQuery is the global namespace
     object, typically mapped to var $, and without jQuery, window.jsviews
     is the global namespace object. If in the second case window.jsviews is
     also mapped to var $, then the API for both scenarios now beccomes
     identical and allows a single documentation and samples set to be provided
     for both scenarios:
     $.views provides access to the full JsRender (and JsViews) APIs
     e.g. $.converters. But in addition, some important APIs ($.templates and
     $.render) are also made available directly from $...
    3) The attr and url converters no longer convert null to "". This allows
     JsViews data-link="someTarget{attr:expression}" to remove the target
     attribute if the expression returns null, just as is the case already for
    4) Modified sample "20_without-jquery.html" to show proposed pattern for
     mapping window.jsviews to var $, with API change above.
    5) Added example of accessing root data as ~root - within existing sample
Commits on Mar 5, 2013
  1. Commit 30. (Beta Candidate)

    This includes changes required to fix for issues 89, 116, 148 and 149 of
    It is also a candidate for Beta. If no significant new bugs are
    encountered then it will be used to provide an official beta version.
Something went wrong with that request. Please try again.