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

- Changed behavior of .setValue() API on custom tags. The .setValue()
  method is called even for undefined values. The .getValue() method
  is not called. Return false from setValue to not data-link a linked
  element. (e.g. jQuery UI slider). See https://www.jsviews.com#tagoptions@setvalue

- {{tabs}} API changes: The selectedIndex property is renamed to the
  pane property. The tabCaption property is renamed to the caption
  property

- Some changes to behavior/effect of the bindTo tag option - which is
  now associated with the new bindFrom tag option.
  See https://www.jsviews.com#tagoptions@bindto and https://www.jsviews.com#tagoptions@bindfrom

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

- New support for observing/unobserving contextual parameters.
  $.observe(tagOrView, "~foo", callback) - documentation to follow

- New support for observing properties of any item in an array, using
  "array.[].*" or "array.[].foo" (or "array.[]^*", etc.) - documentation to follow

- Late paths support: "@a.b.c" - documentation to follow

- New support for getting a reference to a tag instance using
  {^{mytag this=~myTag}} - documentation to follow

Minor feature improvements

- Custom tag linkedElem can now target non-editable and contentEditable.
  See https://www.jsviews.com#bindingpatterns@linkedelem

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

- On a custom tag, the bindTo option is not needed with 2-way linking
  to first argument

- updateValue() now supports an async option: pass true for the fourth
  parameter, defer - updateValue(val, index, tagElse, tag, defer).
  - Documentation to follow

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

- New depends option on custom tags (see https://www.jsviews.com#tagoptions@depends)
  or an instance property {{someTag depends='a.b'}} or
  {{someTag depends=~someTagDependsArray}}

- 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 for data-linking to 'length' property.

- a bug when a computed property 'depends' mixes data and contextual paths

- a bug in jquery-1.x cleanData

- a bug in move() arrayChange on {{for}}

- Issue #408
  $.observe('ns', model.list, '[]^qty', handler);??

- Issue #406
  Weird data-linked `for` loop behaviour with deep observing after model update

- Issue #404
  Props Convert else statement not working

- Issue #403
  ~ operator support

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

- Issue #398
  After DOM modifications to the child options of a data-linked select, the first option shows as selected

- Issue #397
  {^{radiogroup value disabled=notEnabled}} is now supported

- Issue #198
  Provide full documentation of custom tags using 2-way binding, binding to args or props etc.

- Issue #374
  Wrong initial value shown (timespinner control)

- Issue BorisMoore/jsrender#335
  encode and unencode converters
  • Loading branch information
BorisMoore committed Sep 22, 2018
1 parent df35f6e commit 3f2ae07
Show file tree
Hide file tree
Showing 18 changed files with 6,003 additions and 2,145 deletions.
705 changes: 400 additions & 305 deletions jquery.observable.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions jquery.observable.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jquery.observable.min.js.map

Large diffs are not rendered by default.

800 changes: 478 additions & 322 deletions jquery.views.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions jquery.views.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jquery.views.min.js.map

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.

2,255 changes: 1,402 additions & 853 deletions jsviews.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions jsviews.min.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsviews",
"version": "v0.9.90",
"version": "v0.9.91",
"description": "Next-generation MVVM and MVP framework - built on top of JsRender templates. Bringing templates to life...",
"main": "./jsviews.js",
"author": {
Expand All @@ -16,7 +16,7 @@
"bugs": {
"url": "https://github.com/borismoore/jsviews/issues"
},
"scripts": {},
"scripts": { },
"keywords": [
"jsviews",
"jsrender",
Expand All @@ -34,9 +34,10 @@
"browserify": "^11.0.1",
"glob-stream": "^5.0.0",
"gulp": "^3.9.0",
"jquery": "^2.1.4",
"jsrender": "^0.9.90",
"jsrender": "^0.9.91",
"qunit": "^0.7.6"
},
"dependencies": {}
"dependencies": {
"jquery": "^3.0.0"
}
}
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
582 changes: 507 additions & 75 deletions test/unit-tests/tests-jsobservable.js

Large diffs are not rendered by default.

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
Loading

0 comments on commit 3f2ae07

Please sign in to comment.