You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Michael Schmalle <te...@gmail.com> on 2015/06/02 19:38:20 UTC

[FalconJX] FlexJS as to js work

A couple questions;

1. It doesn't look like you have private fields implemented to be emitted
in the constructor? private fileds are going to the prototype. For instance;

private var explicitWidth:Number = NaN;

to

/**
* @private
* @type {number}
*/
this.explicitWidth_ = NaN;

Is this something that needs to happen, UIBase is what I am testing.

2. Running into problems with interfaces, if we use DOM,
HTMLElementWrapper.element needs to be Element not Object correct? If not,
you don't key code completion in the IDE.

3. flexjs_wrapper can't exist on Element, it's not dynamic, does it nee to
be dynamic or do we just use array access?

this.element['flexjs_wrapper'] = this;

4. For DOM elements and the closure compiler, does it expect type Element,
for instance is below correct?

/**
 * @expose
 * @type {Element}
 */
org_apache_flex_core_UIBase.prototype.positioner;

5. The API now needs to be yanked out of Core/as/src into another directory
like Core/api/src, so the as Flash and as HTML ActionScript can share the
same interfaces, correct? What would be the plan?

Lots more but I thought I would start with this.

So from my sketchy tests we have:

----------------------------------------------------
UIBase.as
----------------------------------------------------


package org.apache.flex.core
{

import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;

import randori.webkit.dom.Element;
import randori.webkit.page.Window;

public class UIBase extends HTMLElementWrapper implements IUIBase//,
ILayoutChild, IParentIUIBase
{
    public var positioner:Element;
    private var lastDisplay_:String = '';
    private var explicitWidth_:Number = NaN;
    private var explicitHeight_:Number = NaN;
    private var percentWidth_:Number = NaN;
    private var percentHeight_:Number = NaN;

    // Added

    private var model:Object;

    //public var element:Element;
    private var mxmlBeads_:Vector.<Object> = null;



    public function get alpha():Number
    {
        return 0;
    }

    public function set alpha(value:Number):void
    {
    }

    public function get x():Number
    {
        return 0;
    }

    public function set x(value:Number):void
    {
    }

    public function get y():Number
    {
        return 0;
    }

    public function set y(value:Number):void
    {
    }

    public function get width():Number
    {
        return 0;
    }

    public function set width(value:Number):void
    {
    }

    public function get height():Number
    {
        return 0;
    }

    public function set height(value:Number):void
    {
    }

    public function get clientWidth():Number
    {
        return 0;
    }

    public function get clientHeight():Number
    {
        return 0;
    }

    public function get visible():Boolean
    {
        return false;
    }

    public function set visible(value:Boolean):void
    {
    }

    public function get topMostEventDispatcher():IEventDispatcher
    {
        return null;
    }

    public function UIBase()
    {
        lastDisplay_ = '';
        explicitWidth_ = NaN;
        explicitHeight_ = NaN;
        percentWidth_ = NaN;
        percentHeight_ = NaN;

        createElement();
    }

    public function createElement():Element
    {
        if (element == null)
            element = Window.document.createElement('div');

        if (this.positioner == null)
            this.positioner = this.element as Element;
        this.positioner.style.display = 'block';

        // BUG; cast gets compiled
        // Object(this.element).flexjs_wrapper = this;
        this.element['flexjs_wrapper'] = this;

        return this.positioner;
    }

    public function addedToParent():void
    {
    }

    override public function addBead(bead:IBead):void
    {
        if (!this.beads_) {
            this.beads_ = [];
        }
        this.beads_.push(bead);

        if (bead is IBeadModel)
            this.model_ = bead;

        if (bead is IBeadView) {
            this.dispatchEvent(new Event('viewChanged'));
        }

        bead.strand = this;
    }

    public function getBeadByType(classOrInterface:Class):IBead
    {
        return null;
    }

    public function removeBead(bead:IBead):IBead
    {
        return null;
    }
}
}



----------------------------------------------------
UIBase.js
----------------------------------------------------


/**
 * org.apache.flex.core.UIBase
 *
 * @fileoverview
 *
 * @suppress {checkTypes}
 */

goog.provide('org_apache_flex_core_UIBase');

goog.require('org_apache_flex_core_HTMLElementWrapper');
goog.require('org_apache_flex_events_Event');
goog.require('org_apache_flex_core_IBeadView');
goog.require('org_apache_flex_core_IUIBase');
goog.require('org_apache_flex_core_IBead');
goog.require('org_apache_flex_core_IBeadModel');



/**
 * @constructor
 * @extends {org_apache_flex_core_HTMLElementWrapper}
 * @implements {org_apache_flex_core_IUIBase}
 */
org_apache_flex_core_UIBase = function() {
  org_apache_flex_core_UIBase.base(this, 'constructor');
  this.lastDisplay_ = '';
  this.explicitWidth_ = NaN;
  this.explicitHeight_ = NaN;
  this.percentWidth_ = NaN;
  this.percentHeight_ = NaN;
  this.createElement();
};
goog.inherits(org_apache_flex_core_UIBase,
org_apache_flex_core_HTMLElementWrapper);


/**
 * @expose
 * @type {Element}
 */
org_apache_flex_core_UIBase.prototype.positioner;


/**
 * @private
 * @type {string}
 */
org_apache_flex_core_UIBase.prototype.lastDisplay_ = '';


/**
 * @private
 * @type {number}
 */
org_apache_flex_core_UIBase.prototype.explicitWidth_ = NaN;


/**
 * @private
 * @type {number}
 */
org_apache_flex_core_UIBase.prototype.explicitHeight_ = NaN;


/**
 * @private
 * @type {number}
 */
org_apache_flex_core_UIBase.prototype.percentWidth_ = NaN;


/**
 * @private
 * @type {number}
 */
org_apache_flex_core_UIBase.prototype.percentHeight_ = NaN;


/**
 * @private
 * @type {Object}
 */
org_apache_flex_core_UIBase.prototype.model;


/**
 * @private
 * @type {Vector.<Object>}
 */
org_apache_flex_core_UIBase.prototype.mxmlBeads_ = null;


/**
 * @expose
 * @return {Element}
 */
org_apache_flex_core_UIBase.prototype.createElement = function() {
  if (this.element == null)
    this.element = document.createElement('div');
  if (this.positioner == null)
    this.positioner = org_apache_flex_utils_Language.as(this.element,
Element);
  this.positioner.style.display = 'block';
  this.element['flexjs_wrapper'] = this;
  return this.positioner;
};


/**
 * @expose
 */
org_apache_flex_core_UIBase.prototype.addedToParent = function() {
};


/**
 * @expose
 * @param {org_apache_flex_core_IBead} bead
 * @override
 */
org_apache_flex_core_UIBase.prototype.addBead = function(bead) {
  if (!this.beads_) {
    this.beads_ = [];
  }
  this.beads_.push(bead);
  if (org_apache_flex_utils_Language.is(bead,
org_apache_flex_core_IBeadModel))
    this.model_ = bead;
  if (org_apache_flex_utils_Language.is(bead,
org_apache_flex_core_IBeadView)) {
    this.dispatchEvent(new org_apache_flex_events_Event('viewChanged'));
  }
  bead.strand = this;
};


/**
 * @expose
 * @param {Object} classOrInterface
 * @return {org_apache_flex_core_IBead}
 */
org_apache_flex_core_UIBase.prototype.getBeadByType =
function(classOrInterface) {
  return null;
};


/**
 * @expose
 * @param {org_apache_flex_core_IBead} bead
 * @return {org_apache_flex_core_IBead}
 */
org_apache_flex_core_UIBase.prototype.removeBead = function(bead) {
  return null;
};


Object.defineProperties(org_apache_flex_core_UIBase.prototype, /** @lends
{org_apache_flex_core_UIBase.prototype} */ {
/** @expose */
height: {
get: /** @this {org_apache_flex_core_UIBase} */ function() {
  return 0;
},
set: /** @this {org_apache_flex_core_UIBase} */ function(value) {
}},
/** @expose */
visible: {
get: /** @this {org_apache_flex_core_UIBase} */ function() {
  return false;
},
set: /** @this {org_apache_flex_core_UIBase} */ function(value) {
}},
/** @expose */
width: {
get: /** @this {org_apache_flex_core_UIBase} */ function() {
  return 0;
},
set: /** @this {org_apache_flex_core_UIBase} */ function(value) {
}},
/** @expose */
alpha: {
get: /** @this {org_apache_flex_core_UIBase} */ function() {
  return 0;
},
set: /** @this {org_apache_flex_core_UIBase} */ function(value) {
}},
/** @expose */
topMostEventDispatcher: {
get: /** @this {org_apache_flex_core_UIBase} */ function() {
  return null;
}},
/** @expose */
clientWidth: {
get: /** @this {org_apache_flex_core_UIBase} */ function() {
  return 0;
}},
/** @expose */
y: {
get: /** @this {org_apache_flex_core_UIBase} */ function() {
  return 0;
},
set: /** @this {org_apache_flex_core_UIBase} */ function(value) {
}},
/** @expose */
clientHeight: {
get: /** @this {org_apache_flex_core_UIBase} */ function() {
  return 0;
}},
/** @expose */
x: {
get: /** @this {org_apache_flex_core_UIBase} */ function() {
  return 0;
},
set: /** @this {org_apache_flex_core_UIBase} */ function(value) {
}}}
);


/**
 * Metadata
 *
 * @type {Object.<string, Array.<Object>>}
 */
org_apache_flex_core_UIBase.prototype.FLEXJS_CLASS_INFO = { names: [{ name:
'UIBase', qName: 'org_apache_flex_core_UIBase'}], interfaces:
[org_apache_flex_core_IUIBase] };

Re: [FalconJX] FlexJS as to js work

Posted by Erik de Bruin <er...@ixsoftware.nl>.
>
> On 6/2/15, 11:45 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>
> >I think the best solution, 'goog' safe, would be to define the field on
> >the
> >prototype (with all the proper JSDoc annotations) and then initialize it
> >in
> >the constructor.
>
> Works for me as well.  Can you confirm that Google Closure doesn’t really
> care?  I feel like I got bit by  the Linter wanting @private jsdoc to have
> a variable name that ends with “_” if it was on the prototype, or some
> silly rule like that.  But on the other hand, we won’t be linting the
> output.  But I don’t want it to fool Google Closure Compiler.
>

The linter - which is from Google as well - is just enforcing a coding
convention. The underscore is not needed to 'declare' a field private. The
JSDoc annotation does that.

You can add an argument to the linter telling it to ignore the missing
underscore.

EdB



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.

On 6/2/15, 11:45 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:

>I think the best solution, 'goog' safe, would be to define the field on
>the
>prototype (with all the proper JSDoc annotations) and then initialize it
>in
>the constructor.

Works for me as well.  Can you confirm that Google Closure doesn’t really
care?  I feel like I got bit by  the Linter wanting @private jsdoc to have
a variable name that ends with “_” if it was on the prototype, or some
silly rule like that.  But on the other hand, we won’t be linting the
output.  But I don’t want it to fool Google Closure Compiler.

-Alex


Re: [FalconJX] FlexJS as to js work

Posted by Erik de Bruin <er...@ixsoftware.nl>.
I think the best solution, 'goog' safe, would be to define the field on the
prototype (with all the proper JSDoc annotations) and then initialize it in
the constructor.

EdB



On Tue, Jun 2, 2015 at 8:42 PM, Alex Harui <ah...@adobe.com> wrote:

> OK, thanks for verifying.  And I think in AS, the array is not shared.
>
> So I think Mike has two choices:
> 1) initialize everything in the constructor
> 2) be smart about what can be initialized in the constructor vs the
> prototype.
>
> I’ll leave it up to Mike to decide.  We can always be smarter later.
>
> -Alex
>
> On 6/2/15, 11:36 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>
> >> Then all instances share the one array...
> >>>
> >>
> >> That sounds not right. I'll have to do some experimenting to disprove
> >> that, but it just doesn't ring true.
> >>
> >
> >Oh. Well, I guess you learn every day :-) A quick 'JSFiddle' shows that
> >they indeed seem to share the same array :-(
> >
> >No more time to look into this, I'm afraid. But point taken, this needs to
> >be addressed.
> >
> >EdB
> >
> >
> >
> >--
> >Ix Multimedia Software
> >
> >Jan Luykenstraat 27
> >3521 VB Utrecht
> >
> >T. 06-51952295
> >I. www.ixsoftware.nl
>
>


-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
On Tue, Jun 2, 2015 at 2:42 PM, Alex Harui <ah...@adobe.com> wrote:

> OK, thanks for verifying.  And I think in AS, the array is not shared.
>
> So I think Mike has two choices:
> 1) initialize everything in the constructor
> 2) be smart about what can be initialized in the constructor vs the
> prototype.
>
> I’ll leave it up to Mike to decide.  We can always be smarter later.
>

I think this in some incarnation will do. :) (from the other compiler...)


protected void emitConstructorFieldInitializers(
        IFunctionDefinition definition)
{
    IClassDefinition type = (IClassDefinition) definition
            .getAncestorOfType(IClassDefinition.class);
    // emit public fields init values
    List<IVariableDefinition> fields = DefinitionUtils.getFields(type,
            false);

    //final int len = fields.size();
    //int i = 0;
    for (IVariableDefinition field : fields)
    {
        IMetaTag tag = field.getMetaTagByName("Embed");
        if (tag != null)
        {
            emitEmbed(field);
            writeNewline(";");
            continue;
        }
        if (field instanceof IAccessorDefinition)
            continue;
        // constants do not get initialized
        if (field instanceof IConstantDefinition)
            continue;
        if (DefinitionUtils.isVariableAParameter(field,
                definition.getParameters()))
            continue;
        write("this.");
        write(field.getBaseName());
        write(" = ");

        String value = DefinitionUtils.returnInitialVariableValue(
                (IVariableNode) field.getNode(), getEmitter());

        write(value);
        //if (i < len - 1)
        writeNewline(";");
        //else
        //     write(";");
    }
}

Mike




>
> -Alex
>
> On 6/2/15, 11:36 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>
> >> Then all instances share the one array...
> >>>
> >>
> >> That sounds not right. I'll have to do some experimenting to disprove
> >> that, but it just doesn't ring true.
> >>
> >
> >Oh. Well, I guess you learn every day :-) A quick 'JSFiddle' shows that
> >they indeed seem to share the same array :-(
> >
> >No more time to look into this, I'm afraid. But point taken, this needs to
> >be addressed.
> >
> >EdB
> >
> >
> >
> >--
> >Ix Multimedia Software
> >
> >Jan Luykenstraat 27
> >3521 VB Utrecht
> >
> >T. 06-51952295
> >I. www.ixsoftware.nl
>
>

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.
OK, thanks for verifying.  And I think in AS, the array is not shared.

So I think Mike has two choices:
1) initialize everything in the constructor
2) be smart about what can be initialized in the constructor vs the
prototype.

I’ll leave it up to Mike to decide.  We can always be smarter later.

-Alex

On 6/2/15, 11:36 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:

>> Then all instances share the one array...
>>>
>>
>> That sounds not right. I'll have to do some experimenting to disprove
>> that, but it just doesn't ring true.
>>
>
>Oh. Well, I guess you learn every day :-) A quick 'JSFiddle' shows that
>they indeed seem to share the same array :-(
>
>No more time to look into this, I'm afraid. But point taken, this needs to
>be addressed.
>
>EdB
>
>
>
>-- 
>Ix Multimedia Software
>
>Jan Luykenstraat 27
>3521 VB Utrecht
>
>T. 06-51952295
>I. www.ixsoftware.nl


Re: [FalconJX] FlexJS as to js work

Posted by Erik de Bruin <er...@ixsoftware.nl>.
> Then all instances share the one array...
>>
>
> That sounds not right. I'll have to do some experimenting to disprove
> that, but it just doesn't ring true.
>

Oh. Well, I guess you learn every day :-) A quick 'JSFiddle' shows that
they indeed seem to share the same array :-(

No more time to look into this, I'm afraid. But point taken, this needs to
be addressed.

EdB



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.

On 6/2/15, 11:25 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:

>>
>> We’ll have to see if Erik or others with more JS and Goog experience can
>> answer that.  IIRC, in just vanilla JS, a private member would be on the
>> prototype and some other thing like an annotation would try to keep
>>people
>> from using it outside the class via some compile-time checking.
>>However,
>> this fails in surprising ways for any members whose initial values are
>>not
>> scalars.  For example:
>>
>>   private var children:Array = [];
>>
>> If this becomes
>>
>> /**
>>  * @private
>>  */
>> MyClass.prototype.children = [];
>>
>> Then all instances share the one array...
>>
>
>That sounds not right. I'll have to do some experimenting to disprove
>that,
>but it just doesn't ring true.

Yes, someone please verify.  Pretty sure I got burned on this way back in
AS2, and JS could do something different, but I don’t know when the JS
runtime could instantiate another array.

The test, IIRC, is:

public class Foo
{
  public var bar:Array = [];
}

var one:Foo = new Foo();
var two:Foo = new Foo();
one.bar.push(“test”);
trace(two.bar.length);  // should be 0

If the JS is:

Foo = function() {}

Foo.prototype.bar = [];

Then:
one = new Foo();
two = new Foo();
one.bar.push(“test”);
alert(two.bar.length); // I think this will be 1

-Alex



Re: [FalconJX] FlexJS as to js work

Posted by Erik de Bruin <er...@ixsoftware.nl>.
>
> We’ll have to see if Erik or others with more JS and Goog experience can
> answer that.  IIRC, in just vanilla JS, a private member would be on the
> prototype and some other thing like an annotation would try to keep people
> from using it outside the class via some compile-time checking.  However,
> this fails in surprising ways for any members whose initial values are not
> scalars.  For example:
>
>   private var children:Array = [];
>
> If this becomes
>
> /**
>  * @private
>  */
> MyClass.prototype.children = [];
>
> Then all instances share the one array...
>

That sounds not right. I'll have to do some experimenting to disprove that,
but it just doesn't ring true.

EdB



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

RE: [FalconJX] FlexJS as to js work

Posted by Frédéric THOMAS <we...@hotmail.com>.
> A SWC usually doesn’t contain its source code.

- Example of what it "decompiles" when it hasn't got the source code:

public class mx.core.ByteArrayAsset extends flash.utils.ByteArray
  implements mx.core.IFlexAsset
{
  native public function ByteArrayAsset():*;

  static native mx_internal const VERSION:String = "3.0.0.0";
  static native private const mx_internal:* = "http://www.adobe.com/2006/flex/mx/internal";
}

> I would assume IJ also has some click-to-open capability.  Can you specify
> more than one folder or does it have some smarter lookup algorithm?

Yes you can.

I could be wrong but my guess is it scans all the lib (the lib could be one SWC or a folder containing SWCs + sources) children's folders for the sources and maybe tries to match what it has been able to "decompile", while debugging, it uses the FDB commands to know where it is.

Frédéric THOMAS

> From: aharui@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FalconJX] FlexJS as to js work
> Date: Tue, 2 Jun 2015 23:11:46 +0000
> 
> 
> 
> On 6/2/15, 2:59 PM, "Frédéric THOMAS" <we...@hotmail.com> wrote:
> 
> >>Anyway, do you happen to know how IJ associates source with SWCs for
> >> debugging?  FB would rather we put #1 and #3 in the same source folder,
> >> but that makes describing what gets cross-compiled to JS more difficult.
> >> We could make COMPJSC smarter and ignore files with some directive in it
> >> so folks don’t need to keep adding to a list of files when adding new
> >> files.
> >
> >I would be happy to anwser but I'm not sure I understood the question.
> >If you add a SDK, SWC or a folder with SWCs and sources, it will scan and
> >detect swc and sources, for example, for the FlexJS folder imported as a
> >lib, it detects AS and ASJS for each swc, you can manualy add some source
> >folders for any of the SWCs.
> >
> >When it comes to debug, I guess it asks FDB for the source file, it the
> >file is not referenced, it will show a native representation where you
> >can still associate sources.
> >
> >Is that what you want to know ?
> 
> A SWC usually doesn’t contain its source code.  But for many 3rd party
> SWCs and for FlexJS swcs, the source code is available as part of the
> download.
> 
> In Flash Builder, with only the library-path pointing to the SWC and no
> other reference to the source files other than the debugfile opcodes in
> the library.swf, when I am in the editor, I can command-click or
> control-click on, for example:
> 
> 	<js:TextButton />
> 
> And FB will try to open an editor with the source for that file.  FB is
> hard-coded to know how to find the sources for the SWCs in the sdks it
> ships with, but for everything else it asks you to supply a
> source-attachment for the SWC, which you supply via Project/Properties.
> The problem is, for FlexJS, you can only specify the src/as or src/asjs
> folders so sometimes click-to-open doesn’t work.
> 
> I would assume IJ also has some click-to-open capability.  Can you specify
> more than one folder or does it have some smarter lookup algorithm?
> 
> Thanks,
> -Alex		  
> 
 		 	   		  

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.
Yeah, I think many of us wish we could build a portfolio of products that
we could sell many times, but FOSS and technology in general is making
many things free or so cheap that a lot of folks have to give up on
selling products and turn to selling services, supplies or accessories
instead.  And selling services often means a lot more work than selling
the 100th copy of a product.

So the potential pay off for you for FlexJS, if you’re Android apps don’t
work out, is to lower the cost of creating other products for your store,
or to sell yourself as the expert on helping some of these folks migrate
their code bases, or other folks to create new products.  You may not have
to actually work tons of hours writing the code as much as doing
high-level overviews and troubleshooting the hard problems.  I am
personally going to try to avoid owning any large code bases.

Also, AIUI, the Apache Way allows for some company to come and bribe you
to implement some feature or bug fix they want in FlexJS so the more you
prove yourself as the guy who can make a difference, the more attractive
you are.  Until you showed up again, if some future customer found that
there was a problem in the compiler, they would have to negotiate with me
to get it fixed.  Now if you have the cycles, I can direct them to you.

IMO, it is also part of the Apache Way that you get going on something and
then run out of time, either forever, or for a while.  Because it is all
in the open, other folks can pick it up.  You’ve already sort of seen that
once just in your coming back into this project.

So, do what you can.  For me, anything you can do helps.  But I would
think about the payoff in terms of selling consulting services more than
products unless FlexJS can help you build those products.

-Alex

On 6/3/15, 8:37 AM, "Michael Schmalle" <te...@gmail.com> wrote:

>I am just being devils advocate with my own mind.
>
>I really don't have interest in talking about language features. :)
>
>You have to realize, from my end, it's a black box with "all these
>companies". I mean I only have so much time and there is a fine line that
>I
>can give of my time for free to let others make money migrating things.
>
>I like working with compilers, that is obvious but then again, in about 2
>months my life is going to change because I am going out on Android with a
>bunch of applications I will have to support. With that, I don't want to
>create to many fires that I might now be able to stoke.
>
>I never even really made money from app dev, all my income came from
>selling UI components. So I was never in the industry of maintaining a
>large code base.
>
>You probably can see I am wrestling with myself of how far I can go with
>helping, since I still don't have something in the next 4 months based of
>this work that would translate to something else, like food. :)
>
>Anyway, it's more just me trying no to bite of to much. There is a lot of
>work to get the existing as -> js working in FlexJS and all the other
>stuff
>that needs to be done for something like Josh's idea.
>
>Mike
>
>
>
>
>On Wed, Jun 3, 2015 at 11:22 AM, Alex Harui <ah...@adobe.com> wrote:
>
>>
>>
>> On 6/3/15, 8:04 AM, "Michael Schmalle" <te...@gmail.com>
>>wrote:
>>
>> >No I just meant there will never be an AS4.(generics, first class
>> >metadata,
>> >method overloading types, things other languages are getting, just
>>look at
>> >Java8). They kewn they had to give an option of lambda functions
>>because
>> >sometimes Java is just to verbose to do simple things, AS3 can be
>>looked
>> >at
>> >that way with some things as well(compared to rapid fire javascript).
>>
>> IMO, AS4 was a whole new language.  I might be missing something, but
>> every time I see “let” I think back to BASIC, not forward.
>>
>> If you think FlexJS needs generics and method overloading to even have a
>> chance, well, then if you are right then the uphill is very steep, but I
>> don’t think that is the case.  And if FlexJS can be come popular without
>> these things, then folks with skills will show up to help make it happen
>> unless their implementation is somehow blocked by the VM’s verifier, and
>> that’s only true if folks require the SWF verification step.  Right now,
>> everyone writing JS apps is living with compile-time verification, why
>> can’t we at least to the same?
>>
>> We don’t need to store metadata in a trait.  If we can stick it on the
>>JS
>> class, we can stick it on an AS class.
>>
>> C++ (at least, the MS compiler several years ago) used decorated names
>>for
>> method overloading.  I keep thinking that should work for AS as well
>>until
>> you start calling things with [bracket] syntax.  But maybe that is good
>> enough.
>>
>> Feel free to fork threads to discuss implementation pros and cons on AS
>> language enhancements.
>>
>> And as I said elsewhere, the big money for FlexJS may be in the
>>migration
>> of existing code bases.  Even if we never get as big as TS, there seems
>>to
>> be enough existing AS code bases to keep our committers nice and busy
>> helping folks migrate off of Flash until we’re old and gray (oh, wait,
>>I’m
>> sort of old and gray already).
>>
>> -Alex
>>
>>


Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
I am just being devils advocate with my own mind.

I really don't have interest in talking about language features. :)

You have to realize, from my end, it's a black box with "all these
companies". I mean I only have so much time and there is a fine line that I
can give of my time for free to let others make money migrating things.

I like working with compilers, that is obvious but then again, in about 2
months my life is going to change because I am going out on Android with a
bunch of applications I will have to support. With that, I don't want to
create to many fires that I might now be able to stoke.

I never even really made money from app dev, all my income came from
selling UI components. So I was never in the industry of maintaining a
large code base.

You probably can see I am wrestling with myself of how far I can go with
helping, since I still don't have something in the next 4 months based of
this work that would translate to something else, like food. :)

Anyway, it's more just me trying no to bite of to much. There is a lot of
work to get the existing as -> js working in FlexJS and all the other stuff
that needs to be done for something like Josh's idea.

Mike




On Wed, Jun 3, 2015 at 11:22 AM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 6/3/15, 8:04 AM, "Michael Schmalle" <te...@gmail.com> wrote:
>
> >No I just meant there will never be an AS4.(generics, first class
> >metadata,
> >method overloading types, things other languages are getting, just look at
> >Java8). They kewn they had to give an option of lambda functions because
> >sometimes Java is just to verbose to do simple things, AS3 can be looked
> >at
> >that way with some things as well(compared to rapid fire javascript).
>
> IMO, AS4 was a whole new language.  I might be missing something, but
> every time I see “let” I think back to BASIC, not forward.
>
> If you think FlexJS needs generics and method overloading to even have a
> chance, well, then if you are right then the uphill is very steep, but I
> don’t think that is the case.  And if FlexJS can be come popular without
> these things, then folks with skills will show up to help make it happen
> unless their implementation is somehow blocked by the VM’s verifier, and
> that’s only true if folks require the SWF verification step.  Right now,
> everyone writing JS apps is living with compile-time verification, why
> can’t we at least to the same?
>
> We don’t need to store metadata in a trait.  If we can stick it on the JS
> class, we can stick it on an AS class.
>
> C++ (at least, the MS compiler several years ago) used decorated names for
> method overloading.  I keep thinking that should work for AS as well until
> you start calling things with [bracket] syntax.  But maybe that is good
> enough.
>
> Feel free to fork threads to discuss implementation pros and cons on AS
> language enhancements.
>
> And as I said elsewhere, the big money for FlexJS may be in the migration
> of existing code bases.  Even if we never get as big as TS, there seems to
> be enough existing AS code bases to keep our committers nice and busy
> helping folks migrate off of Flash until we’re old and gray (oh, wait, I’m
> sort of old and gray already).
>
> -Alex
>
>

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.

On 6/3/15, 8:04 AM, "Michael Schmalle" <te...@gmail.com> wrote:

>No I just meant there will never be an AS4.(generics, first class
>metadata,
>method overloading types, things other languages are getting, just look at
>Java8). They kewn they had to give an option of lambda functions because
>sometimes Java is just to verbose to do simple things, AS3 can be looked
>at
>that way with some things as well(compared to rapid fire javascript).

IMO, AS4 was a whole new language.  I might be missing something, but
every time I see “let” I think back to BASIC, not forward.

If you think FlexJS needs generics and method overloading to even have a
chance, well, then if you are right then the uphill is very steep, but I
don’t think that is the case.  And if FlexJS can be come popular without
these things, then folks with skills will show up to help make it happen
unless their implementation is somehow blocked by the VM’s verifier, and
that’s only true if folks require the SWF verification step.  Right now,
everyone writing JS apps is living with compile-time verification, why
can’t we at least to the same?

We don’t need to store metadata in a trait.  If we can stick it on the JS
class, we can stick it on an AS class.

C++ (at least, the MS compiler several years ago) used decorated names for
method overloading.  I keep thinking that should work for AS as well until
you start calling things with [bracket] syntax.  But maybe that is good
enough.

Feel free to fork threads to discuss implementation pros and cons on AS
language enhancements.

And as I said elsewhere, the big money for FlexJS may be in the migration
of existing code bases.  Even if we never get as big as TS, there seems to
be enough existing AS code bases to keep our committers nice and busy
helping folks migrate off of Flash until we’re old and gray (oh, wait, I’m
sort of old and gray already).

-Alex


Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
No I just meant there will never be an AS4.(generics, first class metadata,
method overloading types, things other languages are getting, just look at
Java8). They kewn they had to give an option of lambda functions because
sometimes Java is just to verbose to do simple things, AS3 can be looked at
that way with some things as well(compared to rapid fire javascript).

Mike

On Wed, Jun 3, 2015 at 10:49 AM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 6/3/15, 3:03 AM, "Michael Schmalle" <te...@gmail.com> wrote:
>
> >On Tue, Jun 2, 2015 at 8:44 PM, Frédéric THOMAS <we...@hotmail.com>
> >wrote:
> >
> >> > >From my perspective FlexJS AND FalconJX(vanilla), specifically the
> >>AS3
> >> > >language has an up hill battle because, we are not evolving the
> >>language
> >> > >like TypeScript and such and all the other techs.
> >> >
> >> > Yeah, people like new, but Java is still being used in lots of places.
> >>
> >> Java is here since 1985 IIRC and has more than 3 people working on the
> >> compiler, it evolved a lot :-)
> >>
> >
> >
> >Well there are, it's called the forked ASC compiler. This is one part of
> >the project I have to bury my head in the sand or else I get kind of sad.
> >
> >I mean, what if we wanted to add a language feature to the AS3.g and
> >parser. We can't because it's tied to SWF generation.
> >
> >For me, this is the elephant in the room that never gets talked about.
> >Why?
> >Yeah, you need compiler engineers that get paid bank to work on it like
> >that from my perspective, it's not something I could do(SWF).
> >
> >If in any way we wanted to add/change the AST it would break everything
> >down the chain until it all was updated.
>
> I could be missing something, but doesn’t Apache Flex own the chain?  I
> suppose if the language feature you want requires a VM change then that
> would prove difficult, but I’ve always thought that C++ method overloading
> was possible via changes to code in our repos.
>
> -Alex
>
>

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.

On 6/3/15, 3:03 AM, "Michael Schmalle" <te...@gmail.com> wrote:

>On Tue, Jun 2, 2015 at 8:44 PM, Frédéric THOMAS <we...@hotmail.com>
>wrote:
>
>> > >From my perspective FlexJS AND FalconJX(vanilla), specifically the
>>AS3
>> > >language has an up hill battle because, we are not evolving the
>>language
>> > >like TypeScript and such and all the other techs.
>> >
>> > Yeah, people like new, but Java is still being used in lots of places.
>>
>> Java is here since 1985 IIRC and has more than 3 people working on the
>> compiler, it evolved a lot :-)
>>
>
>
>Well there are, it's called the forked ASC compiler. This is one part of
>the project I have to bury my head in the sand or else I get kind of sad.
>
>I mean, what if we wanted to add a language feature to the AS3.g and
>parser. We can't because it's tied to SWF generation.
>
>For me, this is the elephant in the room that never gets talked about.
>Why?
>Yeah, you need compiler engineers that get paid bank to work on it like
>that from my perspective, it's not something I could do(SWF).
>
>If in any way we wanted to add/change the AST it would break everything
>down the chain until it all was updated.

I could be missing something, but doesn’t Apache Flex own the chain?  I
suppose if the language feature you want requires a VM change then that
would prove difficult, but I’ve always thought that C++ method overloading
was possible via changes to code in our repos.

-Alex


Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
On Tue, Jun 2, 2015 at 8:44 PM, Frédéric THOMAS <we...@hotmail.com>
wrote:

> > >From my perspective FlexJS AND FalconJX(vanilla), specifically the AS3
> > >language has an up hill battle because, we are not evolving the language
> > >like TypeScript and such and all the other techs.
> >
> > Yeah, people like new, but Java is still being used in lots of places.
>
> Java is here since 1985 IIRC and has more than 3 people working on the
> compiler, it evolved a lot :-)
>


Well there are, it's called the forked ASC compiler. This is one part of
the project I have to bury my head in the sand or else I get kind of sad.

I mean, what if we wanted to add a language feature to the AS3.g and
parser. We can't because it's tied to SWF generation.

For me, this is the elephant in the room that never gets talked about. Why?
Yeah, you need compiler engineers that get paid bank to work on it like
that from my perspective, it's not something I could do(SWF).

If in any way we wanted to add/change the AST it would break everything
down the chain until it all was updated.

Mike



>
> Frédéric THOMAS
>
> > From: aharui@adobe.com
> > To: dev@flex.apache.org
> > Subject: Re: [FalconJX] FlexJS as to js work
> > Date: Wed, 3 Jun 2015 00:37:08 +0000
> >
> >
> >
> > On 6/2/15, 4:48 PM, "Michael Schmalle" <te...@gmail.com>
> wrote:
> >
> > >> I wish we could get more help from them.
> > >
> > >Sad but I am sure a true fact, companies go after the market share and I
> > >don't think IJ takes FlexJS seriously. I am a man of honesty and that is
> > >the way I see it.
> >
> > True.  But often, selling upgrades to the installed base is a good
> revenue
> > source.
> >
> > >
> > >From my perspective FlexJS AND FalconJX(vanilla), specifically the AS3
> > >language has an up hill battle because, we are not evolving the language
> > >like TypeScript and such and all the other techs.
> >
> > Yeah, people like new, but Java is still being used in lots of places.
> >
> > -Alex
> >
>
>

RE: [FalconJX] FlexJS as to js work

Posted by Frédéric THOMAS <we...@hotmail.com>.
> >From my perspective FlexJS AND FalconJX(vanilla), specifically the AS3
> >language has an up hill battle because, we are not evolving the language
> >like TypeScript and such and all the other techs.
> 
> Yeah, people like new, but Java is still being used in lots of places.

Java is here since 1985 IIRC and has more than 3 people working on the compiler, it evolved a lot :-)

Frédéric THOMAS

> From: aharui@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FalconJX] FlexJS as to js work
> Date: Wed, 3 Jun 2015 00:37:08 +0000
> 
> 
> 
> On 6/2/15, 4:48 PM, "Michael Schmalle" <te...@gmail.com> wrote:
> 
> >> I wish we could get more help from them.
> >
> >Sad but I am sure a true fact, companies go after the market share and I
> >don't think IJ takes FlexJS seriously. I am a man of honesty and that is
> >the way I see it.
> 
> True.  But often, selling upgrades to the installed base is a good revenue
> source.
> 
> >
> >From my perspective FlexJS AND FalconJX(vanilla), specifically the AS3
> >language has an up hill battle because, we are not evolving the language
> >like TypeScript and such and all the other techs.
> 
> Yeah, people like new, but Java is still being used in lots of places.
> 
> -Alex
> 
 		 	   		  

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.

On 6/2/15, 4:48 PM, "Michael Schmalle" <te...@gmail.com> wrote:

>> I wish we could get more help from them.
>
>Sad but I am sure a true fact, companies go after the market share and I
>don't think IJ takes FlexJS seriously. I am a man of honesty and that is
>the way I see it.

True.  But often, selling upgrades to the installed base is a good revenue
source.

>
>From my perspective FlexJS AND FalconJX(vanilla), specifically the AS3
>language has an up hill battle because, we are not evolving the language
>like TypeScript and such and all the other techs.

Yeah, people like new, but Java is still being used in lots of places.

-Alex


Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
> I wish we could get more help from them.

Sad but I am sure a true fact, companies go after the market share and I
don't think IJ takes FlexJS seriously. I am a man of honesty and that is
the way I see it.

I have had a couple people ask me why I am bothering with an out dated
tech. I just laugh and say, I could just watch TV then(with my hobby time)
right and get stupid...

>From my perspective FlexJS AND FalconJX(vanilla), specifically the AS3
language has an up hill battle because, we are not evolving the language
like TypeScript and such and all the other techs.

We have to prove that AS3 is a valid mature language that it's power comes
from it's tooling. Once we do that, who knows maybe we get funding to add
new language spec to the compiler. :)

Mike





On Tue, Jun 2, 2015 at 7:43 PM, Alex Harui <ah...@adobe.com> wrote:

> I like doing Java work in Eclipse but I’d use any IDE if we needed to
> standardize on one.  I’m trying to get FlexJS to work in FB because I
> think a lot of people have it.  I’m told that getting Eclipse to support
> AS is difficult.
>
> I’m open to making changes to the way we package FlexJS to make the other
> IDE makers happy (IJ, FDT, FlashDevelop).  I’m guessing IJ has the second
> largest base of Flex users.  I wish we could get more help from them.
>
> -Alex
>
> On 6/2/15, 4:34 PM, "Michael Schmalle" <te...@gmail.com> wrote:
>
> >BTW, I used to be a DIE HARD Eclipse guy, slowly I got pissed off enough
> >during Android and gradel dev the last two years I finally laid down my
> >sword for Eclipse. Once I learned the new key shortcuts I never looked
> >back.
> >
> >Ironically, now all the compiler work I am doing is in freakin Eclipse!
> >
> >Mike
> >
> >On Tue, Jun 2, 2015 at 7:32 PM, Michael Schmalle
> ><te...@gmail.com>
> >wrote:
> >
> >> Well, I only have 4.6 so I can say for sure either. IJ rocks for AS and
> >>JS
> >> dev, truly it does... :)
> >>
> >> On Tue, Jun 2, 2015 at 7:29 PM, Alex Harui <ah...@adobe.com> wrote:
> >>
> >>>
> >>>
> >>> On 6/2/15, 4:26 PM, "Michael Schmalle" <te...@gmail.com>
> >>>wrote:
> >>>
> >>> >Yes, you can specify more than one, it has a completely different
> >>>setup
> >>> >and
> >>> >you can add folders as just library source, not raw source. I did that
> >>> >when
> >>> >I initially setup FlexJS in IJ for "dev". I added all the src/as js/
> >>>asjs
> >>> >and it resolves all of them no problem in the same root.
> >>> >
> >>> >I assume you are saying FB can't do this?
> >>>
> >>> Well, I haven’t tried any list delimiters, or a higher up root, but it
> >>> seems to only take one path.
> >>>
> >>> -Alex
> >>>
> >>>
> >>
>
>

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.
I like doing Java work in Eclipse but I’d use any IDE if we needed to
standardize on one.  I’m trying to get FlexJS to work in FB because I
think a lot of people have it.  I’m told that getting Eclipse to support
AS is difficult.

I’m open to making changes to the way we package FlexJS to make the other
IDE makers happy (IJ, FDT, FlashDevelop).  I’m guessing IJ has the second
largest base of Flex users.  I wish we could get more help from them.

-Alex

On 6/2/15, 4:34 PM, "Michael Schmalle" <te...@gmail.com> wrote:

>BTW, I used to be a DIE HARD Eclipse guy, slowly I got pissed off enough
>during Android and gradel dev the last two years I finally laid down my
>sword for Eclipse. Once I learned the new key shortcuts I never looked
>back.
>
>Ironically, now all the compiler work I am doing is in freakin Eclipse!
>
>Mike
>
>On Tue, Jun 2, 2015 at 7:32 PM, Michael Schmalle
><te...@gmail.com>
>wrote:
>
>> Well, I only have 4.6 so I can say for sure either. IJ rocks for AS and
>>JS
>> dev, truly it does... :)
>>
>> On Tue, Jun 2, 2015 at 7:29 PM, Alex Harui <ah...@adobe.com> wrote:
>>
>>>
>>>
>>> On 6/2/15, 4:26 PM, "Michael Schmalle" <te...@gmail.com>
>>>wrote:
>>>
>>> >Yes, you can specify more than one, it has a completely different
>>>setup
>>> >and
>>> >you can add folders as just library source, not raw source. I did that
>>> >when
>>> >I initially setup FlexJS in IJ for "dev". I added all the src/as js/
>>>asjs
>>> >and it resolves all of them no problem in the same root.
>>> >
>>> >I assume you are saying FB can't do this?
>>>
>>> Well, I haven’t tried any list delimiters, or a higher up root, but it
>>> seems to only take one path.
>>>
>>> -Alex
>>>
>>>
>>


Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
BTW, I used to be a DIE HARD Eclipse guy, slowly I got pissed off enough
during Android and gradel dev the last two years I finally laid down my
sword for Eclipse. Once I learned the new key shortcuts I never looked back.

Ironically, now all the compiler work I am doing is in freakin Eclipse!

Mike

On Tue, Jun 2, 2015 at 7:32 PM, Michael Schmalle <te...@gmail.com>
wrote:

> Well, I only have 4.6 so I can say for sure either. IJ rocks for AS and JS
> dev, truly it does... :)
>
> On Tue, Jun 2, 2015 at 7:29 PM, Alex Harui <ah...@adobe.com> wrote:
>
>>
>>
>> On 6/2/15, 4:26 PM, "Michael Schmalle" <te...@gmail.com> wrote:
>>
>> >Yes, you can specify more than one, it has a completely different setup
>> >and
>> >you can add folders as just library source, not raw source. I did that
>> >when
>> >I initially setup FlexJS in IJ for "dev". I added all the src/as js/ asjs
>> >and it resolves all of them no problem in the same root.
>> >
>> >I assume you are saying FB can't do this?
>>
>> Well, I haven’t tried any list delimiters, or a higher up root, but it
>> seems to only take one path.
>>
>> -Alex
>>
>>
>

Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
Well, I only have 4.6 so I can say for sure either. IJ rocks for AS and JS
dev, truly it does... :)

On Tue, Jun 2, 2015 at 7:29 PM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 6/2/15, 4:26 PM, "Michael Schmalle" <te...@gmail.com> wrote:
>
> >Yes, you can specify more than one, it has a completely different setup
> >and
> >you can add folders as just library source, not raw source. I did that
> >when
> >I initially setup FlexJS in IJ for "dev". I added all the src/as js/ asjs
> >and it resolves all of them no problem in the same root.
> >
> >I assume you are saying FB can't do this?
>
> Well, I haven’t tried any list delimiters, or a higher up root, but it
> seems to only take one path.
>
> -Alex
>
>

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.

On 6/2/15, 4:26 PM, "Michael Schmalle" <te...@gmail.com> wrote:

>Yes, you can specify more than one, it has a completely different setup
>and
>you can add folders as just library source, not raw source. I did that
>when
>I initially setup FlexJS in IJ for "dev". I added all the src/as js/ asjs
>and it resolves all of them no problem in the same root.
>
>I assume you are saying FB can't do this?

Well, I haven’t tried any list delimiters, or a higher up root, but it
seems to only take one path.

-Alex


Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
Yes, you can specify more than one, it has a completely different setup and
you can add folders as just library source, not raw source. I did that when
I initially setup FlexJS in IJ for "dev". I added all the src/as js/ asjs
and it resolves all of them no problem in the same root.

I assume you are saying FB can't do this?

Mike

On Tue, Jun 2, 2015 at 7:11 PM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 6/2/15, 2:59 PM, "Frédéric THOMAS" <we...@hotmail.com> wrote:
>
> >>Anyway, do you happen to know how IJ associates source with SWCs for
> >> debugging?  FB would rather we put #1 and #3 in the same source folder,
> >> but that makes describing what gets cross-compiled to JS more difficult.
> >> We could make COMPJSC smarter and ignore files with some directive in it
> >> so folks don’t need to keep adding to a list of files when adding new
> >> files.
> >
> >I would be happy to anwser but I'm not sure I understood the question.
> >If you add a SDK, SWC or a folder with SWCs and sources, it will scan and
> >detect swc and sources, for example, for the FlexJS folder imported as a
> >lib, it detects AS and ASJS for each swc, you can manualy add some source
> >folders for any of the SWCs.
> >
> >When it comes to debug, I guess it asks FDB for the source file, it the
> >file is not referenced, it will show a native representation where you
> >can still associate sources.
> >
> >Is that what you want to know ?
>
> A SWC usually doesn’t contain its source code.  But for many 3rd party
> SWCs and for FlexJS swcs, the source code is available as part of the
> download.
>
> In Flash Builder, with only the library-path pointing to the SWC and no
> other reference to the source files other than the debugfile opcodes in
> the library.swf, when I am in the editor, I can command-click or
> control-click on, for example:
>
>         <js:TextButton />
>
> And FB will try to open an editor with the source for that file.  FB is
> hard-coded to know how to find the sources for the SWCs in the sdks it
> ships with, but for everything else it asks you to supply a
> source-attachment for the SWC, which you supply via Project/Properties.
> The problem is, for FlexJS, you can only specify the src/as or src/asjs
> folders so sometimes click-to-open doesn’t work.
>
> I would assume IJ also has some click-to-open capability.  Can you specify
> more than one folder or does it have some smarter lookup algorithm?
>
> Thanks,
> -Alex
>
>

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.

On 6/2/15, 2:59 PM, "Frédéric THOMAS" <we...@hotmail.com> wrote:

>>Anyway, do you happen to know how IJ associates source with SWCs for
>> debugging?  FB would rather we put #1 and #3 in the same source folder,
>> but that makes describing what gets cross-compiled to JS more difficult.
>> We could make COMPJSC smarter and ignore files with some directive in it
>> so folks don’t need to keep adding to a list of files when adding new
>> files.
>
>I would be happy to anwser but I'm not sure I understood the question.
>If you add a SDK, SWC or a folder with SWCs and sources, it will scan and
>detect swc and sources, for example, for the FlexJS folder imported as a
>lib, it detects AS and ASJS for each swc, you can manualy add some source
>folders for any of the SWCs.
>
>When it comes to debug, I guess it asks FDB for the source file, it the
>file is not referenced, it will show a native representation where you
>can still associate sources.
>
>Is that what you want to know ?

A SWC usually doesn’t contain its source code.  But for many 3rd party
SWCs and for FlexJS swcs, the source code is available as part of the
download.

In Flash Builder, with only the library-path pointing to the SWC and no
other reference to the source files other than the debugfile opcodes in
the library.swf, when I am in the editor, I can command-click or
control-click on, for example:

	<js:TextButton />

And FB will try to open an editor with the source for that file.  FB is
hard-coded to know how to find the sources for the SWCs in the sdks it
ships with, but for everything else it asks you to supply a
source-attachment for the SWC, which you supply via Project/Properties.
The problem is, for FlexJS, you can only specify the src/as or src/asjs
folders so sometimes click-to-open doesn’t work.

I would assume IJ also has some click-to-open capability.  Can you specify
more than one folder or does it have some smarter lookup algorithm?

Thanks,
-Alex		  


RE: [FalconJX] FlexJS as to js work

Posted by Frédéric THOMAS <we...@hotmail.com>.
> You know, I went and moved everything into up to 3 folders (as, js, asjs),
> then found out that FB only supports one folder path per source attachment
> for a SWC.  So now, when debugging you sometimes have to switch source
> attachments from as to asjs.   So, I’m totally up for another folder
> restructuring.
> 
> So, not sure what files need to be yanked out and shared, but seems like
> we have 3 different classes of source files;
> 
> 1) AS for Flash
> 2) AS for JS
> 3) AS for both Flash and JS
> 
> I wonder if we need to plan ahead for any JS source for something we need
> to hack in that can’t be described in AS.
> 
> Anyway, do you happen to know how IJ associates source with SWCs for
> debugging?  FB would rather we put #1 and #3 in the same source folder,
> but that makes describing what gets cross-compiled to JS more difficult.
> We could make COMPJSC smarter and ignore files with some directive in it
> so folks don’t need to keep adding to a list of files when adding new
> files.

I would be happy to anwser but I'm not sure I understood the question.
If you add a SDK, SWC or a folder with SWCs and sources, it will scan and detect swc and sources, for example, for the FlexJS folder imported as a lib, it detects AS and ASJS for each swc, you can manualy add some source folders for any of the SWCs.

When it comes to debug, I guess it asks FDB for the source file, it the file is not referenced, it will show a native representation where you can still associate sources.

Is that what you want to know ?

Frédéric THOMAS

> From: aharui@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FalconJX] FlexJS as to js work
> Date: Tue, 2 Jun 2015 18:15:20 +0000
> 
> 
> 
> On 6/2/15, 10:38 AM, "Michael Schmalle" <te...@gmail.com> wrote:
> 
> >A couple questions;
> >
> >1. It doesn't look like you have private fields implemented to be emitted
> >in the constructor? private fileds are going to the prototype. For
> >instance;
> >
> >private var explicitWidth:Number = NaN;
> >
> >to
> >
> >/**
> >* @private
> >* @type {number}
> >*/
> >this.explicitWidth_ = NaN;
> >
> >Is this something that needs to happen, UIBase is what I am testing.
> 
> We’ll have to see if Erik or others with more JS and Goog experience can
> answer that.  IIRC, in just vanilla JS, a private member would be on the
> prototype and some other thing like an annotation would try to keep people
> from using it outside the class via some compile-time checking.  However,
> this fails in surprising ways for any members whose initial values are not
> scalars.  For example:
> 
>   private var children:Array = [];
> 
> If this becomes
> 
> /**
>  * @private
>  */
> MyClass.prototype.children = [];
>  
> Then all instances share the one array, which is undesirable.  So,
> initializing fields in the constructor can avoid that problem at the cost
> of running the init for scalars where it doesn’t matter.
> 
> What I don’t know is if Google Closure Compiler or Library has other
> expectations about jsdoc for private members and whether they can be on
> the prototype or not.  I think the Linter has busted me for trying to
> declare uninitialized private members in the constructor, but I could be
> wrong about that.  When I hit stuff like that I just give it an initial
> value and keep on going.
> 
> >
> >2. Running into problems with interfaces, if we use DOM,
> >HTMLElementWrapper.element needs to be Element not Object correct? If not,
> >you don't key code completion in the IDE.
> 
> There are probably lots of places where the jsdoc annotation is Object
> when it can be something more specific.  A lot of the jsdoc I did was
> early when I just needed to get the tools to stop complaining.  So feel
> free to tighten up the jsdoc and/or use a more specific type than Object.
> 
> >
> >3. flexjs_wrapper can't exist on Element, it's not dynamic, does it nee to
> >be dynamic or do we just use array access?
> >
> >this.element['flexjs_wrapper'] = this;
> 
> Ah yes, there are some places where we hack JS “classes”.  I’m open to
> ideas on what to do.  Can we subclass Element and add flexjs_wrapper?
> 
> >
> >4. For DOM elements and the closure compiler, does it expect type Element,
> >for instance is below correct?
> >
> >/**
> > * @expose
> > * @type {Element}
> > */
> >org_apache_flex_core_UIBase.prototype.positioner;
> 
> Not sure what you mean by “expect”, but the code snippet should work.
> 
> >
> >5. The API now needs to be yanked out of Core/as/src into another
> >directory
> >like Core/api/src, so the as Flash and as HTML ActionScript can share the
> >same interfaces, correct? What would be the plan?
> 
> You know, I went and moved everything into up to 3 folders (as, js, asjs),
> then found out that FB only supports one folder path per source attachment
> for a SWC.  So now, when debugging you sometimes have to switch source
> attachments from as to asjs.   So, I’m totally up for another folder
> restructuring.
> 
> So, not sure what files need to be yanked out and shared, but seems like
> we have 3 different classes of source files;
> 
> 1) AS for Flash
> 2) AS for JS
> 3) AS for both Flash and JS
> 
> I wonder if we need to plan ahead for any JS source for something we need
> to hack in that can’t be described in AS.
> 
> Anyway, do you happen to know how IJ associates source with SWCs for
> debugging?  FB would rather we put #1 and #3 in the same source folder,
> but that makes describing what gets cross-compiled to JS more difficult.
> We could make COMPJSC smarter and ignore files with some directive in it
> so folks don’t need to keep adding to a list of files when adding new
> files.
> 
> 
> >
> >Lots more but I thought I would start with this.
> >
> >So from my sketchy tests we have:
> 
> Freakin’ cool!  FWIW, I implemented a custom asdoc @ keyword that
> suppresses casting functions in the JS output.  Search for @flexjsignore.
> Kinda hacky but saves on some output code that doesn’t matter in the JS
> world.
> 
> -Alex
> 
 		 	   		  

Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
FYI, I spent quite a bit of time on this, now it's back to reality for
me(work). I put some JIRA issues for myself so I wouldn't forget stuff.

If you have anything else, add a JIRA issue in FalconJX component, I have a
filter for it.

Mike

On Tue, Jun 2, 2015 at 3:59 PM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 6/2/15, 12:06 PM, "Michael Schmalle" <te...@gmail.com> wrote:
>
> >On Tue, Jun 2, 2015 at 2:15 PM, Alex Harui <ah...@adobe.com> wrote:
> >
> >>
> >>
> >> On 6/2/15, 10:38 AM, "Michael Schmalle" <te...@gmail.com>
> >>wrote:
> >>>
> >> >3. flexjs_wrapper can't exist on Element, it's not dynamic, does it
> >>nee to
> >> >be dynamic or do we just use array access?
> >> >
> >> >this.element['flexjs_wrapper'] = this;
> >>
> >> Ah yes, there are some places where we hack JS “classes”.  I’m open to
> >> ideas on what to do.  Can we subclass Element and add flexjs_wrapper?
> >>
> >>
> >I don't think we want to do this, Element is on the DOM so when and
> >Element
> >is used it will need to be of type Element when it gets compiled.
> >
> >I was just thinking of a getting in the super class;
> >
> >protected function get wrapper():Object {
> >    return element['flexjs_wrapper'];
> >}
> >
> >What type is the wrapper, an Element? Still learning here.
> >
>
> The wrapper is a UIBase for UI Elements, but it is some non-UIBase for
> HTTPService which is wrapping XMLHTTPRequest.
>
> >>>4. For DOM elements and the closure compiler, does it expect type
> >>>Element,
> >> >for instance is below correct?
> >> >
> >> >/**
> >> > * @expose
> >> > * @type {Element}
> >> > */
> >> >org_apache_flex_core_UIBase.prototype.positioner;
> >>
> >> Not sure what you mean by “expect”, but the code snippet should work.
> >>
> >
> >Well I am trying to keep my bearings straight, gcc "knows about" Element
> >in
> >the DOM so it needs to be Element.
>
> OK, UIBase.positioner and UIBase.element are often the same thing.
>
> Thanks,
> -Alex
>
>

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.

On 6/2/15, 12:06 PM, "Michael Schmalle" <te...@gmail.com> wrote:

>On Tue, Jun 2, 2015 at 2:15 PM, Alex Harui <ah...@adobe.com> wrote:
>
>>
>>
>> On 6/2/15, 10:38 AM, "Michael Schmalle" <te...@gmail.com>
>>wrote:
>>>
>> >3. flexjs_wrapper can't exist on Element, it's not dynamic, does it
>>nee to
>> >be dynamic or do we just use array access?
>> >
>> >this.element['flexjs_wrapper'] = this;
>>
>> Ah yes, there are some places where we hack JS “classes”.  I’m open to
>> ideas on what to do.  Can we subclass Element and add flexjs_wrapper?
>>
>>
>I don't think we want to do this, Element is on the DOM so when and
>Element
>is used it will need to be of type Element when it gets compiled.
>
>I was just thinking of a getting in the super class;
>
>protected function get wrapper():Object {
>    return element['flexjs_wrapper'];
>}
>
>What type is the wrapper, an Element? Still learning here.
>

The wrapper is a UIBase for UI Elements, but it is some non-UIBase for
HTTPService which is wrapping XMLHTTPRequest.

>>>4. For DOM elements and the closure compiler, does it expect type
>>>Element,
>> >for instance is below correct?
>> >
>> >/**
>> > * @expose
>> > * @type {Element}
>> > */
>> >org_apache_flex_core_UIBase.prototype.positioner;
>>
>> Not sure what you mean by “expect”, but the code snippet should work.
>>
>
>Well I am trying to keep my bearings straight, gcc "knows about" Element
>in
>the DOM so it needs to be Element.

OK, UIBase.positioner and UIBase.element are often the same thing.

Thanks,
-Alex


Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
On Tue, Jun 2, 2015 at 2:15 PM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 6/2/15, 10:38 AM, "Michael Schmalle" <te...@gmail.com> wrote:
>
> >A couple questions;
>
> >
> >2. Running into problems with interfaces, if we use DOM,
> >HTMLElementWrapper.element needs to be Element not Object correct? If not,
> >you don't key code completion in the IDE.
>
> There are probably lots of places where the jsdoc annotation is Object
> when it can be something more specific.  A lot of the jsdoc I did was
> early when I just needed to get the tools to stop complaining.  So feel
> free to tighten up the jsdoc and/or use a more specific type than Object.
>
> >
> >3. flexjs_wrapper can't exist on Element, it's not dynamic, does it nee to
> >be dynamic or do we just use array access?
> >
> >this.element['flexjs_wrapper'] = this;
>
> Ah yes, there are some places where we hack JS “classes”.  I’m open to
> ideas on what to do.  Can we subclass Element and add flexjs_wrapper?
>
>
I don't think we want to do this, Element is on the DOM so when and Element
is used it will need to be of type Element when it gets compiled.

I was just thinking of a getting in the super class;

protected function get wrapper():Object {
    return element['flexjs_wrapper'];
}

What type is the wrapper, an Element? Still learning here.



> >
>



> >4. For DOM elements and the closure compiler, does it expect type Element,
> >for instance is below correct?
> >
> >/**
> > * @expose
> > * @type {Element}
> > */
> >org_apache_flex_core_UIBase.prototype.positioner;
>
> Not sure what you mean by “expect”, but the code snippet should work.
>

Well I am trying to keep my bearings straight, gcc "knows about" Element in
the DOM so it needs to be Element.



>
> >
> >5. The API now needs to be yanked out of Core/as/src into another
> >directory
> >like Core/api/src, so the as Flash and as HTML ActionScript can share the
> >same interfaces, correct? What would be the plan?
>
> You know, I went and moved everything into up to 3 folders (as, js, asjs),
> then found out that FB only supports one folder path per source attachment
> for a SWC.  So now, when debugging you sometimes have to switch source
> attachments from as to asjs.   So, I’m totally up for another folder
> restructuring.
>
> So, not sure what files need to be yanked out and shared, but seems like
> we have 3 different classes of source files;
>
> 1) AS for Flash
> 2) AS for JS
> 3) AS for both Flash and JS
>
> I wonder if we need to plan ahead for any JS source for something we need
> to hack in that can’t be described in AS.
>


We did this in Randori;

[JavaScript(source='my.js")]
public function someJsFunction():void {}

In the emitter I checked for that tag, if found I loaded the .js file and
stuck it inside the function's curly braces, viola, pure js that doesn't
get crapped on in the compiler.



>
> Anyway, do you happen to know how IJ associates source with SWCs for
> debugging?  FB would rather we put #1 and #3 in the same source folder,
> but that makes describing what gets cross-compiled to JS more difficult.
> We could make COMPJSC smarter and ignore files with some directive in it
> so folks don’t need to keep adding to a list of files when adding new
> files.
>


No, this would be a good question for Fred, don't forget to ask him.



>
>
> >
> >Lots more but I thought I would start with this.
> >
> >So from my sketchy tests we have:
>
> Freakin’ cool!  FWIW, I implemented a custom asdoc @ keyword that
> suppresses casting functions in the JS output.  Search for @flexjsignore.
> Kinda hacky but saves on some output code that doesn’t matter in the JS
> world.
>

Ok, I will have to look at it to see what you are talking about.

I am going to leave it up to you to figure out how to restructure the
source files when you have time, I don't have time to do that. As it is I
am going to need to draw up some UML sketches so I know exactly what is
going on.

Mike



>
> -Alex
>
>

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.

On 6/2/15, 10:38 AM, "Michael Schmalle" <te...@gmail.com> wrote:

>A couple questions;
>
>1. It doesn't look like you have private fields implemented to be emitted
>in the constructor? private fileds are going to the prototype. For
>instance;
>
>private var explicitWidth:Number = NaN;
>
>to
>
>/**
>* @private
>* @type {number}
>*/
>this.explicitWidth_ = NaN;
>
>Is this something that needs to happen, UIBase is what I am testing.

We’ll have to see if Erik or others with more JS and Goog experience can
answer that.  IIRC, in just vanilla JS, a private member would be on the
prototype and some other thing like an annotation would try to keep people
from using it outside the class via some compile-time checking.  However,
this fails in surprising ways for any members whose initial values are not
scalars.  For example:

  private var children:Array = [];

If this becomes

/**
 * @private
 */
MyClass.prototype.children = [];
 
Then all instances share the one array, which is undesirable.  So,
initializing fields in the constructor can avoid that problem at the cost
of running the init for scalars where it doesn’t matter.

What I don’t know is if Google Closure Compiler or Library has other
expectations about jsdoc for private members and whether they can be on
the prototype or not.  I think the Linter has busted me for trying to
declare uninitialized private members in the constructor, but I could be
wrong about that.  When I hit stuff like that I just give it an initial
value and keep on going.

>
>2. Running into problems with interfaces, if we use DOM,
>HTMLElementWrapper.element needs to be Element not Object correct? If not,
>you don't key code completion in the IDE.

There are probably lots of places where the jsdoc annotation is Object
when it can be something more specific.  A lot of the jsdoc I did was
early when I just needed to get the tools to stop complaining.  So feel
free to tighten up the jsdoc and/or use a more specific type than Object.

>
>3. flexjs_wrapper can't exist on Element, it's not dynamic, does it nee to
>be dynamic or do we just use array access?
>
>this.element['flexjs_wrapper'] = this;

Ah yes, there are some places where we hack JS “classes”.  I’m open to
ideas on what to do.  Can we subclass Element and add flexjs_wrapper?

>
>4. For DOM elements and the closure compiler, does it expect type Element,
>for instance is below correct?
>
>/**
> * @expose
> * @type {Element}
> */
>org_apache_flex_core_UIBase.prototype.positioner;

Not sure what you mean by “expect”, but the code snippet should work.

>
>5. The API now needs to be yanked out of Core/as/src into another
>directory
>like Core/api/src, so the as Flash and as HTML ActionScript can share the
>same interfaces, correct? What would be the plan?

You know, I went and moved everything into up to 3 folders (as, js, asjs),
then found out that FB only supports one folder path per source attachment
for a SWC.  So now, when debugging you sometimes have to switch source
attachments from as to asjs.   So, I’m totally up for another folder
restructuring.

So, not sure what files need to be yanked out and shared, but seems like
we have 3 different classes of source files;

1) AS for Flash
2) AS for JS
3) AS for both Flash and JS

I wonder if we need to plan ahead for any JS source for something we need
to hack in that can’t be described in AS.

Anyway, do you happen to know how IJ associates source with SWCs for
debugging?  FB would rather we put #1 and #3 in the same source folder,
but that makes describing what gets cross-compiled to JS more difficult.
We could make COMPJSC smarter and ignore files with some directive in it
so folks don’t need to keep adding to a list of files when adding new
files.


>
>Lots more but I thought I would start with this.
>
>So from my sketchy tests we have:

Freakin’ cool!  FWIW, I implemented a custom asdoc @ keyword that
suppresses casting functions in the JS output.  Search for @flexjsignore.
Kinda hacky but saves on some output code that doesn’t matter in the JS
world.

-Alex


Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.

On 6/2/15, 11:40 AM, "Michael Schmalle" <te...@gmail.com> wrote:

>On Tue, Jun 2, 2015 at 2:29 PM, Alex Harui <ah...@adobe.com> wrote:
>
>> Did I put the private vars in the constructor?  I could swear I got that
>> pattern from someone else.  I’m totally fine with changing it.  But we
>> have to take care of the "shared non-scalar initializer" scenario.
>>
>
>I vaguely remember this pattern and we used it in Randori, I know because
>I
>have a method that does just this in the RandoriEmitter.
>
>So what are all the scalar values in AS?

String, Int, Number, Uint, Boolean.  IIRC, it is anything you don’t “new”.
[] is effectively “new Array”, {} is effectively “new Object”.  And String
is in the list only because there is no in-place String modifiers.  And
you can’t just watch out for “new” as there can be static generators.

private var foo:SomeInstance = SomeSingleton.SomeInstanceFactory;

>
>I have to code to add this into the emitter when the time comes, so we
>need
>the prototype declaration but we also need to initalize files that
>initalize any value correct?

IIRC, in Flex in AS2 (not AS3) the convention was to declare all
variables/properties on the prototype, and initialize scalars on the
prototype and write code to initialize instance values in the constructor.
But feel free to do something else if it is easier.

-Alex


Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
On Tue, Jun 2, 2015 at 2:29 PM, Alex Harui <ah...@adobe.com> wrote:

> Did I put the private vars in the constructor?  I could swear I got that
> pattern from someone else.  I’m totally fine with changing it.  But we
> have to take care of the "shared non-scalar initializer" scenario.
>

I vaguely remember this pattern and we used it in Randori, I know because I
have a method that does just this in the RandoriEmitter.

So what are all the scalar values in AS?

I have to code to add this into the emitter when the time comes, so we need
the prototype declaration but we also need to initalize files that
initalize any value correct?

Mike




>
> On 6/2/15, 11:12 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>
> >Yeah... early days, I guess. UIBase has been around for a while.
> >Progressive insight and all ;-)
> >
> >EdB
> >
> >
> >
> >On Tue, Jun 2, 2015 at 8:04 PM, Michael Schmalle
> ><te...@gmail.com>
> >wrote:
> >
> >> Ok, I only asked because I was looking at UIBase.js that Alex wrote and
> >>he
> >> doesn't declare prototypes only type declarations in the constructor.
> >>
> >> Mike
> >>
> >> On Tue, Jun 2, 2015 at 1:59 PM, Erik de Bruin <er...@ixsoftware.nl>
> >>wrote:
> >>
> >> > >
> >> > > 1. It doesn't look like you have private fields implemented to be
> >> emitted
> >> > > in the constructor? private fileds are going to the prototype. For
> >> > > instance;
> >> > >
> >> > > private var explicitWidth:Number = NaN;
> >> > >
> >> > > to
> >> > >
> >> > > /**
> >> > > * @private
> >> > > * @type {number}
> >> > > */
> >> > > this.explicitWidth_ = NaN;
> >> > >
> >> > > Is this something that needs to happen, UIBase is what I am testing.
> >> > >
> >> >
> >> > I think having the declaration on the prototype instead of in the
> >> > constructor keep the JS closer to the AS, make the inheritance of the
> >>JS
> >> > class a bit more robust (?) and certainly makes the job of the Closure
> >> > Compiler easier, as the coding conventions for 'goog' dictate the
> >> > declaration of all fields on the prototype.
> >> >
> >> > EdB
> >> >
> >> >
> >> >
> >> > --
> >> > Ix Multimedia Software
> >> >
> >> > Jan Luykenstraat 27
> >> > 3521 VB Utrecht
> >> >
> >> > T. 06-51952295
> >> > I. www.ixsoftware.nl
> >> >
> >>
> >
> >
> >
> >--
> >Ix Multimedia Software
> >
> >Jan Luykenstraat 27
> >3521 VB Utrecht
> >
> >T. 06-51952295
> >I. www.ixsoftware.nl
>
>

Re: [FalconJX] FlexJS as to js work

Posted by Alex Harui <ah...@adobe.com>.
Did I put the private vars in the constructor?  I could swear I got that
pattern from someone else.  I’m totally fine with changing it.  But we
have to take care of the "shared non-scalar initializer" scenario.


On 6/2/15, 11:12 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:

>Yeah... early days, I guess. UIBase has been around for a while.
>Progressive insight and all ;-)
>
>EdB
>
>
>
>On Tue, Jun 2, 2015 at 8:04 PM, Michael Schmalle
><te...@gmail.com>
>wrote:
>
>> Ok, I only asked because I was looking at UIBase.js that Alex wrote and
>>he
>> doesn't declare prototypes only type declarations in the constructor.
>>
>> Mike
>>
>> On Tue, Jun 2, 2015 at 1:59 PM, Erik de Bruin <er...@ixsoftware.nl>
>>wrote:
>>
>> > >
>> > > 1. It doesn't look like you have private fields implemented to be
>> emitted
>> > > in the constructor? private fileds are going to the prototype. For
>> > > instance;
>> > >
>> > > private var explicitWidth:Number = NaN;
>> > >
>> > > to
>> > >
>> > > /**
>> > > * @private
>> > > * @type {number}
>> > > */
>> > > this.explicitWidth_ = NaN;
>> > >
>> > > Is this something that needs to happen, UIBase is what I am testing.
>> > >
>> >
>> > I think having the declaration on the prototype instead of in the
>> > constructor keep the JS closer to the AS, make the inheritance of the
>>JS
>> > class a bit more robust (?) and certainly makes the job of the Closure
>> > Compiler easier, as the coding conventions for 'goog' dictate the
>> > declaration of all fields on the prototype.
>> >
>> > EdB
>> >
>> >
>> >
>> > --
>> > Ix Multimedia Software
>> >
>> > Jan Luykenstraat 27
>> > 3521 VB Utrecht
>> >
>> > T. 06-51952295
>> > I. www.ixsoftware.nl
>> >
>>
>
>
>
>-- 
>Ix Multimedia Software
>
>Jan Luykenstraat 27
>3521 VB Utrecht
>
>T. 06-51952295
>I. www.ixsoftware.nl


Re: [FalconJX] FlexJS as to js work

Posted by Erik de Bruin <er...@ixsoftware.nl>.
Yeah... early days, I guess. UIBase has been around for a while.
Progressive insight and all ;-)

EdB



On Tue, Jun 2, 2015 at 8:04 PM, Michael Schmalle <te...@gmail.com>
wrote:

> Ok, I only asked because I was looking at UIBase.js that Alex wrote and he
> doesn't declare prototypes only type declarations in the constructor.
>
> Mike
>
> On Tue, Jun 2, 2015 at 1:59 PM, Erik de Bruin <er...@ixsoftware.nl> wrote:
>
> > >
> > > 1. It doesn't look like you have private fields implemented to be
> emitted
> > > in the constructor? private fileds are going to the prototype. For
> > > instance;
> > >
> > > private var explicitWidth:Number = NaN;
> > >
> > > to
> > >
> > > /**
> > > * @private
> > > * @type {number}
> > > */
> > > this.explicitWidth_ = NaN;
> > >
> > > Is this something that needs to happen, UIBase is what I am testing.
> > >
> >
> > I think having the declaration on the prototype instead of in the
> > constructor keep the JS closer to the AS, make the inheritance of the JS
> > class a bit more robust (?) and certainly makes the job of the Closure
> > Compiler easier, as the coding conventions for 'goog' dictate the
> > declaration of all fields on the prototype.
> >
> > EdB
> >
> >
> >
> > --
> > Ix Multimedia Software
> >
> > Jan Luykenstraat 27
> > 3521 VB Utrecht
> >
> > T. 06-51952295
> > I. www.ixsoftware.nl
> >
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [FalconJX] FlexJS as to js work

Posted by Michael Schmalle <te...@gmail.com>.
Ok, I only asked because I was looking at UIBase.js that Alex wrote and he
doesn't declare prototypes only type declarations in the constructor.

Mike

On Tue, Jun 2, 2015 at 1:59 PM, Erik de Bruin <er...@ixsoftware.nl> wrote:

> >
> > 1. It doesn't look like you have private fields implemented to be emitted
> > in the constructor? private fileds are going to the prototype. For
> > instance;
> >
> > private var explicitWidth:Number = NaN;
> >
> > to
> >
> > /**
> > * @private
> > * @type {number}
> > */
> > this.explicitWidth_ = NaN;
> >
> > Is this something that needs to happen, UIBase is what I am testing.
> >
>
> I think having the declaration on the prototype instead of in the
> constructor keep the JS closer to the AS, make the inheritance of the JS
> class a bit more robust (?) and certainly makes the job of the Closure
> Compiler easier, as the coding conventions for 'goog' dictate the
> declaration of all fields on the prototype.
>
> EdB
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl
>

Re: [FalconJX] FlexJS as to js work

Posted by Erik de Bruin <er...@ixsoftware.nl>.
>
> 1. It doesn't look like you have private fields implemented to be emitted
> in the constructor? private fileds are going to the prototype. For
> instance;
>
> private var explicitWidth:Number = NaN;
>
> to
>
> /**
> * @private
> * @type {number}
> */
> this.explicitWidth_ = NaN;
>
> Is this something that needs to happen, UIBase is what I am testing.
>

I think having the declaration on the prototype instead of in the
constructor keep the JS closer to the AS, make the inheritance of the JS
class a bit more robust (?) and certainly makes the job of the Closure
Compiler easier, as the coding conventions for 'goog' dictate the
declaration of all fields on the prototype.

EdB



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl