[dojo-contributors] Fwd: Using Dojo 1.6 with Closure -- document attached

Stephen Chung Stephen.Chung at intexact.com
Sat Mar 12 03:29:32 EST 2011


That’s right.  :-)  Inheritance shouldn’t be a prob with Dojo as it is right now.

The same-name mangling rule is to avoid problems such as:

    var obj1 = {foo:1, bar:2};
    var obj2 = {foo:3, bar:4};

    function doSomething (obj) { alert(obj.foo); }

If “foo” and “bar” are not renamed similarly across objects, then a lot of code that accepts arbitrary objects will break.

- Stephen

From: Bill Keese 
Sent: Saturday, 12 March, 2011 3:59 PM
To: Stephen Chung 
Cc: dojo dev. ; Kris Zyp 
Subject: Re: [dojo-contributors] Fwd: Using Dojo 1.6 with Closure -- document attached

Oh OK, I figured it would break completely. 

I guess what saves us is that (as you explained before) a method name is always converted to the same mangled name regardless of what class it came from.


On Sat, Mar 12, 2011 at 2:38 PM, Stephen Chung <Stephen.Chung at intexact.com> wrote:

  Hi Bill,

  That’s correct.  Closure only handles prototypical inheritance.  It does not support multiple inheritance.  AFAIK, Dojo only simulates multiple inheritance with mixin’s for all base types other than the first one in dojo.declare, so in my build script, I only mark the first base class as @extends.

  AFAIK, Closure does not have much to offer for inheritance anyway – there aren’t much interesting optimizations being done for base classes, only primarily type checking.  So there is not much loss.

  So, I don’t think we are losing anything by not catering to Closure’s inheritance system.

  - Stephen

  From: Bill Keese 
  Sent: Saturday, 12 March, 2011 9:35 AM
  To: dojo dev. 
  Cc: Kris Zyp ; Stephen Chung 
  Subject: Re: [dojo-contributors] Fwd: Using Dojo 1.6 with Closure -- document attached

  So Stephen, here's one of the tickets I filed against closure:   http://code.google.com/p/closure-compiler/issues/detail?id=250 


  It's about how you can't denote multiple inheritance to the closure compiler.   Multiple inheritance is pervasive in dijit.   How have you handled that in your converter, or have you?


  2011/3/2 Kris Zyp <kzyp at dojotoolkit.org>

    Stephen Chung has been researching the possibility of using Closure's advanced mode on Dojo to create highly compressed builds that eliminate dead code, and shorten property names. Attached is a document detailing his results. This could be very helpful in guiding our decisions about how to achieve extremely compact Dojo applications.

    Thanks,
    Kris

    -------- Original Message -------- 
          Subject:  Using Dojo 1.6 with Closure -- document attached 
          Date:  Tue, 1 Mar 2011 13:06:57 +0800 
          From:  Stephen Chung mailto:Stephen.Chung at intexact.com 
          Organization:  Intexact Technologies 
          To:  Kris Zyp mailto:kzyp at dojotoolkit.org 




    Hi Kris,

    I have put together a TODO document (attached) detailing how to use Dojo 1.6 with the Closure Compiler.
    Please help take a look, and perhaps put in on somewhere that people who wants to know how to do this can get some references.
    Thanks!
    - Stephen

    _______________________________________________
    dojo-contributors mailing list
    dojo-contributors at mail.dojotoolkit.org
    http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors




------------------------------------------------------------------------------


  No virus found in this incoming message.
  Checked by AVG - www.avg.com 

  Version: 9.0.872 / Virus Database: 271.1.1/3501 - Release Date: 03/12/11 03:56:00




--------------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.872 / Virus Database: 271.1.1/3501 - Release Date: 03/12/11 03:56:00
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20110312/3dfbb55f/attachment.htm 


More information about the dojo-contributors mailing list