Skip to content

Commit

Permalink
v0.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kolárik committed Jul 9, 2014
1 parent 29c601b commit 2f49ae7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rvc",
"description": "RequireJS plugin to load and optimise Ractive components",
"version": "0.1.8",
"version": "0.1.9",
"author": "Rich Harris",
"license": "MIT",
"main": ["rvc.js"],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rvc",
"version": "0.1.8",
"version": "0.1.9",
"description": "RequireJS plugin to load and optimise Ractive components",
"main": "rvc.js",
"repository": {
Expand Down
33 changes: 20 additions & 13 deletions rvc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/*
rvc.js - v0.1.7 - 2014-06-02
rvc.js - v0.1.9 - 2014-07-09
==========================================================
https://github.com/ractivejs/rvc
MIT licensed.
*/

define( [ 'ractive'
'module'
], function( Ractive, module ) {
define( [ 'ractive' ], function( Ractive ) {

'use strict';

Expand Down Expand Up @@ -205,14 +203,14 @@ define( [ 'ractive'

/*
rcu (Ractive component utils) - 0.1.5 - 2014-06-02
rcu (Ractive component utils) - 0.1.8 - 2014-06-02
==============================================================
Copyright 2014 Rich Harris and contributors
Released under the MIT license.
*/
var rcuamd = function() {
var rcu = function() {

var Ractive;
var getName = function getName( path ) {
Expand Down Expand Up @@ -255,6 +253,15 @@ define( [ 'ractive'
}
}
}
// Clean up template - trim whitespace left over from the removal
// of <link>, <style> and <script> tags from start...
while ( /^\s*$/.test( template[ 0 ] ) ) {
template.shift();
}
// ...and end
while ( /^\s*$/.test( template[ template.length - 1 ] ) ) {
template.pop();
}
// Extract names from links
imports = links.map( function( link ) {
var href, name;
Expand Down Expand Up @@ -363,13 +370,12 @@ define( [ 'ractive'
}();
var make = function( parse, eval2 ) {
return function make( source, config, callback, errback ) {
var definition, url, createComponent, loadImport, imports, loadModule, modules, remainingDependencies, onloaded, onerror, ready;
var definition, url, createComponent, loadImport, imports, loadModule, modules, remainingDependencies, onloaded, ready;
config = config || {};
// Implementation-specific config
url = config.url || '';
loadImport = config.loadImport;
loadModule = config.loadModule;
onerror = config.onerror;
definition = parse( source );
createComponent = function() {
var options, Component, script, factory, component, exports, prop;
Expand Down Expand Up @@ -451,8 +457,9 @@ define( [ 'ractive'
}( parse, eval2 );
var resolve = function resolvePath( relativePath, base ) {
var pathParts, relativePathParts, part;
if ( relativePath.charAt( 0 ) !== '.' ) {
// not a relative path!
// If we've got an absolute path, or base is '', return
// relativePath
if ( !base || relativePath.charAt( 0 ) === '/' ) {
return relativePath;
}
// 'foo/bar/baz.html' -> ['foo', 'bar', 'baz.html']
Expand Down Expand Up @@ -501,7 +508,7 @@ define( [ 'ractive'
}
}, callback, errback );
};
}( rcuamd );
}( rcu );

/* toSource by Marcello Bastea-Forte - zlib license */
/* altered to export as AMD module */
Expand Down Expand Up @@ -591,7 +598,7 @@ define( [ 'ractive'
builtModule += 'return Ractive.extend(__options__);\n});';
callback( builtModule );
};
}( rcuamd, tosource, minifycss );
}( rcu, tosource, minifycss );

var rvc = function( amdLoader, rcu, load, build ) {

Expand All @@ -603,7 +610,7 @@ define( [ 'ractive'
load( name, req, source, callback, errback );
}
} );
}( loader, rcuamd, load, build );
}( loader, rcu, load, build );

return rvc;

Expand Down

0 comments on commit 2f49ae7

Please sign in to comment.