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 BB6A4EC03 for ; Thu, 6 Dec 2012 12:50:12 +0000 (UTC) Received: (qmail 99650 invoked by uid 500); 6 Dec 2012 12:50:11 -0000 Delivered-To: apmail-incubator-flex-dev-archive@incubator.apache.org Received: (qmail 99060 invoked by uid 500); 6 Dec 2012 12:50:08 -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 98624 invoked by uid 99); 6 Dec 2012 12:50:06 -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 12:50:06 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.223.177] (HELO mail-ie0-f177.google.com) (209.85.223.177) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 12:50:01 +0000 Received: by mail-ie0-f177.google.com with SMTP id k13so11246081iea.8 for ; Thu, 06 Dec 2012 04:49:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=2+THQBVPogb9KHr3xU0OCHblxmdF257JNa8+Idrk668=; b=Jke3F1xwI+IJYMmBlCko4HjLzx5dXvrFWUmbJqiv/UD70mDQ8dZBPYFhcWJx/cu1pl MORKjpnk6ywrSwbpaQwK4qdi+FJF+0PJhJGH7OAbEvQ9/YjtExPCLY19+ietmSE5O3rM KTqirpkfTw1WEIB1EqmjumN6yRtKuGB9fEN/ygSQ38h13O+rlnLDeHwlQ0O8MY3aDZ1h gSJoWEBZztuWEPtJvUUSv5tJpQReViaOEcGlGwPlqPYG07AOfuOadzxGZh9XN8mF2KLD FYwaednYQNe+CRjUEfIiYyAKE00zjist2Snl5th3X9abNUUeimt1m+Wf5AHF58l2xP+o TSPw== MIME-Version: 1.0 Received: by 10.50.152.194 with SMTP id va2mr1232715igb.25.1354798180546; Thu, 06 Dec 2012 04:49:40 -0800 (PST) Received: by 10.64.34.234 with HTTP; Thu, 6 Dec 2012 04:49:40 -0800 (PST) In-Reply-To: <20121206071251.211946y02if0q5s3@franklin.liquidweb.com> References: <20121206071251.211946y02if0q5s3@franklin.liquidweb.com> Date: Thu, 6 Dec 2012 13:49:40 +0100 Message-ID: Subject: Re: [ASJS] Some information on "templates" From: Erik de Bruin To: "flex-dev@incubator.apache.org" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlmNqmc/YS7CcQQmFeOT3JwWPhDWxiRLukLZ8a37CGxLGiNLQ5ihCDejeGaIhuoAh2BNIgO X-Virus-Checked: Checked by ClamAV on apache.org Mike, After I'm done fixing the mess I made in SVN, I'll start work on the 'template', but here is the basic idea to get you started: I would like the compiler to output "intermediate" JS, by which I mean "human 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. So, to the basics (remember this is a work in progress!): AnActionScript (AS) class: package just.some.package { import mx.controls.Button; public class MyClass extends Button { public function MyClass() { super(); } private var _privateVar:String = "do "; public var publicProperty:Number = 100; public function myFunction(value: String): String { return "Don't " + _privateVar + value; } } } Should output the following JavaScript (JS) object: goog.provide('just.some.package.MyClass'); goog.require('org.apache.flex.html.staticControls.TextButton'); /** * @constructor * @extends {org.apache.flex.html.staticControls.TextButton} */ just.some.package.MyClass = function() { org.apache.flex.html.staticControls.TextButton.call(this); /** * @private * @type {string} */ this.privateVar_ = 'do '; } goog.inherits(just.some.package.MyClass, org.apache.flex.html.staticControls.TextButton); /** * @expose * @type {number} */ just.some.package.MyClass.prototype.publicProperty = 100; /** * @this {just.some.package.MyClass} * @param {string} value The value argument. * @return {string} The nicely concatenated return. */ org.apache.flex.core.ViewBase.prototype.myFunction = function(value) { return 'Don\'t ' + this.privateVar_ . value; }; That should give you a broad idea of what needs to be done. There are obviously other constructs that I don't address here, but as a start it should serve you well. Thanks, EdB On Thu, Dec 6, 2012 at 1:12 PM, Michael Schmalle wrote: > Hi Erik, > > This is mainly directed at you. Can you give as much information as to can > on what needs to be produced from the compiler? > > I finally have myself back up and running so I want to try and change the > output code. It will be a way to get my hands dirty and try to break things. > > This way maybe Alex can do other important things. If I can't get it, I'll > let the list know. :) > > I am looking at the code you committed to figure out the "flow". > > By using this framework (goog closure) does that mean we have access to all > their UI components in javascript and html? If so, this means we actually > have a component platform that can start to be integrated with Flex > components? ... our new component framework I mean. > > Remember I am completely ignorant to js, but learning a lot now. > > Mike > > -- > Michael Schmalle - Teoti Graphix, LLC > http://www.teotigraphix.com > http://blog.teotigraphix.com > -- Ix Multimedia Software Jan Luykenstraat 27 3521 VB Utrecht T. 06-51952295 I. www.ixsoftware.nl