Return-Path: X-Original-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 04FDDD499 for ; Thu, 6 Dec 2012 19:46:20 +0000 (UTC) Received: (qmail 36875 invoked by uid 500); 6 Dec 2012 19:46:19 -0000 Delivered-To: apmail-incubator-flex-dev-archive@incubator.apache.org Received: (qmail 36823 invoked by uid 500); 6 Dec 2012 19:46:19 -0000 Mailing-List: contact flex-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-dev@incubator.apache.org Received: (qmail 36815 invoked by uid 99); 6 Dec 2012 19:46:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 19:46:19 +0000 X-ASF-Spam-Status: No, hits=-1.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aharui@adobe.com designates 64.18.1.183 as permitted sender) Received: from [64.18.1.183] (HELO exprod6og102.obsmtp.com) (64.18.1.183) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 19:46:12 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob102.postini.com ([64.18.5.12]) with SMTP ID DSNKUMD17/75RjAi2yc0oR0t3jJutI4tIw3w@postini.com; Thu, 06 Dec 2012 11:45:51 PST Received: from inner-relay-1.corp.adobe.com (inner-relay-1.adobe.com [153.32.1.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id qB6JjnuN026116 for ; Thu, 6 Dec 2012 11:45:50 -0800 (PST) Received: from nahub02.corp.adobe.com (nahub02.corp.adobe.com [10.8.189.98]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id qB6JjmAW023931 for ; Thu, 6 Dec 2012 11:45:48 -0800 (PST) Received: from NAMBX02.corp.adobe.com ([10.8.127.96]) by nahub02.corp.adobe.com ([10.8.189.98]) with mapi; Thu, 6 Dec 2012 11:45:48 -0800 From: Alex Harui To: "flex-dev@incubator.apache.org" Date: Thu, 6 Dec 2012 11:45:47 -0800 Subject: Re: [ASJS] Some information on "templates" Thread-Topic: [ASJS] Some information on "templates" Thread-Index: Ac3T6YYFg0ih8AUxR+yIHriXsEjbuwAAMNVT Message-ID: In-Reply-To: <20121206143942.99854rj0sybwriwu@franklin.liquidweb.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-Entourage/13.13.0.120411 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org On 12/6/12 11:39 AM, "Michael Schmalle" wrote: > Erik, >=20 > I'm trying to get clear on something. >=20 > What exact classes or interfaces get translated from .as to .js from > the framework directories? IMO, that's in flux. I haven't looked at Erik's refactoring, but in my version each component on the AS side was broken into MVC "beads". I didn'= t do that on the JS side, but right now I think we should, then the M & C beads can just be cross-compiled. The V beads are where all flash APIs wil= l be used, so equivalent JS V beads will be created by hand. >=20 > What files are going to be maintained by hand and tests? I'm still a > bit confused to the flow. >=20 > You have FlexObject.js, FlexGlobals.js which obviously has no > correlation in .as. What about that? >=20 >=20 > Mike >=20 >=20 >=20 >=20 > Quoting Erik de Bruin : >=20 >> That looks very promising! Some tweaking is needed, and some of the >> output (the bottom part mostly, I guess that is for some kind of >> introspection that is in my template provided by other methods) isn't >> needed, at least not from what I understand. >>=20 >> I'll look into the details of the new output tomorrow and indicate if >> and what changes would be nice ;-) >>=20 >> EdB >>=20 >>=20 >> On Thu, Dec 6, 2012 at 7:01 PM, Michael Schmalle >> wrote: >>> Hi, >>>=20 >>> Right now after about 5 hours of researching and messing around I can g= et >>> the following using the closure compiler flag; >>>=20 >>> //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> AS CODE >>>=20 >>>=20 >>> package com.example.components >>> { >>>=20 >>> import flash.display.Sprite; >>>=20 >>> public class MyTextButton extends Sprite >>> { >>> public function MyTextButton() >>>=20 >>> { >>> super(); >>> } >>>=20 >>> private var _privateVar:String =3D "do "; >>>=20 >>> public var publicProperty:Number =3D 100; >>>=20 >>> public function myFunction(value: String): String >>> { >>> return "Don't " + _privateVar + value; >>> } >>> } >>> } >>>=20 >>>=20 >>> //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> JS CODE >>>=20 >>> /** @preserve CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-06 12:55:= 52 >>> */ >>> /** >>> * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-06 12:52:19 >>> * >>> * Class: com.example.components.MyTextButton >>> * @constructor >>> * @extends flash.display.Sprite >>> */ >>>=20 >>> // Constructor >>>=20 >>>=20 >>> /** >>> * Constructor: com.example.components.MyTextButton() >>> * @constructor >>> * @this {com.example.components} >>> */ >>> com.example.components.MyTextButton =3D function() >>> { >>> var self =3D this; >>> self.publicProperty /* : Number */ =3D 100; >>> goog.base(this); >>> return self; >>> } >>>=20 >>>=20 >>> goog.inherits(com.example.components.MyTextButton, flash.display.Sprite= ); >>>=20 >>> /** >>> * Member: com.example.components.MyTextButton.prototype._CLASS >>> * @const >>> * @type {com.example.components.MyTextButton} >>> */ >>> com.example.components.MyTextButton.prototype._CLASS =3D >>> com.example.components.MyTextButton; >>> ; >>>=20 >>> /** >>> * Member: com.example.components.MyTextButton._privateVar >>>=20 >>> * @private >>> * @type {string} >>> */ >>> com.example.components.MyTextButton.prototype._privateVar /* : String *= / =3D >>> "do "; >>> ; >>>=20 >>> /** >>> * Member: com.example.components.MyTextButton.publicProperty >>> * @type {number} >>> */ >>> com.example.components.MyTextButton.prototype.publicProperty /* : Numbe= r */ >>> =3D 100; >>> ; >>>=20 >>>=20 >>> /** >>> * Method: com.example.components.MyTextButton.myFunction() >>> * @this {com.example.components.MyTextButton} >>> * @param {string} value >>> * @return {string} >>> */ >>> com.example.components.MyTextButton.prototype.myFunction =3D function(v= alue /* >>> : String */) /* : String */ >>> { >>> /** @type {com.example.components.MyTextButton} */ >>> var self =3D this; >>> return (("Don't " + self._privateVar) + value); >>> } >>>=20 >>> /** >>> * Member: com.example.components.MyTextButton._PACKAGE >>> * @const >>> * @type {com.example.components} >>> */ >>> com.example.components.MyTextButton._PACKAGE =3D com.example.components= ; >>>=20 >>>=20 >>> /** >>> * Member: com.example.components.MyTextButton._NAME >>> * @const >>> * @type {string} >>> */ >>> com.example.components.MyTextButton._NAME =3D "MyTextButton"; >>>=20 >>> /** >>> * Member: com.example.components.MyTextButton._FULLNAME >>> * @const >>> * @type {string} >>> */ >>> com.example.components.MyTextButton._FULLNAME =3D >>> "com.example.components.MyTextButton"; >>>=20 >>> /** >>> * Member: com.example.components.MyTextButton._SUPER >>> * @const >>> * @type {flash.display.Sprite} >>> */ >>> com.example.components.MyTextButton._SUPER =3D flash.display.Sprite; >>>=20 >>> /** >>> * Member: com.example.components.MyTextButton._NAMESPACES >>> * @const >>> * @type {Object} >>> */ >>> com.example.components.MyTextButton._NAMESPACES =3D { >>> "_privateVar::7:com.example.components.MyTextButton" : true, >>> "publicProperty::2" : true, >>> "myFunction::2" : true >>> } >>>=20 >>> adobe.classes["com.example.components.MyTextButton"] =3D >>> com.example.components.MyTextButton; >>>=20 >>> /CODE >>> //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>=20 >>>=20 >>> Is this a base we can work off of Erik? >>>=20 >>> Let me know what you would want changed within that scope. >>>=20 >>> I know how I can get the imports (IE require()) in. There is some funky >>> business going on with the constructor that will need to be sorted out. >>>=20 >>> JSDoc comments are not hard to add/remove either with tags etc.. >>>=20 >>>=20 >>> Mike >>>=20 >>>=20 >>>=20 >>>=20 >>>=20 >>>=20 >>> Quoting Erik de Bruin : >>>=20 >>>> Correct. >>>>=20 >>>> I have created 'tests' directories on both the AS and JS frameworks, >>>> and plan to use FlexUnit for AS and Jasmine for JS unit testing. That >>>> covers the frameworks. I imagine we build pre- and postcompile tests >>>> for the project code as well. >>>>=20 >>>> And leaving out the intermediate step (i.e. have FalconJS directly >>>> output minified JS, or have FalconJS call the Closure Compiler >>>> directly as a post compile step) will only increase the difficulty in >>>> testing for and more importantly, debugging any issues in the output >>>> JS. >>>>=20 >>>> Finally, not having intermediate (annotated) JS files will make it >>>> impossible to let the Closure Builder do it's magic. That magic is an >>>> important part of having a highly optimised final output. The Builder >>>> calculates the dependencies between the project code, the FlexJS JS >>>> framework and the Closure Library, allowing it to remove unused code >>>> (no penalty for using a large library of which you only use one >>>> method) and to minify all internal references, while the annotation >>>> prevents the renaming or even deletion of public interfaces. >>>>=20 >>>> All in all, the "intermediate" step, at least for the first few >>>> versions looks to me like a valuable tool and a way to allow for >>>> speedy development of both projects as well as the frameworks. >>>>=20 >>>> EdB >>>>=20 >>>>=20 >>>>=20 >>>> On Thu, Dec 6, 2012 at 4:56 PM, Michael Schmalle >>>> wrote: >>>>>=20 >>>>>=20 >>>>> Quoting Carol Frampton : >>>>>=20 >>>>>>=20 >>>>>>=20 >>>>>> On 12/6/12 7 :49AM, "Erik de Bruin" wrote: >>>>>>=20 >>>>>>> Mike, >>>>>>>=20 >>>>>>> After I'm done fixing the mess I made in SVN, I'll start work on th= e >>>>>>> 'template', but here is the basic idea to get you started: I would >>>>>>> like the compiler to output "intermediate" JS, by which I mean "hum= an >>>>>>> readable". My Publisher then takes this intermediate code and puts = it >>>>>>> through the Google Closure Builder, which optimises and minifies it= . >>>>>>> The advantage of having the "intermediate" step is that it makes >>>>>>> debugging much (MUCH) easier. It will allow us to write tests, >>>>>>> something that minified code won't. And it will let us run the code= in >>>>>>> the various browser based tooling and have the output make sense. >>>>>>=20 >>>>>>=20 >>>>>>=20 >>>>>> If you use an intermediate form to test how to you know there aren't >>>>>> bugs >>>>>> introduced by the publishing process? >>>>>>=20 >>>>>> Carol >>>>>=20 >>>>>=20 >>>>>=20 >>>>> Isn't the publishing process the closure compiler which google has te= sts >>>>> for >>>>> when it compiles out the minified optimized js? >>>>>=20 >>>>> I probably have more time into investigating the corss compile code I= n >>>>> FalconJS and I have to say as it stands we don't even know if our >>>>> compiler >>>>> is creating bugs in the output js. It seems Adobe was unit testing th= e js >>>>> but we don't have any of those tests. >>>>>=20 >>>>> So its reasonable to think we need to have tests for js that is compi= led >>>>> by >>>>> FalconJS in the intermediate stage. >>>>>=20 >>>>>=20 >>>>>=20 >>>>>=20 >>>>> Mike >>>>>=20 >>>>> -- >>>>> Michael Schmalle - Teoti Graphix, LLC >>>>> http://www.teotigraphix.com >>>>> http://blog.teotigraphix.com >>>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> -- >>>> Ix Multimedia Software >>>>=20 >>>> Jan Luykenstraat 27 >>>> 3521 VB Utrecht >>>>=20 >>>> T. 06-51952295 >>>> I. www.ixsoftware.nl >>>>=20 >>>=20 >>> -- >>> Michael Schmalle - Teoti Graphix, LLC >>> http://www.teotigraphix.com >>> http://blog.teotigraphix.com >>>=20 >>=20 >>=20 >>=20 >> -- >> Ix Multimedia Software >>=20 >> Jan Luykenstraat 27 >> 3521 VB Utrecht >>=20 >> T. 06-51952295 >> I. www.ixsoftware.nl >>=20 --=20 Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui