Skip to content

Commit

Permalink
Commit 64 (Beta Candidate)
Browse files Browse the repository at this point in the history
BREAKING CHANGES

- 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:
  $.views.settings.debugMode(true);

- jQuery UI widgets: There is now a specific syntax for
  setting widget properties. A tag property with an initial
  underscore will correspond to the corresponding property
  of the widget, and it can be set, and optionally data-linked
  {^{datepicker myDate _changeMonth=true ^_maxDate=myEndDate/}}

- The $.views.sub.cvt() no longer exists. Use tag.cvtArgs().

 NEW FEATURES

- 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"
  See: https://github.com/BorisMoore/jsrender-node-starter

- $.templates() now has an equivalent alternate name (alias):
  $.views.compile() which allows for immediate integration in some
  frameworks, such as Hapi templated views.
  See https://github.com/BorisMoore/jsrender-node-starter#hapi-templates-support

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

- A new data-link binding: data-link="data-foo{: ...}" permits
  data-linking directly to data-foo properties of HTML elements.

- Tag property names can now include '.' and '_' characters:
  {{myTag _a=3 b.c=4 /}}

- Support for {^{on someMethod ... /}} as a button. For example,
  {^{on someMethod ...}}Go{{/on}} is equivalent to
  <button data-link="{on someMethod ...}">Go</button>

- {^{foo class=...}} lets you set (and optionally bind to) the class
  of the linked HTML element.

- {^{foo id=...}} lets you set (and optionally bind to) the id of the
  linked the HTML element.

- {^{foo name=...}} lets you set (and optionally bind to) the name
  property of the linked HTML element.

- If a custom tag has setSize specified as true: {..., setSize: true, ...}
  then you can set and optionally bind to the with and height properties
  to control the width and height of the linked HTML element:
  {^{foo ... width=55 ^height=expression ...}}

- 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 BorisMoore/jsrender#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)

- Many improvements on jQuery UI widget integration. Docs and samples
  to come. See also download/sample-tag-controls/jsviews-jqueryui-widgets.js

- The jsviews.com git project now has build support, with Gulp.

- Improved support for data-linking without initial rendering,
  data-link="...^{...}" - which is particularly useful when using
  server-rendered content linked subsequently in browser.
  See https://github.com/BorisMoore/jsrender-node-starter#using-the-same-templates-on-the-server-and-in-the-browser

Bug Fixes:

- BorisMoore/jsrender#239:

- BorisMoore/jsrender#252
  (Improved syntax error message e.g.:
  '{{include}} block has {{/for}} with no open {{for}}'

- BorisMoore#300

- BorisMoore#301

- BorisMoore#302

- BorisMoore#303

- BorisMoore#213 (Detection and error message)
  • Loading branch information
BorisMoore committed May 20, 2015
1 parent 8700d57 commit b1a33ac
Show file tree
Hide file tree
Showing 52 changed files with 2,252 additions and 1,422 deletions.
2 changes: 1 addition & 1 deletion demos/features/observability/computed-data-prototype.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<script src="../../resources/syntaxhighlighter.min.js" type="text/javascript"></script>
<link href="../../resources/demos.css" rel="stylesheet" type="text/css" />

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../../jsrender.js" type="text/javascript"></script>
<script src="../../../jquery.observable.js" type="text/javascript"></script>
<script src="../../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/features/observability/computed-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<script src="../../resources/syntaxhighlighter.min.js" type="text/javascript"></script>
<link href="../../resources/demos.css" rel="stylesheet" type="text/css" />

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../../jsrender.js" type="text/javascript"></script>
<script src="../../../jquery.observable.js" type="text/javascript"></script>
<script src="../../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/features/observability/computed-helper.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<script src="../../resources/syntaxhighlighter.min.js" type="text/javascript"></script>
<link href="../../resources/demos.css" rel="stylesheet" type="text/css" />

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../../jsrender.js" type="text/javascript"></script>
<script src="../../../jquery.observable.js" type="text/javascript"></script>
<script src="../../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/features/observability/observing-paths.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../../resources/syntaxhighlighter.min.js" type="text/javascript"></script>
<link href="../../resources/demos.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../../jsviews.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/01_render-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/02_compiled-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/03_named-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/04_data-array.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/05_input.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/06_data-binding.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/06_data-binding2.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/07_observable.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/07_observable2.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/07_observable3.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/08_for-tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/09_for-composition.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/10_if-else-tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/11_editable-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" />
<link href="../resources/masterdetail2.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/12_helper-functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/13_converters.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/jQueryConfDemosOct2011/14_custom-tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link href="../resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" />
<script src="../resources/syntaxhighlighter.min.js" type="text/javascript"></script>

<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/01_rendering-and-linking.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/03_top-level-linking.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/04_form-elements_if-binding.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/06_accordion_switching-template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/step-by-step/10_todos.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html>
<head>
<title>JsViews Demo: Todos</title>
<script src="http://code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<script src="../../jquery.observable.js" type="text/javascript"></script>
<script src="../../jquery.views.js" type="text/javascript"></script>
Expand Down
Loading

0 comments on commit b1a33ac

Please sign in to comment.