lib/render/client.js
function(definition, options){
  var prevRunning = env.isRunning;
  env.isRunning = true;
  var node, template, cursor, context = this, body, mountNode;
  options = options || {};
  definition = definition || {};



  var dtemplate = definition.template;

  if(env.browser) {

    if( node = tryGetSelector( dtemplate ) ){
      dtemplate = node;
    }
    if( dtemplate && dtemplate.nodeType ){
      definition.template = dtemplate.innerHTML
    }
    
    mountNode = definition.mountNode;
    if(typeof mountNode === 'string'){
      mountNode = dom.find( mountNode );
      if(!mountNode) throw Error('mountNode ' + mountNode + ' is not found')
    } 

    if(mountNode){
      cursor = nodeCursor(mountNode.firstChild, mountNode)
      delete definition.mountNode
    }else{
      cursor = options.cursor
    }
  }



  template = shared.initDefinition(context, definition)
  

  if(context.$parent){
     context.$parent._append(context);
  }
  context._children = [];
  context.$refs = {};
  context.$root = context.$root || context;

  var extra = options.extra;
  var oldModify = extra && extra.$$modify;

  
  var newExtra;
  if( body = context._body ){
    context._body = null
    var modifyBodyComponent = context.modifyBodyComponent;
    if( typeof modifyBodyComponent  === 'function'){
      modifyBodyComponent = modifyBodyComponent.bind(this)
      newExtra = _.createObject(extra);
      newExtra.$$modify = function( comp ){
        return modifyBodyComponent(comp, oldModify? oldModify: NOOP)
      }
    }else{ //@FIXIT: multiply modifier
      newExtra = extra
    }
    if(body.ast && body.ast.length){
      context.$body = _.getCompileFn(body.ast, body.ctx , {
        outer: context,
        namespace: options.namespace,
        extra: newExtra,
        record: true
      })
    }
  }

  // handle computed
  if(template){
    var cplOpt = {
      namespace: options.namespace,
      cursor: cursor
    }
    // if(extra && extra.$$modify){
      cplOpt.extra = {$$modify : extra&& extra.$$modify}
    // }
    context.group = context.$compile(template, cplOpt);
    combine.node(context);
  }



  // modify在compile之后调用， 这样就无需处理SSR相关逻辑
  
  if( oldModify ){
    oldModify(this);
  }

  // this is outest component
  if( !context.$parent ) context.$update();
  context.$ready = true;

  context.$emit("$init");
  if( context.init ) context.init( context.data );
  context.$emit("$afterInit");

  env.isRunning = prevRunning;

  // children is not required;
  
  if (this.devtools) {
    this.devtools.emit("init", this)
  }
}
function(definition, options){
  var prevRunning = env.isRunning;
  env.isRunning = true;
  var node, template, cursor, context = this, body, mountNode;
  options = options || {};
  definition = definition || {};



  var dtemplate = definition.template;

  if(env.browser) {

    if( node = tryGetSelector( dtemplate ) ){
      dtemplate = node;
    }
    if( dtemplate && dtemplate.nodeType ){
      definition.template = dtemplate.innerHTML
    }
    
    mountNode = definition.mountNode;
    if(typeof mountNode === 'string'){
      mountNode = dom.find( mountNode );
      if(!mountNode) throw Error('mountNode ' + mountNode + ' is not found')
    } 

    if(mountNode){
      cursor = nodeCursor(mountNode.firstChild, mountNode)
      delete definition.mountNode
    }else{
      cursor = options.cursor
    }
  }



  template = shared.initDefinition(context, definition)
  

  if(context.$parent){
     context.$parent._append(context);
  }
  context._children = [];
  context.$refs = {};
  context.$root = context.$root || context;

  var extra = options.extra;
  var oldModify = extra && extra.$$modify;

  
  var newExtra;
  if( body = context._body ){
    context._body = null
    var modifyBodyComponent = context.modifyBodyComponent;
    if( typeof modifyBodyComponent  === 'function'){
      modifyBodyComponent = modifyBodyComponent.bind(this)
      newExtra = _.createObject(extra);
      newExtra.$$modify = function( comp ){
        return modifyBodyComponent(comp, oldModify? oldModify: NOOP)
      }
    }else{ //@FIXIT: multiply modifier
      newExtra = extra
    }
    if(body.ast && body.ast.length){
      context.$body = _.getCompileFn(body.ast, body.ctx , {
        outer: context,
        namespace: options.namespace,
        extra: newExtra,
        record: true
      })
    }
  }

  // handle computed
  if(template){
    var cplOpt = {
      namespace: options.namespace,
      cursor: cursor
    }
    // if(extra && extra.$$modify){
      cplOpt.extra = {$$modify : extra&& extra.$$modify}
    // }
    context.group = context.$compile(template, cplOpt);
    combine.node(context);
  }



  // modify在compile之后调用， 这样就无需处理SSR相关逻辑
  
  if( oldModify ){
    oldModify(this);
  }

  // this is outest component
  if( !context.$parent ) context.$update();
  context.$ready = true;

  context.$emit("$init");
  if( context.init ) context.init( context.data );
  context.$emit("$afterInit");

  env.isRunning = prevRunning;

  // children is not required;
  
  if (this.devtools) {
    this.devtools.emit("init", this)
  }
}
function ( definition , options ) { var prevRunning = env . isRunning ; env . isRunning = true ; var node , template , cursor , context = this , body , mountNode ; options = options || { } ; definition = definition || { } ; var dtemplate = definition . template ; if ( env . browser ) { if ( node = tryGetSelector ( dtemplate ) ) { dtemplate = node ; } if ( dtemplate && dtemplate . nodeType ) { definition . template = dtemplate . innerHTML } mountNode = definition . mountNode ; if ( typeof mountNode === 'string' ) { mountNode = dom . find ( mountNode ) ; if ( ! mountNode ) throw Error ( 'mountNode ' + mountNode + ' is not found' ) } if ( mountNode ) { cursor = nodeCursor ( mountNode . firstChild , mountNode ) delete definition . mountNode } else { cursor = options . cursor } } template = shared . initDefinition ( context , definition ) if ( context . $parent ) { context . $parent . _append ( context ) ; } context . _children = [ ] ; context . $refs = { } ; context . $root = context . $root || context ; var extra = options . extra ; var oldModify = extra && extra . $$modify ; var newExtra ; if ( body = context . _body ) { context . _body = null var modifyBodyComponent = context . modifyBodyComponent ; if ( typeof modifyBodyComponent === 'function' ) { modifyBodyComponent = modifyBodyComponent . bind ( this ) newExtra = _ . createObject ( extra ) ; newExtra . $$modify = function ( comp ) { return modifyBodyComponent ( comp , oldModify ? oldModify : NOOP ) } } else { //@FIXIT: multiply modifier newExtra = extra } if ( body . ast && body . ast . length ) { context . $body = _ . getCompileFn ( body . ast , body . ctx , { outer : context , namespace : options . namespace , extra : newExtra , record : true } ) } } // handle computed if ( template ) { var cplOpt = { namespace : options . namespace , cursor : cursor } // if(extra && extra.$$modify){ cplOpt . extra = { $$modify : extra && extra . $$modify } // } context . group = context . $compile ( template , cplOpt ) ; combine . node ( context ) ; } // modify在compile之后调用， 这样就无需处理SSR相关逻辑 if ( oldModify ) { oldModify ( this ) ; } // this is outest component if ( ! context . $parent ) context . $update ( ) ; context . $ready = true ; context . $emit ( "$init" ) ; if ( context . init ) context . init ( context . data ) ; context . $emit ( "$afterInit" ) ; env . isRunning = prevRunning ; // children is not required; if ( this . devtools ) { this . devtools . emit ( "init" , this ) } }
`Regular` is regularjs's NameSpace and BaseClass. Every Component is inherited from it

@class Regular
@module Regular
@constructor
@param {Object} options specification of the component
Regular is regularjs s NameSpace and BaseClass . Every Component is inherited from it