GithubHelp home page GithubHelp logo

gravityjs's Introduction

GravityJS

A Javascript MVC framework

gravityjs's People

Contributors

bagushutomo avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

gravityjs's Issues

Infinite loop on clash creation when constructor method is omitted

Currently, class definition should have a constructor method to work correctly..

(function(){
    XM.define("com.Circle", {
        centerX: 0,
        centerY: 0,
        constructor: function(x, y) {
            this.centerX= x;
            this.centerY= y;
        }
    });
})();

However, if constructor method is omitted, the framework will keep creating a class.

This is because constructor method provided in class definition will override the generic constructor method on native object. Therefore, if omitted the framework will execute the generic constructor method which contain the reference to the class itself, hence triggering the framework to further execute the generic constructor method. Thus, lead to the infinite loop.

Failure of "this" reference inside a listener method

If a class were attached by a listener via addEventListener or attachEvent, a this reference on the listener function will return an undefined instead of reference to the class itself (The undefined result is a valid javascript behaviour, but not an expected result in this framework).

sample:

(function(){
    XM.define("com.Circle", {
        centerX: 0,
        centerY: 0,
        constructor: function(x, y) {
            this.centerX= x;
            this.centerY= y;
        },
        initialize: function() {
            this.addEventListener("mousedown", this.onMouseDown, false);
        },
        onMouseDown: function(e) {
            console.log(this); //return undefined instead of Circle
        },
    });
})();

Ability to do byte accuracy loading (a.k.a: XHR2)

Currently the ScriptLoading only able to do XHR load (i.e: only event of "start loading" and "loading finished" that tracked). In the future, might add capability for XHR2 loading (i.e: able to get the value of actual byte loaded). This will give better accuracy on preloader percentage value

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.