Skip to content

Commit

Permalink
Commit 91 (v0.9.91 - Beta)
Browse files Browse the repository at this point in the history
Major update

Breaking change

- Templates declared in <div> or other non script element are not
  supported. (Throws with error message)

Minor breaking changes

- The {{range}} tag has been removed - replaced by {{for}} tag using
  built-in range features. See https://www.jsviews.com#jsvfortag@jsvsortfilterrange

Major feature improvements

- The {{for}} tag now has built-in support for sort, filter, start and
  end. See https://www.jsviews.com#fortag@sortfilterrange

- The {{props}} tag now has built-in support for sort, filter, start
  and end. See https://www.jsviews.com#propstag@sortfilterrange

- New converters encode/unencode. See https://www.jsviews.com#convertersapi@encode

- New tag options: bindFrom - together with tag option bindTo - provide
  improved features for custom tags.
  See https://www.jsviews.com#tagoptions@bindto and https://www.jsviews.com#tagoptions@bindfrom

Minor feature improvements

- New APIs added for tagCtx.ctxPrm(), tagCtx.cvtArgs() and
  tagCtx.bndArgs() even for non-data-linked tags - documentation to follow

- The contentCtx option now works also for custom tag using render(),
  rather than a template. See https://www.jsviews.com#tagsapi@contentctx

- In a template, ~tag.tagCtx.xxx can now be written ~tagCtx.xxx,
  and works correctly e.g. for data-linking using
  {{mytag}}{{else}}{{~tagCtx...}}{{/mytag}} - documentation to follow

- ~tagCtx is now a reserved name like ~tag ~root ~parentTags...

- New debug:true option on a compiled template.
  See https://www.jsviews.com#d.templates@debug

- An error will be thrown if different versions of jsrender.js,
  jquery.observable.js and  jquery.views.js are loaded together

- DataMap, {{props}} and {{jsonview}} now include support for function
  properties too, unless opt out using {{props foo noFunctions=true}}.
  See https://www.jsviews.com#propstag@nofunctions

- Support for nested {{for}} tags without iteration, and for then
  applying operations such as sorting to arrays in nexted context, as in
  {{for filter=... noIteration=true}}{{for sort=... noIteration=true}}{{for start=...  end=...}}.
  See https://www.jsviews.com#fortag@itemvar

Documentation

- Extensive new documentation, especially on custom tag controls:
  See https://www.jsviews.com#jsvtagcontrols. For an example of a JsViews
  custom tag control see https://www.jsviews.com#samples/tag-controls/colorpicker

Minor bug fixes, including:

- a contentEditable bug for IE

- a bug in jquery-1.x cleanData

- Issue BorisMoore/jsviews#404
  Props Convert else statement not working

- Issue BorisMoore/jsviews#403
  ~ operator support

- Issue BorisMoore/jsviews#400
  Move the tag property in views to before rendering, to enable "get current path" path scenario

- Issue #335
  encode and unencode converters
  • Loading branch information
BorisMoore committed Sep 22, 2018
1 parent d046653 commit d3e2011
Show file tree
Hide file tree
Showing 15 changed files with 8,844 additions and 5,103 deletions.
759 changes: 530 additions & 229 deletions jsrender-node.js

Large diffs are not rendered by default.

773 changes: 538 additions & 235 deletions jsrender.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions jsrender.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jsrender.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsrender",
"version": "v0.9.90",
"version": "v0.9.91",
"description": "Best-of-breed templating in browser or on Node.js (with Express 4, Hapi and Browserify integration)",
"main": "./jsrender-node.js",
"browser": "./jsrender.js",
Expand Down Expand Up @@ -35,7 +35,7 @@
"browserify": "^11.0.1",
"gulp": "^3.9.0",
"glob-stream": "^5.0.0",
"jquery": "^2.1.4",
"jquery": "^3.0.0",
"qunit": "^0.7.6"
},
"dependencies": {
Expand Down
775 changes: 539 additions & 236 deletions test/browserify/bundles/1-bundle.js

Large diffs are not rendered by default.

775 changes: 539 additions & 236 deletions test/browserify/bundles/12-nested-bundle.js

Large diffs are not rendered by default.

4,539 changes: 2,696 additions & 1,843 deletions test/browserify/bundles/2-bundle.js

Large diffs are not rendered by default.

4,539 changes: 2,696 additions & 1,843 deletions test/browserify/bundles/3-bundle.js

Large diffs are not rendered by default.

773 changes: 538 additions & 235 deletions test/browserify/bundles/htm-jsrender-tmpl-bundle.js

Large diffs are not rendered by default.

773 changes: 538 additions & 235 deletions test/browserify/bundles/html-jsr-tmpl-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/unit-tests/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requirejs.config({
"baseUrl": "//www.jsviews.com/download", // Or point to correct local path on your system: "baseUrl": "/download",
// "baseUrl": "../../download", // Or point to correct local path on your system: "baseUrl": "/download",
"paths": {
"jquery": "//code.jquery.com/jquery-1.12.4",
"jquery": "//code.jquery.com/jquery-3.3.1",
"jsrender": "./jsrender",
"jquery.observable": "./jquery.observable",
"jquery.views": "./jquery.views",
Expand Down
218 changes: 216 additions & 2 deletions test/unit-tests/tests-jsrender-no-jquery.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions test/unit-tests/tests-jsrender-with-jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,16 @@ test("templates", function() {
debug:true
},
"tmplFromString": {
markup: "testDebug",
markup: "X_{{:name}}_Y",
debug:true
}
});
equal($.templates.tmplFromString.fn.toString().indexOf("debugger;") > 0 && $.templates.scriptTmpl.fn.toString().indexOf("debugger;") > 0, true, 'Debug a template: set debug:true on object');
equal($.templates.tmplFromString.fn.toString().indexOf("debugger;") > 0
&& $.templates.scriptTmpl.fn.toString().indexOf("debugger;") > 0
&& $.templates.scriptTmpl({name: "Jo"}) + $.templates.tmplFromString({name: "Jo"}), isIE8
? "\nA_Jo_BX_Jo_Y"
: "A_Jo_BX_Jo_Y",
'Debug a template: set debug:true on object');

// reset
$("#my_tmpl")[0].removeAttribute("data-jsv-tmpl");
Expand Down
2 changes: 1 addition & 1 deletion tmplify/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*! JsRender tmplify submodule v0.9.84 (Beta): http://jsviews.com/#jsrender */
/*! Browserify transform for JsRender templates */
/*
* Copyright 2017, Boris Moore
* Copyright 2018, Boris Moore
* Released under the MIT License.
*/

Expand Down

0 comments on commit d3e2011

Please sign in to comment.