GithubHelp home page GithubHelp logo

troopjs's Introduction

Build Status Join the chat at https://gitter.im/troopjs/troopjs

Troop JS

  ____ .     ____  ____  ____    ____.
  \   (/_\___\  (__\  (__\  (\___\  (/
  / ._/  ( . _   \  . /   . /  . _   \_
_/    ___/   /____ /  \_ /  \_    ____/
\   _/ \____/   \____________/   /
 \_t:_____r:_______o:____o:___p:/ <JS/>

troopjs's People

Contributors

eyalar avatar garryyao avatar gitter-badger avatar kates avatar mikaelkaron avatar vincentshaoef avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

troopjs's Issues

pub sub uri problems

Subscribe problems:

  • Handlers in Memory will be triggered before the sub-widget weave.For example,when i change level,the process is:
Load@servive : level load.js:84
load/unit@unit unit.js:53  //*this line should not be executed*
Load@servive : unit load.js:84
load/unit@unit 
  • Reason:When parent widget reload will cause the sub widgets reweave,
    but when sub widgets sig/subscribe it will execute memory handlers registed immdiatly
  • Solution: Clear sub-widget memory handlers when route parent widget(May be you can supply a clear method)

Publish problems:

  • Hub publish the handlers have been executed.For example,
    when i change level,it will cause lesson widget execute load/unit twice.
  • Reason: That's because sub and pub do the same thing when recreate a widget
  • Solution: Make sure excute all published handlers before subscribe memory handlers

Weave problems:

  • When reload exists widgets will cause the hab/handlers increase.
    For example:change unit will cause the load/unit@lesson handler increase by 4.
    • Reason: When reload those widgets which have exists,the old hub/handler didn't destroyed
    • Solution: Before weave new widget we must make sure the old exists widget has been destroyed

Other

  • syntax error in file pubsub/hub.js line 184
if (!topic in HANDLERS)  {  //**here have priority problem**
                    break unsubscribe;
}
  • uri problem in uri.js in line 173
if (!(PATH in self)) {
    uri.splice(0, 1); //here should be uri.splice(0, 2),cause before  'path' has another  arg
}

This problems we can use some ugly ways to solve,eg: use $.fn.unweave to avoid weave problem.Please help to fix this problems or give us some better ways to use framework.

Thanks!

implement smart licence combinator for troopjs modules

if you create a optimized build of troopjs-bundle (with optimize=uglify) you'll see the license comments for each individual TroopJS module repeated. This is redundant and we should implement something that can combine TroopJS license comments into one combined license comment that says what modules were included in this build.

In relation to this requirejs/r.js#132 was filed and the best way to implement this would be to hook it up to onBuildWrite.

Investigate how to make modules somewhat independent of environment

We should investigate if packaging the bundle using this boilerplate would make it work in more environments:

(function(define) {
})(typeof define == 'function'
    ? define
    : function (deps, factory) { typeof module != 'undefined'
        ? (module.exports = factory(require('./name')))
        : (this.name      = factory(this.name));
    }
    // Boilerplate for AMD, Node, and browser global
);

code coverage tool integration

It's easier to visualize how much of our code we are testing if we have a code coverage tool in place. Something that'll give us a report after each test run would be nice. Integration with busterjs is a must since we're using busterjs for testing.

Currently evaluating jscoverage, node-cover, node-coverjs, istanbul.

feature request: data binding to dom element

calling html(template, data) to rendering causes difficulties on animation and transition.

animation must wait after data be applied to the template and inserted to html, that makes animation programming a pain.

we hope the framework can provides a data binding mechanism that easier the animation logic

build minified version of bundles

The builds provided now are all non minified which is fine in development, but not optimal in production. We should provide minified versions of our bundles so that they can either be put on CDN's or just included straight into projects.

add support for task management

At any given point of time it's interesting to know what tasks are running in the application. We should provide some way that the framework can keep track of running tasks.

Split bundle into maxi, mini and micro bundles

For now we're only creating one bundle that includes (almost) all the TroopJS modules. If you need your own setup, you basically have to roll your own build from scratch.

What we'd like to do is to provide three different bundles depending on how much of TroopJS you need:

  • maxi that would provide all TroopJS modules in one file
  • mini that would provide the smallest set of modules needed to cover most common usage
  • micro the absolute minimum set of modules, excluding all external dependencies (like compose.js)

add :one to sig method signature

it would be nice if the sig/ method signature supported :one (as dom does). Basically this would be for signatures that can only be run once and that should remove themselves after that)

API documentation to support troopjs features

We should add extended syntax support for documenting troopjs components. In no relevant order, I'd like to see support for:

  • @sig for documenting signals
  • @dom for documenting dom events (subscribers)
  • @hub for documenting hub events (subscribers)
  • @topic for documenting hub events (publishers)

It would also be nice if all we have to do here is to provide our own .peg file and a matching template to get this done.

feature request: subscription in order

hub subscription is orderless.

however we would like to have orderred subscription to make sure the handler gets called in specified order.

here is an proposal of the interface:

'hub:memory:0/start/something': function(){

}
'hub:memory:1/stop/something': function(){

}

use index to indicates that start event will always be subscribed earlier than stop, so if there is 'memoried arguments', start will be always the first one to be called.

Pub&Sub problems in hub

Subscribe problems:

  • Handlers in Memory will be triggered before the sub-widget weave.For example,when i change level,the process is:
Load@servive : level load.js:84
load/unit@unit unit.js:53  //*this line should not be executed*
Load@servive : unit load.js:84
load/unit@unit 
  • Reason:When parent widget reload will cause the sub widgets reweave,
    but when sub widgets sig/subscribe it will execute memory handlers registed immdiatly
  • Solution: Clear sub-widget memory handlers when route parent widget(May be you can supply a clear method)

Publish problems:

  • Hub publish the handlers have been executed.For example,
    when i change level,it will cause lesson widget execute load/unit twice.
  • Reason: That's because sub and pub do the same thing when recreate a widget
  • Solution: Make sure excute all published handlers before subscribe memory handlers

Weave problems:

  • When reload exists widgets will cause the hab/handlers increase.
    For example:change unit will cause the load/unit@lesson handler increase by 4.
    • Reason: When reload those widgets which have exists,the old hub/handler didn't destroyed
    • Solution: Before weave new widget we must make sure the old exists widget has been destroyed

This problems we can use some ugly ways to solve,eg: use $.fn.unweave to avoid weave problem.Please help to fix this problems or give us some better ways to use framework.

Thanks!

refactor parameter parsing

At the moment the parameter parsing for weave/placeholder is using a regexp. This is not ideal and not 100% robust (and not reusable). Should be replaced with a simple parameter parser.

if optional deferred was not passed, create it

This may sound a bit fragmented, but quite a bit of code checks if the (mostly) optional deferred was passed and has logic to handle that. We should probably just bite the bullet and create-if-not-supplied for code clarity.

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.