Skip to content

Commit

Permalink
Commit 68 (v1.0.0-beta.68 - Beta Candidate)
Browse files Browse the repository at this point in the history
Updated documentation.
See also https://github.com/BorisMoore/jsrender-node-starter.
and https://github.com/BorisMoore/jsrender.

BREAKING CHANGES

- One very minor breaking change: the $.views.compile(...) alias
  for $.templates has been removed from jsrender.js, but is still
  available for Node.js (e.g. for Hapi templates integration) as
  $.compile(...).

NEW FEATURES

- JsRender is now published on NPM. Install using $ npm install jsrender

- Browserify Support:
  JsRender on Node.js provides a built-in Browserify transform
  for including compiled JsRender templates from the server, as part of
  the client javascript bundle generated by Browserify.

  Usage example:

  var tmplify = require('jsrender/tmplify');
  browserify(...) ... .transform(tmplify) ...

  See also https://github.com/BorisMoore/jsrender-node-starter,
  and http://www.jsviews.com/test/unit-tests-browserify.html

- Continuing work for deployment to NPM. See
  #254
  BorisMoore/jsrender#225

Bug Fixes:

- BorisMoore/jsrender#172
  • Loading branch information
BorisMoore committed Sep 2, 2015
1 parent 7b4a375 commit 0f02597
Show file tree
Hide file tree
Showing 36 changed files with 216 additions and 2,113 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _The power of MVVM, the flexibility of JavaScript, the speed and ease of JsRende
**JsViews** builds on top of **[JsRender](http://www.jsviews.com/#jsrender)** templates, and adds data-binding and **[observable data](http://www.jsviews.com/#jsobservable)**, 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.
**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](https://github.com/BorisMoore/jsrender)_ repository on GitHub<br/>

Expand Down
2 changes: 1 addition & 1 deletion demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h2>JsViews: Next-generation jQuery Templates and Data Linking</h2>
and adds data-binding and <b><a href="http://www.jsviews.com/#jsobservable">observable data</a></b>, to provide
a fully-fledged MVVM platform for easily creating interactive data-driven single page apps and websites.
</div>
<div><em>JSRender</em> and <em>JsViews</em> together provide the next-generation implementation of both <em>JQuery Templates</em>,
<div><em>JsRender</em> and <em>JsViews</em> together provide the next-generation implementation of both <em>JQuery Templates</em>,
and <em>JQuery Data Link</em> - and supersede those libraries.</div>
<div><b><a href="http://www.jsviews.com/#jsviews">Documentation</a></b>, <b><a href="http://www.jsviews.com/#samples">samples</a></b>
and <b><a href="http://www.jsviews.com/#download">downloads</a></b>
Expand Down
6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var gulp = require('gulp'),
var gulp = require('gulp'),
browserify = require('browserify'),
fs = require('fs');

Expand All @@ -7,15 +7,15 @@ var gulp = require('gulp'),

// Task to create Browserify client-side bundle scripts for Browserify test cases.
gulp.task('bundle', function() {
var $jsr = require('jsrender');
var tmplify = require('jsrender/tmplify');
var gs = require('glob-stream');

return gs.create('./test/browserify/*-unit-tests.js')
.on('data', function(file) {
// file has path, base, and cwd attrs
var fileName = file.path.slice(file.base.length, -14);
browserify(file.path, {debug:true})
.transform($jsr.tmplify)
.transform(tmplify)
.bundle()
.pipe(fs.createWriteStream('./test/browserify/bundles/' + fileName + "-bundle.js"))
.on('error', function(err) {
Expand Down
2 changes: 1 addition & 1 deletion jquery.observable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! JsObservable v1.0.0-beta.65 (Beta Candidate): http://jsviews.com/#jsobservable */
/*! JsObservable v1.0.0-beta.68 (Beta Candidate): http://jsviews.com/#jsobservable */
/*
* Subcomponent of JsViews
* Data change events for data-linking
Expand Down
2 changes: 1 addition & 1 deletion jquery.observable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions jquery.views.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! jquery.views.js v1.0.0-beta.65 (Beta Candidate): http://jsviews.com/ */
/*! jquery.views.js v1.0.0-beta.68 (Beta Candidate): http://jsviews.com/ */
/*
* Interactive data-driven views using JsRender templates.
* Subcomponent of JsViews
Expand Down Expand Up @@ -53,7 +53,7 @@ if (!$ || !$.fn) {
}

if (jsr && !jsr.fn) {
jsr.toJq($); // map over from jsrender namespace to jQuery namespace
jsr.views.sub._jq($); // map over from jsrender namespace to jQuery namespace
}

var $observe, $observable,
Expand Down Expand Up @@ -1117,7 +1117,7 @@ function viewLink(outerData, parentNode, prevNode, nextNode, html, refresh, cont
// If there are ids (markers since the last tag), move them to the defer string
tagStack.unshift(parentTag);
parentTag = tag.slice(1);
if (tagStack[0] && tagStack[0] === badParent[parentTag]) {
if (validate && tagStack[0] && tagStack[0] === badParent[parentTag]) {
// Missing <tbody>
// TODO: replace this by smart insertion of <tbody> tags
error('Parent of <tr> must be <tbody>');
Expand Down Expand Up @@ -2937,16 +2937,17 @@ $extend($, {
}
});

$views.utility = {
validate: function(html) {
try {
topView.link(undefined, document.createElement("div"), undefined, undefined, html, undefined, undefined, 1);
}
catch (e) {
return e.message;
}
}
};
// Possible future addition - e.g. for ckeditor tag control
//$views.utility = {
// validate: function(html) {
// try {
// topView.link(undefined, document.createElement("div"), undefined, undefined, html, undefined, undefined, 1);
// }
// catch (e) {
// return e.message;
// }
// }
//};

//===============================
// Extend jQuery instance plugins
Expand Down
4 changes: 2 additions & 2 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.

Loading

0 comments on commit 0f02597

Please sign in to comment.