Skip to content
This repository

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates

branch: master

Commit 54 (Beta Candidate)

Note that this update brings important perf optimizations and many
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

- Many major performance improvements, including much improved
  performance for {{>...}} - and optimizations allowing extremely
  fast rendering for render() in the case of simple templates.
  (See http://borismoore.github.io/jsrender/test/perf-compare.html)

- 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.)

- Error messages are now HTML encoded when rendered into HTML by
  a .link() call.

- support for binding to tag properties and contextual properties:
  e.g {{xxx ^foo=expr1 ^~bar=expr2}} allowing then to bind to tag.foo
  or ~bar. (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

- views now have a boolean 'linked' property with value 'true' if
  created via link() rather than via render()

- Custom tags: Having an empty template: "" in tag definition is
  now supported.

- New support for observably removing a property from an object:
  $.observable(object).removeProperty(path)

- Many improvements to feature for attaching event handlers using
  data-link="{on ... myHandler}".
  (See unit tests. Examples to follow)

- jsonview fix to support rendering non-string values

Bug fixes:
  #251
  #258
  #259
  #262
  #263
  - Fix for collision with tags which add props() jQuery method:
  see: http://stackoverflow.com/questions/23860085/jsrender-js-fails-when-i-add-bootstrap-tag-js/23926792#23926792
latest commit 5f815bc76c
Boris Moore authored
README.md

JsViews: Next-generation MVVM and MVP framework - bringing templates to life

The power of MVVM, the flexibility of JavaScript, the speed and ease of JsRender templates

JsViews builds on top of JsRender templates, and adds data-binding and observable data, to provide a fully-fledged MVVM platform for easily creating interactive data-driven single page apps and websites.

JSRender and JsViews together provide the next-generation implementation of both JQuery Templates, and JQuery Data Link - and supersede those libraries.

See also the JsRender repository on GitHub

Documentation and Downloads

Documentation, downloads, samples are available on the www.jsviews.com website.
(JsViews and JsObservable API docs and tutorials are coming soon, as we move JsViews to the official beta and on to V1.0)

Demos

In addition to the demos at www.jsviews.com/#samples, see also the demos folder of this GitHub repository - available here as live samples.

Current Status

JsViews is now an alpha release, which will be declared beta as soon as API documentation is complete on the www.jsviews.com website, and then move to V1.0.

Something went wrong with that request. Please try again.