-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 65 (v1.0.0-rc.65 - Release Candidate)
BREAKING CHANGES AND IMPROVEMENTS - The global namespace when JsRender is loaded without jQuery is now window.jsrender. (Previously it was window.jsviews). So when using JsRender without jQuery, you can write: var $ = jsrender; - and use the $ var it in the same way you would use the global $ when JsRender is loaded with jQuery: e.g. $.templates(...) or $.views.helpers(...) etc. - AMD support has been improved and simplified. All AMD modules, including JsRender, with or without jQuery, now return the jQuery object (if loaded) or the analogous JsViews object. - Node.js support and integration has been improved - along with improved CommonJS support, and Browserify integration. The file system APIs now use the syntax tmpl="./file/path.html". The Node.js version of jsrender.js is available as a separate file (available at //jsviews.com/download/jsrender-node.js). The Node.js version of JsRender provides the complete set of JsRender APIs and features, together with integration with NodeJS view-engines such as Express and Hapi, APIs for loading templates from the file system, etc. The file system APIs now use the syntax tmpl="./file/path.html". It also includes a built-in Browserify transform (see "Browserify Support: below). (Note: JsRender and JsViews will soon be published to NPM). - The behavior when loading multiple instances of JsRender or JsViews files has been changed: When loading a new instance, the previous instance $.views, $.templates, etc. is no longer overwritten. So a component using JsRender or JsViews will not, when loaded, cause another already loaded component also using JsViews/JsRender to fail (except for collisions arising in the unlikely case where both happen to use the same template/converter/helper name). As part of this modified behavior, the noConflict support for JsRender had been removed. NEW FEATURES - Browserify Support: JsRender on Node.js provides a built-in Browserify transform - jsrender.tmplify, for including compiled JsRender templates from the server, as part of the client javascript bundle generated by Browserify. Usage example: var $jsr = require('jsrender'); browserify(...) ... .transform($jsr.tmplify) ... See also http://www.jsviews.com/test/unit-tests-browserify.html - Initial work for deployment to Bower and NPM. See BorisMoore/jsviews#254 #225 Bug Fixes: - #263 #264 Caching of template on script elements. (Unit tests added)
- Loading branch information
1 parent
7c0b660
commit e7cdb9f
Showing
30 changed files
with
4,518 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
**/.* | ||
node_modules | ||
bower_components | ||
test/browserify/bundles/*.js | ||
*.config | ||
Scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
**/.* | ||
|
||
/test/browserify/bundles/*.js | ||
*.config | ||
gulpfile.js | ||
|
||
/Scripts | ||
/node_modules | ||
/bower_components | ||
/demos | ||
/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "jsrender", | ||
"main": "jsrender.js", | ||
"homepage": "http://www.jsviews.com/#jsrender", | ||
"authors": [ | ||
{ | ||
"name": "Boris Moore", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/borismoore" | ||
} | ||
], | ||
"description": "Best-of-breed templating in browser or on Node.js (with Express 4, Hapi and Browserify integration)", | ||
"moduleType": [ | ||
"amd", | ||
"globals", | ||
"node" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/borismoore/jsrender.git" | ||
}, | ||
"keywords": [ | ||
"jsrender", | ||
"jquery", | ||
"node", | ||
"express", | ||
"hapi", | ||
"browserify", | ||
"templates", | ||
"template" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"demos", | ||
"*.md", | ||
"gulpfile.js", | ||
"package.json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var gulp = require('gulp'), | ||
browserify = require('browserify'), | ||
fs = require('fs'); | ||
|
||
//================================= BUNDLE - Run Browserify - create client bundles for test cases =================================// | ||
// See https://github.com/gulpjs/gulp/blob/master/docs/recipes/browserify-with-globs.md | ||
|
||
// Task to create Browserify client-side bundle scripts for Browserify test cases. | ||
gulp.task('bundle', function() { | ||
var $jsr = require('./index.js'); | ||
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) | ||
.bundle() | ||
.pipe(fs.createWriteStream('./test/browserify/bundles/' + fileName + "-bundle.js")) | ||
.on('error', function(err) { | ||
// Make sure failed tests cause gulp to exit non-zero | ||
throw err; | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/*! JsRender | ||
* Version for web: jsrender.js | ||
* Version for Node.js: jsrender-node.js | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = require('./jsrender-node.js'); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.