maniartech / framework-factory Goto Github PK
View Code? Open in Web Editor NEWFramework Factory is a JavaScript framework for developing object oriented javascript frameworks.
License: MIT License
Framework Factory is a JavaScript framework for developing object oriented javascript frameworks.
License: MIT License
When passed as meta meber
myFramework.TestClass = myFramework.Class({
testRead: myFramework.readonly(undefined, {
type: 'String' // This is ignored
})
});
Also change the plugin registration structure along with this ticket.
Currently we are returning already registered version of framework with same name, this feature is not very much useful and creates trouble for creating cross platform framework-factory and hence it should be removed.
Framework factory documentation need to be completed.
The new callback type handler should help define callback functions. The default value of callback members should be false,
var classA = myFramework.Class({
onUpdate: myFramework.callback()
update: function() {
if (this.onUpdate) this.onUpdate();
}
});
Usage:
var obj = new ClassA();
//registers callback
obj.onUpdate = function() {
console.log("updated");
}
obj.update(); //prints updated.
obj.onUpdate = false; //unregisters callback.
obj.update(); //does nothing.
The current version of framework-factory doesn't support nodes. FrameworkFactory and its products should be available on both platform browser and nodejs.
Its a good idea to allow type handlers to accept additional configuration parameter which can be later used as meta data for
var cls = myFramework.Class({
//Second parameter in myFramework.attribute type-handler is meta parameter,
//that can be used to provide more information about this attribute.
name : myFramework.attribute('no-name', {
type: 'string'
}
});
Current template only works with browser based application. This needs to be changed so that new cross-platform plugins can be designed.
Currently you need to mandatorily declare event in class before it is triggered. This sometimes creates problem when requiring custom ad-hoc event.
Suppose an Employee is a class in myFramework, meta framework should let you query it.
For example
myFramework.Employee.getMember(memberName);
myFramework.Employee.getMembers(); //Returns all the members in the Employee class
myFramework.Employee.getAttributes(); //Returns all the attributes in the Employee class
myFramework.Employee.getProperties(); //Returns all the members in the Employee class
myFramework.Employee.getEvents(); //Returns all the members in the Employee class
The current structure has some issues due to which FrameworkFactory is attached to the global object. For example in the case of browser environment, window.FrameworkFactory is accessible in the UMD mode.
Currenlty when you declare attribute, property or read-only defaults with object values like [] or {}, the same default object is referenced across all the instance, to prevent this these type-hanlders should accept function default this function should be called by the constructor.
Unlike to $f.Class, this function creates an object and allows members with type hanlders.
myFramework.types = myFramework.Object({
length: myFramework.readonly({
get: function() {
return this._length;
}
}),
click: myFramework.event()
});
Temporarily move it into plugins until we decide its future.
Currently a class can be inherited by passing base class constructor in the $f.Class function
myFramework.ExtendClass = myFramework.Class({
// Initialization object.
}, myFramework.BaseClass);
This can be improved using extend function.
myFramework.ExtendClass = myFramework.BaseClass.extend({
// Initialization object.
});
This plugin should make it easy to export objects to javascript plain objects.
Currently framework-factory.js is a scale-down version of framework-factory-x.js and does not support properties... Make it as main file and create new variation called framework-factory-legacy, this should not support properties.
Currenlty $f.config.set accepts key, value pair, which only set one configuration value. Allow it to accept object in following form so that multiple values can be set.
myFramework.config.set({
key1: value1,
key2: value2
});
Currently it supports base class' method invocation through this.base(...) member. This is good but it is only available in functions. Also technically it carries an overhead of creating and deleting this.base function at run time which is a terrific performance impactor.
The solution is to provide an always available this.base object in Class's prototype so that this can be invoked by any member. After implementation, resulting code should look like this...
//Old
var Abc = myFramework.Class({
print: function print(message) {
this.base(message); //<- See this line
}
};
//New
var Abc = myFramework.Class({
print: function print(message) {
this.base.print(message); //<- See this line
}
}
Following plugins need to be separated inside the plugins directory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.