Hi,
Actually, I was trying to translate event.js and seen:
// EventHandler and ErrorHandler are not listed as deps for
// some of the event classes because they would cause
// circularities so we force them in here.
goog.require('goog.debug.ErrorHandler');
goog.require('goog.events.EventHandler');
I didn't get why this classes should be forced though ?
I started to create an extern for GCL, at least the parts needed, it was partly
generated, partly hand coded and I haven't been able to compile it with Ant, I
created a project in IJ instead at the moment and just started to use the
GCL.swc now.
For the rest of the class, the type var is in the super class, I didn't get why
it has been added to the class, any idea ?
I don't see any reason either why CHANGE should be in
org.apache.flex.events.Event.EventType, any idea ?
/**
* Enum type for the events fired by the FlexJS Event
* @enum {string}
*/
org.apache.flex.events.Event.EventType = {
CHANGE: 'change'
};
/**
* @export
* @type {string} type The event type.
*/
org.apache.flex.events.Event.prototype.type = '';
/**
* @export
* @param {string} type The event type.
*/
org.apache.flex.events.Event.prototype.init = function(type) {
this.type = type;
};
So, I simply translated it like that:
COMPILE::JS
public class Event extends goog.events.Event {
public static const CHANGE:String = "change";
public function Event(type:String, target:Object = null) {
super(type, target);
}
public function init(type:String):void {
this.type = type;
}
}
Does it seem ok ?
It takes time because I'm reviewing in the same time and my time is limited.
Frédéric THOMAS
> From: webdoubl...@hotmail.com
> To: dev@flex.apache.org
> Subject: RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Tue, 11 Aug 2015 18:21:17 +0100
>
> > That’s convenient, but my main point was to reduce the number of
> > databinding expressions in MXML that have to be written by the developer,
> > and set up and run at startup.
>
> Oh yeah, you are right, I didn't it read well, but still, usually for a
> library, even more a public one, I can pay a bit more to have something
> squared, the point is how much :-)
>
> > Anyway, not a major issue for me at this time. I’m way more interested in
> > seeing how easy/hard it will be do convert our JS back to AS.
>
> yep !
>
> Frédéric THOMAS
>
>
> ----------------------------------------
> > From: aha...@adobe.com
> > To: dev@flex.apache.org
> > Subject: Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
> > Date: Tue, 11 Aug 2015 16:57:42 +0000
> >
> >
> >
> > On 8/11/15, 8:15 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> >
> >>>Also, another point I just remembered is MXML. I don’t know that
> >>> MouseButton would actually show up in MXML attribute values but for
> >>>other
> >>> things it might be better to use simple String constants and do extra
> >>> checking inside so your MXML looks like:
> >>>
> >>> <sometag someAttribute=“someValue” />
> >>>
> >>> Instead of
> >>>
> >>> <sometag someAttribute=“{SomeClass.someValue}” />
> >>>
> >>> Or
> >>>
> >>> <sometag someAttribute=“{new UtilityClass(‘someValue’))}”
> >>>
> >>> At least for now until someone figures out how to get the compiler to
> >>> optimize out the binding expression. I’ve always wished we could do:
> >>>
> >>> <sometag someAttribute=“SomeClass.someConst” />
> >>
> >>In libraries, for the Enum like classes, I use to add things like
> >>MyEnum.fromIndex(index:uint):MyEnum and
> >>MyEnum.fromLabel(label:String):MyEnum, so, it can be used in the same way
> >>than "new UtilityClass(‘someValue’))" but it belongs the same class where
> >>the data resides.
> >
> > That’s convenient, but my main point was to reduce the number of
> > databinding expressions in MXML that have to be written by the developer,
> > and set up and run at startup.
> >
> > Anyway, not a major issue for me at this time. I’m way more interested in
> > seeing how easy/hard it will be do convert our JS back to AS.
> >
> > Thanks for working on it,
> > -Alex
> >
> >
>