Comparing version 0.0.16 to 0.0.17
@@ -0,1 +1,7 @@ | ||
## v.0.0.17 | ||
* reduced memory leaks | ||
* fixed problems with EventBusChannel for Component instances | ||
* update dependencies | ||
* minor fixes | ||
## v.0.0.16 | ||
@@ -2,0 +8,0 @@ * `js!CompoundComponent` added method getComponentByName |
@@ -126,6 +126,3 @@ var | ||
//less middleware | ||
this.app.use('/components', require('less-middleware')({ | ||
src: this.config["components"], | ||
force : true | ||
})); | ||
this.app.use('/components', require('less-middleware')(this.config["components"])); | ||
@@ -218,2 +215,3 @@ //serve dir with build results | ||
var sf = new Sailfish(cfg); | ||
(function(){return this || (0,eval)('this')})().sfApp = sf; | ||
return sf.getApp(); | ||
@@ -220,0 +218,0 @@ }; |
@@ -0,0 +0,0 @@ // Karma configuration |
@@ -0,0 +0,0 @@ var Component = function(className, options){ |
@@ -0,0 +0,0 @@ var |
@@ -89,9 +89,14 @@ var | ||
req(['js!BaseComponent'], function(BaseComponent){ | ||
global.require = req; | ||
try{ | ||
cb(null, BaseComponent.prototype._prepareMarkup(markup)); | ||
} | ||
catch(e){ | ||
cb(e); | ||
} | ||
(function(nodeReq, reqJs){ | ||
var res, err = null; | ||
global.require = reqJs; | ||
try{ | ||
res = BaseComponent.prototype._prepareMarkup(markup); | ||
} | ||
catch(e){ | ||
err = e; | ||
} | ||
global.require = nodeReq; | ||
cb(err, res); | ||
})(require, req); | ||
}); | ||
@@ -116,17 +121,13 @@ }; | ||
self.cache[hash] = "inProgress"; | ||
var d = domain.create().run(function(){ | ||
d.componentRelativePath = self.config.componentRelativePath; | ||
d.libRelativePath = self.config.libRelativePath; | ||
requirejs.optimize({ | ||
mainConfigFile : path.join(self.config["sf_client"], "main-server.js"), | ||
separateCSS : true, | ||
include : dependencies, | ||
out : path.join(self.config["sf_build"], hash) + ".js", | ||
mode: "optimization" | ||
}, function(){ | ||
self.cache[hash] = "ready"; | ||
cb(null, hash); | ||
}, function(err){ | ||
cb(err); | ||
}); | ||
requirejs.optimize({ | ||
mainConfigFile : path.join(self.config["sf_client"], "main-server.js"), | ||
separateCSS : true, | ||
include : dependencies, | ||
out : path.join(self.config["sf_build"], hash) + ".js", | ||
mode: "optimization" | ||
}, function(){ | ||
self.cache[hash] = "ready"; | ||
cb(null, hash); | ||
}, function(err){ | ||
cb(err); | ||
}); | ||
@@ -133,0 +134,0 @@ } |
@@ -0,0 +0,0 @@ { |
@@ -14,3 +14,5 @@ /** | ||
fs.readdirSync(controllersPath).forEach(function(controller){ | ||
self.controllers[controller.replace(/\..*$/, "")] = require(nodePath.join(controllersPath, controller)); | ||
if (/\.js$/.test(controller)){ | ||
self.controllers[controller.replace(/\..*$/, "")] = require(nodePath.join(controllersPath, controller)); | ||
} | ||
}); | ||
@@ -17,0 +19,0 @@ }; |
@@ -0,0 +0,0 @@ Copyright (c) 2013, Konstantin Ershov |
{ | ||
"name": "sailfish", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"main": "./index.js", | ||
@@ -9,6 +9,6 @@ "bin": { | ||
"dependencies": { | ||
"commander": "2.2.x", | ||
"commander": "2.3.x", | ||
"walk": "2.3.x", | ||
"async": "0.9.x", | ||
"node.extend": "1.0.x", | ||
"node.extend": "1.1.x", | ||
"dot": "1.0.x", | ||
@@ -20,3 +20,3 @@ "requirejs": "2.1.x", | ||
}, | ||
"description": "sailfish - это фремфорк для создания web-приложений на JavaScript. Фреймворк является самодостаточным, т.е содержит в себе как серверную так и клиентскую части.", | ||
"description": "Sailfish.js - фреймворк для создания `component-based` веб приложений, основанный на express.js", | ||
"devDependencies": { | ||
@@ -23,0 +23,0 @@ "karma": "0.12.x", |
@@ -0,0 +0,0 @@ # sailfish [![Build Status](https://travis-ci.org/ershov-konst/sailfish.png)](https://travis-ci.org/ershov-konst/sailfish) [![Dependency Status](https://david-dm.org/ershov-konst/sailfish.png?theme=shields.io)](https://david-dm.org/ershov-konst/sailfish) [![devDependency Status](https://david-dm.org/ershov-konst/sailfish/dev-status.png?theme=shields.io)](https://david-dm.org/ershov-konst/sailfish#info=devDependencies) |
@@ -0,0 +0,0 @@ // doT.js |
@@ -0,0 +0,0 @@ define(['require', './css-normalize', './path-resolver'], function (req, normalize, pr) { |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ define(["path-resolver", "doT"], function(pr, doT){ |
@@ -0,0 +0,0 @@ define(function() { |
@@ -0,0 +0,0 @@ define(['module', './is-api'], function(module, api) { |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ define(["path-resolver"], function(pr){ |
@@ -8,8 +8,3 @@ define(function(){ | ||
if (typeof window == "undefined"){ | ||
if (!config){ | ||
path.push(process.domain["componentRelativePath"]); | ||
} | ||
else{ | ||
path.push(config["componentRelativePath"]); | ||
} | ||
path.push(sfApp.componentRelativePath); | ||
} | ||
@@ -30,9 +25,3 @@ else{ | ||
if (typeof window == "undefined"){ | ||
if (!config){ | ||
path.push(process.domain["libRelativePath"]); | ||
} | ||
else{ | ||
path.push(config["libRelativePath"]); | ||
} | ||
path.push(sfApp.libRelativePath); | ||
} | ||
@@ -39,0 +28,0 @@ else{ |
@@ -0,0 +0,0 @@ /** |
@@ -11,3 +11,3 @@ define("js!Abstract", ["js!utils", "js!Class", "js!EventBus"], function (utils, Class, EventBus) { | ||
this._options.id = this._options.id || utils.generateId(); | ||
this._eventChannel = EventBus.channel(this._id); | ||
this._eventChannel = EventBus.channel(this._options.id); | ||
}, | ||
@@ -30,5 +30,6 @@ trigger : function(type, target){ | ||
destroy : function(){ | ||
EventBus.removeChannel(this._id); | ||
EventBus.removeChannel(this._options.id); | ||
this._eventChannel = null; | ||
} | ||
}); | ||
}); |
@@ -8,3 +8,2 @@ define('js!BaseComponent', ['js!utils', 'js!Abstract', 'js!dom'], function(utils, Abstract, dom){ | ||
global = (function(){return this || (0,eval)('this')})(); | ||
global.require = require; | ||
@@ -23,7 +22,5 @@ return Abstract.extend({ | ||
case 'element': | ||
utils.extend(true, this._options, utils.parseConfigAttr(cfg)); | ||
this._container = cfg; | ||
break; | ||
case 'object': | ||
utils.extend(true, this._options, cfg); | ||
this._container = cfg.element; | ||
@@ -55,2 +52,3 @@ break; | ||
this._container.removeAttribute('config'); | ||
this._container.sfComponent = this; | ||
} | ||
@@ -80,3 +78,3 @@ }, | ||
catch (e){ | ||
throw new Error('can`t resolve component type. Markup: \n' + markup); | ||
throw new Error('can`t resolve component type. \nOriginal '+ e +'\nMarkup: \n' + markup); | ||
} | ||
@@ -150,5 +148,3 @@ | ||
_removeContainer : function(){ | ||
var | ||
parent = this._container.parentNode; | ||
var parent = this._container.parentNode; | ||
parent.removeChild(this._container); | ||
@@ -158,2 +154,3 @@ }, | ||
this._removeContainer(); | ||
this._container = null; | ||
this._super(); | ||
@@ -160,0 +157,0 @@ } |
@@ -53,5 +53,14 @@ define("js!Class", ["js!utils"], function (utils) { | ||
if (!initializing && this.init){ | ||
if ("_options" in this && utils.type(arguments[0]) === "object"){ | ||
if ("_options" in this){ | ||
var b = this.__getDefaultOptions(); | ||
this._options = utils.extend(true, b, arguments[0]); | ||
switch (utils.type(arguments[0])){ | ||
case 'element': | ||
this._options = utils.extend(true, b, utils.parseConfigAttr(arguments[0])); | ||
break; | ||
case 'object': | ||
this._options = utils.extend(true, b, arguments[0]); | ||
break; | ||
default: | ||
throw new Error('can`t resolve options'); | ||
} | ||
} | ||
@@ -58,0 +67,0 @@ this.init.apply(this, arguments); |
define("js!CompoundComponent", ["js!utils", "js!BaseComponent"], function(utils, BaseComponent){ | ||
var CompoundComponent = BaseComponent.extend({ | ||
_components: {}, | ||
_components: null, | ||
_componentsIdHash: {}, | ||
init : function(cfg){ | ||
this._super(cfg); | ||
var components = utils.provideInnerComponents(this._container); | ||
for (var i = 0, l = components.length; i < l; i++){ | ||
this._components[components[i].name()] = components[i]; | ||
} | ||
this._provideInnerComponents(); | ||
}, | ||
getComponentByName: function(name){ | ||
var result = null; | ||
if (!name){ | ||
return null; | ||
} | ||
if (this._components.hasOwnProperty(name)){ | ||
@@ -31,2 +31,25 @@ result = this._components[name]; | ||
return result; | ||
}, | ||
destroy: function(){ | ||
this._destroyInnerComponents(); | ||
this._super(); | ||
}, | ||
_provideInnerComponents: function(){ | ||
this._components = {}; | ||
this._componentsIdHash = {}; | ||
var components = utils.provideInnerComponents(this._container); | ||
for (var i = 0, l = components.length; i < l; i++){ | ||
this._components[components[i].name()] = components[i]; | ||
this._componentsIdHash[components[i].getId()] = components[i]; | ||
} | ||
}, | ||
_destroyInnerComponents: function(){ | ||
for (var i in this._componentsIdHash){ | ||
if (this._componentsIdHash.hasOwnProperty(i)){ | ||
this._componentsIdHash[i].destroy(); | ||
} | ||
} | ||
this._componentsIdHash = null; | ||
this._components = null; | ||
} | ||
@@ -33,0 +56,0 @@ }); |
@@ -0,0 +0,0 @@ define("js!Deferred", function(){ |
@@ -0,0 +0,0 @@ define('js!dom', ['js!Node'], function(Node){ |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ define('js!Node', function(){ |
@@ -0,0 +0,0 @@ define("js!ParallelDeferred", ["js!Deferred"], function(Deferred){ |
@@ -19,2 +19,4 @@ /** | ||
var global = (function(){return this || (0,eval)('this')})(); | ||
/** | ||
@@ -162,3 +164,4 @@ * Convert string value to right type | ||
fnModuleDecl = /^__fnModuleDecl::/, | ||
fnDecl = /^__fnDecl::/; | ||
fnDecl = /^__fnDecl::/, | ||
dateDecl = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/; | ||
@@ -173,2 +176,5 @@ if (typeof value == 'string') { | ||
} | ||
if (dateDecl.test(value)){ | ||
return new Date(value); | ||
} | ||
} | ||
@@ -198,3 +204,3 @@ return value; | ||
try{ | ||
result = require(paths[0]); | ||
result = global.require(paths[0]); | ||
if (paths[1]){ | ||
@@ -272,3 +278,3 @@ paths = paths[1].split('.'); | ||
result.push(new (require("js!" + cName))(collection[i])); | ||
result.push(new (global.require("js!" + cName))(collection[i])); | ||
} | ||
@@ -284,3 +290,3 @@ return result; | ||
utils.bootUp = function(deps){ | ||
require(deps, function(){ | ||
global.require(deps, function(){ | ||
utils.provideInnerComponents(document.body); | ||
@@ -546,2 +552,5 @@ }); | ||
for (var i = 0, l = v.length; i < l; i++){ | ||
if (i > 0){ | ||
result += ','; | ||
} | ||
result += getStr(v[i], storage); | ||
@@ -548,0 +557,0 @@ } |
@@ -0,0 +0,0 @@ define('html!test.Component', ['doT'], function(doT){ |
@@ -0,0 +0,0 @@ define(['js!dom'], function(dom){ |
@@ -0,0 +0,0 @@ define(['js!EventBus'], function(EventBus){ |
@@ -0,0 +0,0 @@ define('js!test.package', { |
@@ -0,0 +0,0 @@ define('html!test.Child', ['doT'], function(doT){ |
@@ -127,2 +127,12 @@ define(['js!utils'], function(utils){ | ||
'infinity' : 1/0 | ||
}, | ||
{ | ||
'null' : null, | ||
'undefined' : {}.a, | ||
'string' : 'str2', | ||
'number' : 2, | ||
'boolean' : true, | ||
'regexp' : /./gim, | ||
'date' : new Date(), | ||
'infinity' : 1/0 | ||
} | ||
@@ -129,0 +139,0 @@ ] |
@@ -0,0 +0,0 @@ var tests = []; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
6014
14
3
243305
+ Addedcommander@2.3.0(transitive)
+ Addedhas@1.0.4(transitive)
+ Addedis@3.3.0(transitive)
+ Addednode.extend@1.1.8(transitive)
Updatedcommander@2.3.x
Updatednode.extend@1.1.x