Re: [FlexJS] Framework using externs (was: Setup Error)

2015-12-01 Thread Michael Schmalle
On Tue, Dec 1, 2015 at 3:53 PM, Carlos Rovira  wrote:

> That sounds really amazing. So in the beginning was a mix of AS3 and JS. If
> JS didn't exit, then it was generated.
> So, the strategy now is to have all in AS3 and *all* (or the most possible)
> JS generated?
>
>
Yeah, your right. If you red back in the archives I said I would love to
enable Peter and Alex to only have to focus on the framework and for them
not to have to write JS, I saw that as a huge minus for the project
actually taking off.

So I spent about 1.5 months writing the externs compiler(EXTERNC) and
getting it to mostly compile all of the google closure extern(hearder)
files.

I am so happy to hear that Alex and Peter have almost got done what I saw
could be a huge benefit with the tool I wrote.

Anyway, it's also nice to see FalconJX (my name for the failed FalconJS)
compiler actually seeing some runtime. I spent so much time writing the
unit tests and developing FalconJX that I got so depressed in 2013 I quit
basically. Alex must have seen some value in it because Erik and him got
the MXML emitter working during the time I had left.

Anyway, I wish I had some projects for FlexJS/FlaconJX but my story is
still the same. I am using Feathers and AIR for some audio apps and it
requires native extensions calling C++ API so the JS part is kind of out
for me experimenting with those apps right now..

Mike



> 2015-12-01 20:37 GMT+01:00 Alex Harui :
>
> >
> >
> > On 12/1/15, 11:13 AM, "carlos.rov...@gmail.com on behalf of Carlos
> Rovira"
> > 
> > wrote:
> >
> > >Hi Alex, that sounds amazing.
> > >
> > >One question for me is what you refer as "externs". Could you share what
> > >this means?
> >
> > Externs are like header files for JS libraries.  Michael Schmalle made it
> > possible to create a SWC like our js.swc that contains the
> > playerglobal.swc equivalent for the browser.  It contains HTMLElement,
> > Document, Window, XMLHTTPRequest, etc.  The source for the externs comes
> > from Google Closure Library.
> >
> > This allows us to write fully functional JS applications and frameworks
> by
> > writing them in AS, even in an IDE with code completion, and outputting
> > JS.  The FlexJS 0.5.0 framework currently consists of thousands of lines
> > of JS code handwritten by Peter and I and others.  We are almost done
> > rewriting those JS files in AS.  The advantages are significant.  The
> > compiler catches things sooner, we don't waste time forgetting to type
> > 'this.' or debugging when we do, we don't waste time typing out package
> > path names, etc.  Also, the AS code for the SWF and the JS code for the
> > browser for any particular component often shared quite a bit of code and
> > now all that shared code is in one file with conditional compiles for JS
> > or SWF-specific code.  In the end, I now strongly believe that AS is a
> > better language for writing JS.
> > I expect that we'll be able to create components in FlexJS much more
> > quickly this way.
> >
> > -Alex
> >
> >
>
>
> --
>
> Carlos Rovira
> Director General
> M: +34 607 22 60 05
> http://www.codeoscopic.com
> http://www.avant2.es
>
>
> Este mensaje se dirige exclusivamente a su destinatario y puede contener
> información privilegiada o confidencial. Si ha recibido este mensaje por
> error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
> proceda a su destrucción.
>
> De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
> que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
> S.A. La finalidad de dicho tratamiento es facilitar la prestación del
> servicio o información solicitados, teniendo usted derecho de acceso,
> rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
> oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
> necesaria.
>


Re: [FlexJS] Framework using externs (was: Setup Error)

2015-12-01 Thread OmPrakash Muppirala
>
> Say I found a way to get my native calls working, I still would be ata loss
> for the UI graphics framework I am currently using with Feathers. I know Om
> had mentioned SVG, but I didn't hear anymore about that and I have really 0
> experience with it.
>

FlexJS + SVG would be perfect for that.  There I said it again :-)
Seriously though, I have very little time to devote this feature.  Right
now, I am working on node.js support for FlexJS.  After that, I hope to
tinker with the graphics API again.

More recently, one of FlexJS users Lizhi has posted Stage3D APIs ported to
JS via FlexJS.  Have you seen that?
Here are a few links he has sent out so far:
Code:
https://github.com/matrix3d/spriteflexjs/blob/master/src/TestGraphics.as
Demo:
http://matrix3d.github.io/assets/html5/flexjsstage3d/bin/js-release/indexg.html

This library brings the Stage3D API to Canvas/JS via FlexJS.

Thanks,
Om


Re: [FlexJS] Framework using externs (was: Setup Error)

2015-12-01 Thread Alex Harui


On 12/1/15, 2:27 PM, "Michael Schmalle"  wrote:

>On Tue, Dec 1, 2015 at 3:53 PM, Carlos Rovira
>> wrote:
>
>> That sounds really amazing. So in the beginning was a mix of AS3 and
>>JS. If
>> JS didn't exit, then it was generated.
>> So, the strategy now is to have all in AS3 and *all* (or the most
>>possible)
>> JS generated?
>>

I'm pretty confident that when we're done there won't be any .JS files in
the code base.

>
>Anyway, I wish I had some projects for FlexJS/FlaconJX but my story is
>still the same. I am using Feathers and AIR for some audio apps and it
>requires native extensions calling C++ API so the JS part is kind of out
>for me experimenting with those apps right now..

FlexJS output is compatible with Cordova, so in theory you can use Cordova
plug-ins to call the same C++, and MXML and AS to glue it all together.

-Alex



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-12-01 Thread Michael Schmalle
On Tue, Dec 1, 2015 at 6:15 PM, Alex Harui  wrote:

>
> On 12/1/15, 2:27 PM, "Michael Schmalle"  wrote:
>
> >Anyway, I wish I had some projects for FlexJS/FlaconJX but my story is
> >still the same. I am using Feathers and AIR for some audio apps and it
> >requires native extensions calling C++ API so the JS part is kind of out
> >for me experimenting with those apps right now..
>
> FlexJS output is compatible with Cordova, so in theory you can use Cordova
> plug-ins to call the same C++, and MXML and AS to glue it all together.
>


Yeah, I know. :) But the thing is, I looked at Cordova and [theorized I
didn't have enough time to experiment. I'm working a day job with a friend
right now so my lab time is 0 or else now that it is .5 I would try it. All
my time atm is devoted to the Feathers apps.

I did have one app that I remember showing Om screenshots months back but
it needs to use UDP messages which last time I checked, javascript browsers
didn't support, I think maybe an android one did.

Also, the "problem" with my apps are they are more like games in a sense I
need high performance graphics/animation. You see there are to many loose
ends and questions for my stuff.

Say I found a way to get my native calls working, I still would be ata loss
for the UI graphics framework I am currently using with Feathers. I know Om
had mentioned SVG, but I didn't hear anymore about that and I have really 0
experience with it.

Anyway, I have spent more time writing this reply due to all my questions.
:)

Mike


>
> -Alex
>
>


Re: [FlexJS] Framework using externs (was: Setup Error)

2015-12-01 Thread Alex Harui
FYI, FlexJSStore is mostly up and running on AS cross-compiled to JS.  To
me that proves that this workflow for writing JS in AS is truly viable.

I'm going to fix the two bugs I know about and then start deleting the
handwritten JS files.

-Alex

On 11/11/15, 11:45 AM, "Alex Harui"  wrote:

>
>
>On 11/11/15, 11:41 AM, "Harbs"  wrote:
>
>>If you search the source code for COMPILE::JS and COMPILE:AS3, you’ll see
>>what they’ve done so far.
>
>This work is in the core_js_to_as branch.  None of this has been merged to
>develop.
>
>The time table is to:
>
>-Roughly back port all of the SWCs (clean compile, doesn’t matter if it
>runs)
>-Make sure the examples appear to run
>-Delete all of the handwritten JS files in case they were somehow still
>getting involved.  Right now we keep them around for referencing.
>-Make sure the examples appear to run
>-move as/src/ to just src
>-Make sure the examples appear to run
>
>-Alex
>
>



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-12-01 Thread Carlos Rovira
Hi Alex, that sounds amazing.

One question for me is what you refer as "externs". Could you share what
this means?

thanks!

2015-12-01 19:53 GMT+01:00 Alex Harui :

> FYI, FlexJSStore is mostly up and running on AS cross-compiled to JS.  To
> me that proves that this workflow for writing JS in AS is truly viable.
>
> I'm going to fix the two bugs I know about and then start deleting the
> handwritten JS files.
>
> -Alex
>
> On 11/11/15, 11:45 AM, "Alex Harui"  wrote:
>
> >
> >
> >On 11/11/15, 11:41 AM, "Harbs"  wrote:
> >
> >>If you search the source code for COMPILE::JS and COMPILE:AS3, you’ll see
> >>what they’ve done so far.
> >
> >This work is in the core_js_to_as branch.  None of this has been merged to
> >develop.
> >
> >The time table is to:
> >
> >-Roughly back port all of the SWCs (clean compile, doesn’t matter if it
> >runs)
> >-Make sure the examples appear to run
> >-Delete all of the handwritten JS files in case they were somehow still
> >getting involved.  Right now we keep them around for referencing.
> >-Make sure the examples appear to run
> >-move as/src/ to just src
> >-Make sure the examples appear to run
> >
> >-Alex
> >
> >
>
>


-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es


Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.


Re: [FlexJS] Framework using externs (was: Setup Error)

2015-12-01 Thread Alex Harui


On 12/1/15, 11:13 AM, "carlos.rov...@gmail.com on behalf of Carlos Rovira"
 wrote:

>Hi Alex, that sounds amazing.
>
>One question for me is what you refer as "externs". Could you share what
>this means?

Externs are like header files for JS libraries.  Michael Schmalle made it
possible to create a SWC like our js.swc that contains the
playerglobal.swc equivalent for the browser.  It contains HTMLElement,
Document, Window, XMLHTTPRequest, etc.  The source for the externs comes
from Google Closure Library.

This allows us to write fully functional JS applications and frameworks by
writing them in AS, even in an IDE with code completion, and outputting
JS.  The FlexJS 0.5.0 framework currently consists of thousands of lines
of JS code handwritten by Peter and I and others.  We are almost done
rewriting those JS files in AS.  The advantages are significant.  The
compiler catches things sooner, we don't waste time forgetting to type
'this.' or debugging when we do, we don't waste time typing out package
path names, etc.  Also, the AS code for the SWF and the JS code for the
browser for any particular component often shared quite a bit of code and
now all that shared code is in one file with conditional compiles for JS
or SWF-specific code.  In the end, I now strongly believe that AS is a
better language for writing JS.
I expect that we'll be able to create components in FlexJS much more
quickly this way.

-Alex



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-11-11 Thread Alex Harui
Update:

The following SWCs have been back ported (but are in various states of
operability):

Binding 
Collections
Effects
Graphics
Charts
Core
DragDrop
HTML

Peter is almost done with:
Mobile

I’m starting in on
Network



These are remaining:
Formatters
Flat
GoogleMaps
HTML5
Jquery
CreateJS

Once I finish Network I’ll have most of what I need to get FlexJSStore
running in order to test the back port of DragDrop, and Effects.



-Alex

On 10/30/15, 2:34 PM, "Alex Harui"  wrote:

>Update:
>
>I got all of the classes in HTML to cross-compile, and DataBindingExample
>ran and seemed to work.  Along the way, I found and fixed several bugs in
>Falcon.  While this back-port from JS to AS isn’t going out in the 0.5.0
>release, the fixes to Falcon are since folks writing AS for JS would hit
>these even for “low-level” JS apps.
>
>-Alex
>



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-11-11 Thread OmPrakash Muppirala
I'm sorry if I missed it earlier, but what exactly does 'back port' mean?

Thanks,
Om

On Wed, Nov 11, 2015 at 9:43 AM, Alex Harui  wrote:

> Update:
>
> The following SWCs have been back ported (but are in various states of
> operability):
>
> Binding
> Collections
> Effects
> Graphics
> Charts
> Core
> DragDrop
> HTML
>
> Peter is almost done with:
> Mobile
>
> I’m starting in on
> Network
>
>
>
> These are remaining:
> Formatters
> Flat
> GoogleMaps
> HTML5
> Jquery
> CreateJS
>
> Once I finish Network I’ll have most of what I need to get FlexJSStore
> running in order to test the back port of DragDrop, and Effects.
>
>
>
> -Alex
>
> On 10/30/15, 2:34 PM, "Alex Harui"  wrote:
>
> >Update:
> >
> >I got all of the classes in HTML to cross-compile, and DataBindingExample
> >ran and seemed to work.  Along the way, I found and fixed several bugs in
> >Falcon.  While this back-port from JS to AS isn’t going out in the 0.5.0
> >release, the fixes to Falcon are since folks writing AS for JS would hit
> >these even for “low-level” JS apps.
> >
> >-Alex
> >
>
>


Re: [FlexJS] Framework using externs (was: Setup Error)

2015-11-11 Thread OmPrakash Muppirala
Oh, wow.  That is fantastic.  I hope to get my hands on this action soon.
Sorry for not helping out for a while.

On Wed, Nov 11, 2015 at 11:20 AM, Alex Harui  wrote:

>
>
> On 11/11/15, 11:04 AM, "omup...@gmail.com on behalf of OmPrakash
> Muppirala"  wrote:
>
> >I'm sorry if I missed it earlier, but what exactly does 'back port' mean?
>
> We are trying to write the entire FlexJS framework in ActionScript such
> that every line of JS used in the HTML/JS/CSS version was cross-compiled.
> This involved porting the handwritten js back to as (hence back port).
>
> When complete, we will essentially prove that large amounts of JS code can
> be written in AS.
>
> -Alex
>
>


Re: [FlexJS] Framework using externs (was: Setup Error)

2015-11-11 Thread Harbs
If you search the source code for COMPILE::JS and COMPILE:AS3, you’ll see what 
they’ve done so far.

On Nov 11, 2015, at 9:30 PM, OmPrakash Muppirala  wrote:

> Oh, wow.  That is fantastic.  I hope to get my hands on this action soon.
> Sorry for not helping out for a while.
> 
> On Wed, Nov 11, 2015 at 11:20 AM, Alex Harui  wrote:
> 
>> 
>> 
>> On 11/11/15, 11:04 AM, "omup...@gmail.com on behalf of OmPrakash
>> Muppirala"  wrote:
>> 
>>> I'm sorry if I missed it earlier, but what exactly does 'back port' mean?
>> 
>> We are trying to write the entire FlexJS framework in ActionScript such
>> that every line of JS used in the HTML/JS/CSS version was cross-compiled.
>> This involved porting the handwritten js back to as (hence back port).
>> 
>> When complete, we will essentially prove that large amounts of JS code can
>> be written in AS.
>> 
>> -Alex
>> 
>> 



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-11-11 Thread Alex Harui


On 11/11/15, 11:41 AM, "Harbs"  wrote:

>If you search the source code for COMPILE::JS and COMPILE:AS3, you’ll see
>what they’ve done so far.

This work is in the core_js_to_as branch.  None of this has been merged to
develop.

The time table is to:

-Roughly back port all of the SWCs (clean compile, doesn’t matter if it
runs)
-Make sure the examples appear to run
-Delete all of the handwritten JS files in case they were somehow still
getting involved.  Right now we keep them around for referencing.
-Make sure the examples appear to run
-move as/src/ to just src
-Make sure the examples appear to run

-Alex




Re: [FlexJS] Framework using externs (was: Setup Error)

2015-11-11 Thread Alex Harui


On 11/11/15, 11:04 AM, "omup...@gmail.com on behalf of OmPrakash
Muppirala"  wrote:

>I'm sorry if I missed it earlier, but what exactly does 'back port' mean?

We are trying to write the entire FlexJS framework in ActionScript such
that every line of JS used in the HTML/JS/CSS version was cross-compiled.
This involved porting the handwritten js back to as (hence back port).

When complete, we will essentially prove that large amounts of JS code can
be written in AS.

-Alex



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-10-30 Thread Alex Harui
Update:

I got all of the classes in HTML to cross-compile, and DataBindingExample
ran and seemed to work.  Along the way, I found and fixed several bugs in
Falcon.  While this back-port from JS to AS isn’t going out in the 0.5.0
release, the fixes to Falcon are since folks writing AS for JS would hit
these even for “low-level” JS apps.

-Alex



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-10-19 Thread Kessler CTR Mark J
I'll take a look at it tonight.

-Mark


-Original Message-
From: Alex Harui [mailto:aha...@adobe.com]
Sent: Sunday, October 18, 2015 10:35 AM
To: dev@flex.apache.org
Subject: Re: [FlexJS] Framework using externs (was: Setup Error)



On 10/18/15, 12:39 AM, "Harbs" <harbs.li...@gmail.com> wrote:

>What do I need to do to help with this?

Well, my understanding of the release process is that folks who intend to
vote on the release should examine the nightly build as if it were a
release candidate.  I’ve posted in the discuss threads a link to scripts
that take you through the examination steps.

Once we get enough feedback that the nightly looks ok, we can open a vote
thread.

Thanks,
-Alex



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-10-18 Thread Harbs
What do I need to do to help with this?

On Oct 18, 2015, at 8:40 AM, Alex Harui  wrote:

> I’d appreciate folks trying to find time to help us get
> 0.5.0 out the door



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-10-18 Thread Alex Harui


On 10/18/15, 12:39 AM, "Harbs"  wrote:

>What do I need to do to help with this?

Well, my understanding of the release process is that folks who intend to
vote on the release should examine the nightly build as if it were a
release candidate.  I’ve posted in the discuss threads a link to scripts
that take you through the examination steps.

Once we get enough feedback that the nightly looks ok, we can open a vote
thread.

Thanks,
-Alex



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-10-17 Thread Alex Harui


On 10/14/15, 1:53 PM, "Alex Harui"  wrote:

>Update:
>
>I got all of the classes in Core to cross-compile.  No idea if it will run
>yet, but before I go and start making it run, I think I discovered that I
>can re-organize the sources and possibly make things a bit simpler.
>
>Right now, in the Core project there is an as/src folder and an asjs/src
>folder.  The asjs/src folder contains files that cross-compile without any
>conditional compilation.  The compile options for the asjs/src folder
>actually reference the SWC generated from as/src prior to compiling the
>code in asjs/src.  And then, the asjs/src compile generates a js/out and
>then we run the as/src compile again to package the js/out into the swc.
>
>But now, with the conditional compilation flags, I believe I can now
>collapse asjs/src into as/src and use conditional compilation in the
>CoreClasses.as file to skip cross-compiling a few swf-only classes we have
>in there.
>
>Then, if that’s true, the first step in building the Core project will be
>the cross-compile step to generate the js/out, then the second pass will
>compile the swc.  And then all of our src will be in one folder which
>makes it easier to find source files.
>
>Anyway, I’m off to try to make that work.  Let me know if I’ve missed
>something or if you have questions.  This work will not be going in a
>release any time soon, it is happening in a branch.

It seems to work.  DataBindingExample still runs.  I pushed these changes,
so Core is now fully written in AS!

I’ll be porting the other SWCs soon.  This work is not intended for the
0.5.0 release.  I’d appreciate folks trying to find time to help us get
0.5.0 out the door, although I will say that the porting has uncovered
some interesting bugs in Falcon/FalconJX that will go out in 0.5.0 in case
some folks doing native JS from AS run into the same problem.

Thanks,
-Alex




Re: [FlexJS] Framework using externs (was: Setup Error)

2015-10-14 Thread Alex Harui
Update:

I got all of the classes in Core to cross-compile.  No idea if it will run
yet, but before I go and start making it run, I think I discovered that I
can re-organize the sources and possibly make things a bit simpler.

Right now, in the Core project there is an as/src folder and an asjs/src
folder.  The asjs/src folder contains files that cross-compile without any
conditional compilation.  The compile options for the asjs/src folder
actually reference the SWC generated from as/src prior to compiling the
code in asjs/src.  And then, the asjs/src compile generates a js/out and
then we run the as/src compile again to package the js/out into the swc.

But now, with the conditional compilation flags, I believe I can now
collapse asjs/src into as/src and use conditional compilation in the
CoreClasses.as file to skip cross-compiling a few swf-only classes we have
in there.

Then, if that’s true, the first step in building the Core project will be
the cross-compile step to generate the js/out, then the second pass will
compile the swc.  And then all of our src will be in one folder which
makes it easier to find source files.

Anyway, I’m off to try to make that work.  Let me know if I’ve missed
something or if you have questions.  This work will not be going in a
release any time soon, it is happening in a branch.

-Alex

On 10/8/15, 12:17 PM, "Alex Harui" <aha...@adobe.com> wrote:

>I just pushed a bunch of changes to the flex-asjs repo in the
>Core_js_to_as branch that shows that I could replace several dozen classes
>that were written in JS with AS that cross-compiles to the equivalent JS.
>
>There are many more classes to port, but I think this is the right
>direction to go for many reasons:
>1) It helps prove out the whole AS to JS story
>2) It will reduce errors
>3) It will improve consistency between the SWF and JS versions
>4) More code gets shared.
>
>The only downside I’ve found so far is that it can get a bit ugly if the
>class inheritance isn’t exactly the same (which is isn’t in a few places).
> But I think the trade-off is worth it.  I still have to tidy up the build
>scripts a bit.  Does anybody have time to pitch in on the rest of the
>port?  If so, I will prioritize a wiki page on what to do.
>
>This exercise also found many bugs in Falcon.  I just pushed those changes
>too.  And I’ve pushed those changes to the develop branch.  There is no
>need for a separate branch for the Falcon code required to cross-compile
>this AS to JS right now (and hopefully never in the future either).
>
>So, those Falcon changes will go out in the next release, whereas the
>flex-asjs changes will wait for the next release after we complete the
>port.
>
>I would really like to get a release of Falcon and FlexJS soon.  I guess I
>will now try to spend some time trying to make it easier to download and
>build the source packages.  Separate thread on that coming up.
>
>-Alex
>
>On 9/18/15, 10:26 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
>
>>> Yeah, I’m just looking ahead and am in the mood to play in the compiler
>>> code.  I figure some day we’ll have a true GCL swc, either by making
>>> EXTERNC more tolerant, or because a d.ts file for GCL will be converted
>>>to
>>> externs.
>>> 
>>> I’m also expecting that some day as we go further into this port from
>>>JS
>>> back to AS, that we’ll hit some code or write some code where we need
>>>both
>>> GCL.swc and JS.swc and I would expect collisions between Event and
>>> EventTarget in such a case, even with the stubbed GCL.swc we currently
>>> have, so I’m exploring ways to deal with that.
>>
>>Fair enough, would be awesome !
>>
>>Thanks,
>>Frédéric THOMAS
>>
>>> From: aha...@adobe.com
>>> To: dev@flex.apache.org
>>> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
>>> Date: Fri, 18 Sep 2015 17:00:51 +
>>> 
>>> 
>>> 
>>> On 9/18/15, 9:42 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
>>> 
>>> >> IMO, the externs swcs are also for developers wanting to build
>>>“native”
>>> >>JS
>>> >> applications without the FlexJS components, so any GCL.swc needs to
>>> >> support some developer using GCL and native JS.  So the two swcs
>>>need to
>>> >> be compatible with each other.   We could just hack up a GCL just to
>>>get
>>> >> the FlexJS JS to be written in AS but I feel like spending a day or
>>>two
>>> >> trying to see if there is a way we can be more general about it.
>>> >
>>> >Well, it woul

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-10-08 Thread Alex Harui
I just pushed a bunch of changes to the flex-asjs repo in the
Core_js_to_as branch that shows that I could replace several dozen classes
that were written in JS with AS that cross-compiles to the equivalent JS.

There are many more classes to port, but I think this is the right
direction to go for many reasons:
1) It helps prove out the whole AS to JS story
2) It will reduce errors
3) It will improve consistency between the SWF and JS versions
4) More code gets shared.

The only downside I’ve found so far is that it can get a bit ugly if the
class inheritance isn’t exactly the same (which is isn’t in a few places).
 But I think the trade-off is worth it.  I still have to tidy up the build
scripts a bit.  Does anybody have time to pitch in on the rest of the
port?  If so, I will prioritize a wiki page on what to do.

This exercise also found many bugs in Falcon.  I just pushed those changes
too.  And I’ve pushed those changes to the develop branch.  There is no
need for a separate branch for the Falcon code required to cross-compile
this AS to JS right now (and hopefully never in the future either).

So, those Falcon changes will go out in the next release, whereas the
flex-asjs changes will wait for the next release after we complete the
port.

I would really like to get a release of Falcon and FlexJS soon.  I guess I
will now try to spend some time trying to make it easier to download and
build the source packages.  Separate thread on that coming up.

-Alex

On 9/18/15, 10:26 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:

>> Yeah, I’m just looking ahead and am in the mood to play in the compiler
>> code.  I figure some day we’ll have a true GCL swc, either by making
>> EXTERNC more tolerant, or because a d.ts file for GCL will be converted
>>to
>> externs.
>> 
>> I’m also expecting that some day as we go further into this port from JS
>> back to AS, that we’ll hit some code or write some code where we need
>>both
>> GCL.swc and JS.swc and I would expect collisions between Event and
>> EventTarget in such a case, even with the stubbed GCL.swc we currently
>> have, so I’m exploring ways to deal with that.
>
>Fair enough, would be awesome !
>
>Thanks,
>Frédéric THOMAS
>
>> From: aha...@adobe.com
>> To: dev@flex.apache.org
>> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
>> Date: Fri, 18 Sep 2015 17:00:51 +
>> 
>> 
>> 
>> On 9/18/15, 9:42 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
>> 
>> >> IMO, the externs swcs are also for developers wanting to build
>>“native”
>> >>JS
>> >> applications without the FlexJS components, so any GCL.swc needs to
>> >> support some developer using GCL and native JS.  So the two swcs
>>need to
>> >> be compatible with each other.   We could just hack up a GCL just to
>>get
>> >> the FlexJS JS to be written in AS but I feel like spending a day or
>>two
>> >> trying to see if there is a way we can be more general about it.
>> >
>> >Well, it would be nice if the EXTERNC could compile it all to .as but
>> >IIRC, it was far to be able to do it, the reason why I didn't consider
>>it
>> >as another extern but only as a stub with the only purpose I described
>> >before.
>> >Now, if you can compile it entirely to .as, what you're saying would
>>make
>> >more sense to me indeed but for now, only a part of the Event API has
>> >been included and for a big part, it was by hand.
>> 
>> Yeah, I’m just looking ahead and am in the mood to play in the compiler
>> code.  I figure some day we’ll have a true GCL swc, either by making
>> EXTERNC more tolerant, or because a d.ts file for GCL will be converted
>>to
>> externs.
>> 
>> I’m also expecting that some day as we go further into this port from JS
>> back to AS, that we’ll hit some code or write some code where we need
>>both
>> GCL.swc and JS.swc and I would expect collisions between Event and
>> EventTarget in such a case, even with the stubbed GCL.swc we currently
>> have, so I’m exploring ways to deal with that.
>> 
>> -Alex
>> 
> 



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-28 Thread Alex Harui
OK, I got GCL to compile by disambiguating the global classes and also got
Falcon to allow keywords as method names so Language.is and Language.as
don’t need “_” any more and merged it all into the flex-falcon develop
branch.

I pushed a bunch of commits to the core_js_to_as branch of flex-asjs that
compiles Application.js from Application.as without compiler errors.  The
output looks reasonable to me.  I commented out the reference to ViewBase
in Application in order to get this to happen.

The next step is to uncomment ViewBase in Application and get ViewBase and
its dependencies ported from js back to as, but, if you look at the
changes I made, I’m doing more fine-grained conditional compilation (per
method instead of per-class) and we’ve done enough refactoring in
ViewBase.js and some other classes that I think I’m going to attempt to
merge from develop into core_js_to_as first before continuing.

Thoughts?

-Alex




On 9/18/15, 10:26 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:

>> Yeah, I’m just looking ahead and am in the mood to play in the compiler
>> code.  I figure some day we’ll have a true GCL swc, either by making
>> EXTERNC more tolerant, or because a d.ts file for GCL will be converted
>>to
>> externs.
>> 
>> I’m also expecting that some day as we go further into this port from JS
>> back to AS, that we’ll hit some code or write some code where we need
>>both
>> GCL.swc and JS.swc and I would expect collisions between Event and
>> EventTarget in such a case, even with the stubbed GCL.swc we currently
>> have, so I’m exploring ways to deal with that.
>
>Fair enough, would be awesome !
>
>Thanks,
>Frédéric THOMAS
>
>> From: aha...@adobe.com
>> To: dev@flex.apache.org
>> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
>> Date: Fri, 18 Sep 2015 17:00:51 +
>> 
>> 
>> 
>> On 9/18/15, 9:42 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
>> 
>> >> IMO, the externs swcs are also for developers wanting to build
>>“native”
>> >>JS
>> >> applications without the FlexJS components, so any GCL.swc needs to
>> >> support some developer using GCL and native JS.  So the two swcs
>>need to
>> >> be compatible with each other.   We could just hack up a GCL just to
>>get
>> >> the FlexJS JS to be written in AS but I feel like spending a day or
>>two
>> >> trying to see if there is a way we can be more general about it.
>> >
>> >Well, it would be nice if the EXTERNC could compile it all to .as but
>> >IIRC, it was far to be able to do it, the reason why I didn't consider
>>it
>> >as another extern but only as a stub with the only purpose I described
>> >before.
>> >Now, if you can compile it entirely to .as, what you're saying would
>>make
>> >more sense to me indeed but for now, only a part of the Event API has
>> >been included and for a big part, it was by hand.
>> 
>> Yeah, I’m just looking ahead and am in the mood to play in the compiler
>> code.  I figure some day we’ll have a true GCL swc, either by making
>> EXTERNC more tolerant, or because a d.ts file for GCL will be converted
>>to
>> externs.
>> 
>> I’m also expecting that some day as we go further into this port from JS
>> back to AS, that we’ll hit some code or write some code where we need
>>both
>> GCL.swc and JS.swc and I would expect collisions between Event and
>> EventTarget in such a case, even with the stubbed GCL.swc we currently
>> have, so I’m exploring ways to deal with that.
>> 
>> -Alex
>> 
> 



Re: Ambiguous Definitions (was Re: [FlexJS] Framework using externs (was: Setup Error))

2015-09-22 Thread Alex Harui
OK, I think I got this working and pushed it to the JsToAs branch of
Falcon.

I’m going to take on allowing keywords to be used for function names and
some other places as I noticed it is affecting the JS to AS port as well.

-Alex

On 9/19/15, 1:57 PM, "Josh Tynjala"  wrote:

>Yeah, changing FalconJX to handle window as a special case would work too.
>It would make things easier on other tools, like externc and dts2as. As a
>bonus, while it's a simple string that we wanted to avoid, it's actually
>valid JS, so it wouldn't have as much potential for conflict. I think I
>like this idea.
>
>In regards to putting variables/properties in packages, it's possible in
>AS3. In Feathers, I created a feathers.FEATHERS_VERSION constant a while
>back. While I used const there, I assume that var would be valid too.
>
>package feathers
>{
>public const FEATHERS_VERSION:String = "2.2.0";
>}
>
>https://github.com/BowlerHatLLC/feathers/blob/v2.2.0/source/feathers/FEATH
>ERS_VERSION.as
>
>It even shows up in the API documentation:
>
>http://feathersui.com/api-reference/feathers/package-detail.html
>
>I suspect that getters and setters might not work in a package, though.
>
>- Josh
>
>On Sat, Sep 19, 2015 at 1:36 PM, Alex Harui  wrote:
>
>> Inline as well, gotta scroll way down for my latest proposal.
>>
>> On 9/19/15, 9:01 AM, "Josh Tynjala"  wrote:
>>
>> >Responses inline.
>> >
>> >- Josh
>> >
>> >On Sat, Sep 19, 2015 at 8:03 AM, Alex Harui  wrote:
>> >
>> >>
>> >> Hmm.  Maybe, but what does that sort of import really do?  Why not
>>just
>> >> create a global subclass of goog.events.Event?
>> >>
>> >
>> >A global subclass would work only if you were creating all instances.
>>If
>> >you need to use the class as a method argument, where the arguments
>>come
>> >from somewhere else that might not be using the subclass, the global
>> >subclass would not work:
>> >
>> >private function listener(event:GoogEvent):void //runtime error
>>because it
>> >might receive goog.events.Event
>> >
>> >If what imports do is say, "every time that you find Event, replace it
>> >with
>> >goog.events.Event", then this new syntax would allow a little more
>> >flexibility "every time that you find GoogEvent, replace it with
>> >goog.events.Event".
>>
>> Well, that would be a big and scary change.  For some reason I don’t
>>know,
>> imports open namespaces for multi name lookups at runtime.
>>
>> What’s interesting about the TS import is it puts you on the slippery
>> slope towards preprocessor macros.
>>
>> >
>> >
>> >> BTW, I realized that the choices should have had more examples.
>>Maybe:
>> >>
>> >>   var foo:.Event;
>> >>
>> >> doesn’t looks so bad, but once you fill it out further:
>> >>
>> >>   var foo:.Event = new .Event();
>> >>   var bar:.Event = foo as .Event();
>> >>   var baz:.Event = .Event(foo);
>> >>
>> >> Do we still like it?  I think I have found one place to try to
>>change to
>> >> make it work.
>> >>
>> >
>> >If the global Event can be used without any qualifier, this wouldn't be
>> >necessary. However, yes, I think I still like it the same. I would say
>> >that
>> >the most difficult thing to read is the colon followed by the dot (:.),
>> >but
>> >that was in the original example
>> >
>> >Another option is to throw in some double underscores to try to avoid
>> >naming conflicts:
>> >
>> >__global__.Event
>> >
>> >I think I'd still prefer .Event, though.
>> >
>> >
>> >> However, my new thought of the day is this:
>> >>
>> >> For SWFs, we can discourage folks from making conflicts with classes
>>in
>> >> the “global” package so this is really for JS users.  But don’t folks
>> >> doing native JS already have the option of using “window” as the
>>package
>> >> name?
>> >>
>> >>   import window.Event;
>> >>   var foo:window.Event = new window.Event();
>> >>
>> >> Could we auto-replace Event with window.Event when generating externs
>> >>and
>> >> then require folks to use window.Event when they want the “global”
>>ones?
>> >>
>> >
>> >I had never considered window to be like a package before. That's a
>>very
>> >interesting idea.
>> >
>> >It's worth noting that window has its own member variables too, so it's
>> >not
>> >only classes that are stored there. Will there be a conflict if both a
>> >window global variable and a window package exist? I guess, since AS3
>> >supports variables and functions inside a package, window wouldn't
>> >necessarily need to be a global variable. We could just move everything
>> >into the package.
>>
>> Actually, we’ve already hit this trying to stub GCL for FlexJS.  GCL has
>> functions and variables on goog.events like goog.events.fireListener,
>>and
>> then classes like goog.events.EventTarget.  I don’t recall any AS
>> variables/properties on packages in AS3 because I think packages are not
>> objects in AS3 like they are in JS.  So we created a class in the goog
>> package called events (lower case) and put 

Re: Ambiguous Definitions (was Re: [FlexJS] Framework using externs (was: Setup Error))

2015-09-19 Thread Alex Harui
Inline as well, gotta scroll way down for my latest proposal.

On 9/19/15, 9:01 AM, "Josh Tynjala"  wrote:

>Responses inline.
>
>- Josh
>
>On Sat, Sep 19, 2015 at 8:03 AM, Alex Harui  wrote:
>
>>
>> Hmm.  Maybe, but what does that sort of import really do?  Why not just
>> create a global subclass of goog.events.Event?
>>
>
>A global subclass would work only if you were creating all instances. If
>you need to use the class as a method argument, where the arguments come
>from somewhere else that might not be using the subclass, the global
>subclass would not work:
>
>private function listener(event:GoogEvent):void //runtime error because it
>might receive goog.events.Event
>
>If what imports do is say, "every time that you find Event, replace it
>with
>goog.events.Event", then this new syntax would allow a little more
>flexibility "every time that you find GoogEvent, replace it with
>goog.events.Event".

Well, that would be a big and scary change.  For some reason I don’t know,
imports open namespaces for multi name lookups at runtime.

What’s interesting about the TS import is it puts you on the slippery
slope towards preprocessor macros.

>
>
>> BTW, I realized that the choices should have had more examples.  Maybe:
>>
>>   var foo:.Event;
>>
>> doesn’t looks so bad, but once you fill it out further:
>>
>>   var foo:.Event = new .Event();
>>   var bar:.Event = foo as .Event();
>>   var baz:.Event = .Event(foo);
>>
>> Do we still like it?  I think I have found one place to try to change to
>> make it work.
>>
>
>If the global Event can be used without any qualifier, this wouldn't be
>necessary. However, yes, I think I still like it the same. I would say
>that
>the most difficult thing to read is the colon followed by the dot (:.),
>but
>that was in the original example
>
>Another option is to throw in some double underscores to try to avoid
>naming conflicts:
>
>__global__.Event
>
>I think I'd still prefer .Event, though.
>
>
>> However, my new thought of the day is this:
>>
>> For SWFs, we can discourage folks from making conflicts with classes in
>> the “global” package so this is really for JS users.  But don’t folks
>> doing native JS already have the option of using “window” as the package
>> name?
>>
>>   import window.Event;
>>   var foo:window.Event = new window.Event();
>>
>> Could we auto-replace Event with window.Event when generating externs
>>and
>> then require folks to use window.Event when they want the “global” ones?
>>
>
>I had never considered window to be like a package before. That's a very
>interesting idea.
>
>It's worth noting that window has its own member variables too, so it's
>not
>only classes that are stored there. Will there be a conflict if both a
>window global variable and a window package exist? I guess, since AS3
>supports variables and functions inside a package, window wouldn't
>necessarily need to be a global variable. We could just move everything
>into the package.

Actually, we’ve already hit this trying to stub GCL for FlexJS.  GCL has
functions and variables on goog.events like goog.events.fireListener, and
then classes like goog.events.EventTarget.  I don’t recall any AS
variables/properties on packages in AS3 because I think packages are not
objects in AS3 like they are in JS.  So we created a class in the goog
package called events (lower case) and put the same variables GCL puts on
its JS goog.events object.  One of my latest commits changes the compiler
to try goog.events as both a package and a class.

So yes, in theory we would have a class in the default package called
“window” but also classes in the “window” package called Events.

>
>externc would need to be updated with a new optional argument to say that
>globals should be put into a package. I think that this package name
>should
>be configurable, to support other hypothetical JS environments.

Well, that’s true if we do it the “legitimate” way.  But that might also
force everyone using js.swc to start every file with “import windows.*”
which is acceptable to me, but let me describe a possible “hack”.

I think we could make “window” a special word in FalconJX and when
creating package namespaces, collapse it down to “” (empty string) which
is equivalent to the default package.  Then, if you are just writing plain
JS and don’t import any other class called Event, you can just use Event
without any import statement or package prefix and it would just work.  No
changes to ExternC or any existing code.

Then, if you import an Event class like goog.events.Event, the
AmbiguousDefinition logic would look at the file scope to see if there was
an “import window.Event;”.  If there isn't, it will assume you meant
goog.events.Event because not importing window.Event would mean you never
intended to use the class in the default package.

It would be only in the rare case where you import both goog.events.Event
and window.Event that you would start getting 

Re: Ambiguous Definitions (was Re: [FlexJS] Framework using externs (was: Setup Error))

2015-09-19 Thread Josh Tynjala
Yeah, changing FalconJX to handle window as a special case would work too.
It would make things easier on other tools, like externc and dts2as. As a
bonus, while it's a simple string that we wanted to avoid, it's actually
valid JS, so it wouldn't have as much potential for conflict. I think I
like this idea.

In regards to putting variables/properties in packages, it's possible in
AS3. In Feathers, I created a feathers.FEATHERS_VERSION constant a while
back. While I used const there, I assume that var would be valid too.

package feathers
{
public const FEATHERS_VERSION:String = "2.2.0";
}

https://github.com/BowlerHatLLC/feathers/blob/v2.2.0/source/feathers/FEATHERS_VERSION.as

It even shows up in the API documentation:

http://feathersui.com/api-reference/feathers/package-detail.html

I suspect that getters and setters might not work in a package, though.

- Josh

On Sat, Sep 19, 2015 at 1:36 PM, Alex Harui  wrote:

> Inline as well, gotta scroll way down for my latest proposal.
>
> On 9/19/15, 9:01 AM, "Josh Tynjala"  wrote:
>
> >Responses inline.
> >
> >- Josh
> >
> >On Sat, Sep 19, 2015 at 8:03 AM, Alex Harui  wrote:
> >
> >>
> >> Hmm.  Maybe, but what does that sort of import really do?  Why not just
> >> create a global subclass of goog.events.Event?
> >>
> >
> >A global subclass would work only if you were creating all instances. If
> >you need to use the class as a method argument, where the arguments come
> >from somewhere else that might not be using the subclass, the global
> >subclass would not work:
> >
> >private function listener(event:GoogEvent):void //runtime error because it
> >might receive goog.events.Event
> >
> >If what imports do is say, "every time that you find Event, replace it
> >with
> >goog.events.Event", then this new syntax would allow a little more
> >flexibility "every time that you find GoogEvent, replace it with
> >goog.events.Event".
>
> Well, that would be a big and scary change.  For some reason I don’t know,
> imports open namespaces for multi name lookups at runtime.
>
> What’s interesting about the TS import is it puts you on the slippery
> slope towards preprocessor macros.
>
> >
> >
> >> BTW, I realized that the choices should have had more examples.  Maybe:
> >>
> >>   var foo:.Event;
> >>
> >> doesn’t looks so bad, but once you fill it out further:
> >>
> >>   var foo:.Event = new .Event();
> >>   var bar:.Event = foo as .Event();
> >>   var baz:.Event = .Event(foo);
> >>
> >> Do we still like it?  I think I have found one place to try to change to
> >> make it work.
> >>
> >
> >If the global Event can be used without any qualifier, this wouldn't be
> >necessary. However, yes, I think I still like it the same. I would say
> >that
> >the most difficult thing to read is the colon followed by the dot (:.),
> >but
> >that was in the original example
> >
> >Another option is to throw in some double underscores to try to avoid
> >naming conflicts:
> >
> >__global__.Event
> >
> >I think I'd still prefer .Event, though.
> >
> >
> >> However, my new thought of the day is this:
> >>
> >> For SWFs, we can discourage folks from making conflicts with classes in
> >> the “global” package so this is really for JS users.  But don’t folks
> >> doing native JS already have the option of using “window” as the package
> >> name?
> >>
> >>   import window.Event;
> >>   var foo:window.Event = new window.Event();
> >>
> >> Could we auto-replace Event with window.Event when generating externs
> >>and
> >> then require folks to use window.Event when they want the “global” ones?
> >>
> >
> >I had never considered window to be like a package before. That's a very
> >interesting idea.
> >
> >It's worth noting that window has its own member variables too, so it's
> >not
> >only classes that are stored there. Will there be a conflict if both a
> >window global variable and a window package exist? I guess, since AS3
> >supports variables and functions inside a package, window wouldn't
> >necessarily need to be a global variable. We could just move everything
> >into the package.
>
> Actually, we’ve already hit this trying to stub GCL for FlexJS.  GCL has
> functions and variables on goog.events like goog.events.fireListener, and
> then classes like goog.events.EventTarget.  I don’t recall any AS
> variables/properties on packages in AS3 because I think packages are not
> objects in AS3 like they are in JS.  So we created a class in the goog
> package called events (lower case) and put the same variables GCL puts on
> its JS goog.events object.  One of my latest commits changes the compiler
> to try goog.events as both a package and a class.
>
> So yes, in theory we would have a class in the default package called
> “window” but also classes in the “window” package called Events.
>
> >
> >externc would need to be updated with a new optional argument to say that
> >globals should be put into a package. I think that this package 

Re: Ambiguous Definitions (was Re: [FlexJS] Framework using externs (was: Setup Error))

2015-09-19 Thread Alex Harui


On 9/19/15, 7:43 AM, "Josh Tynjala"  wrote:

>I think that making it possible to reference a class in the global
>package,
>even when another class with the same name is imported, is a good
>improvement. Probably easiest to implement.
>
>Along the same lines as an unimport, what if we could do something like
>this to remove ambiguity:
>
>import GoogEvent = goog.events.Event;
>
>TypeScript supports this kind of import, and it's very useful for removing
>ambiguity. I really wish AS3 had it. It would have made importing both
>Flash events and Starling events so much easier.

Hmm.  Maybe, but what does that sort of import really do?  Why not just
create a global subclass of goog.events.Event?


BTW, I realized that the choices should have had more examples.  Maybe:

  var foo:.Event;

doesn’t looks so bad, but once you fill it out further:

  var foo:.Event = new .Event();
  var bar:.Event = foo as .Event();
  var baz:.Event = .Event(foo);

Do we still like it?  I think I have found one place to try to change to
make it work.

However, my new thought of the day is this:

For SWFs, we can discourage folks from making conflicts with classes in
the “global” package so this is really for JS users.  But don’t folks
doing native JS already have the option of using “window” as the package
name?

  import window.Event;
  var foo:window.Event = new window.Event();

Could we auto-replace Event with window.Event when generating externs and
then require folks to use window.Event when they want the “global” ones?

-Alex



Re: Ambiguous Definitions (was Re: [FlexJS] Framework using externs (was: Setup Error))

2015-09-19 Thread Josh Tynjala
I think that making it possible to reference a class in the global package,
even when another class with the same name is imported, is a good
improvement. Probably easiest to implement.

Along the same lines as an unimport, what if we could do something like
this to remove ambiguity:

import GoogEvent = goog.events.Event;

TypeScript supports this kind of import, and it's very useful for removing
ambiguity. I really wish AS3 had it. It would have made importing both
Flash events and Starling events so much easier.

- Josh
On Sep 18, 2015 10:28 PM, "Alex Harui"  wrote:

> I’m still digging into the compiler, but I had some new thoughts:
>
> What if you only got an ambiguous definition error if you had two classes
> neither of which is in the global package and didn’t qualify its usage?
> This might be easiest to implement.  If we did that, then:
>
> Scenario 1:
> import flash.events.Event;
> import org.apache.flex.events.Event;
>
> var foo:Event; // ambiguous definition error
>
>
> Scenario 2 (using js.swc):
> import goog.events.Event;
>
> var foo:Event;  // always uses global package Event
> var bar:Event = new goog.events.Event(); // error since bar is global
> Event type
> Var baz:Event = new Event(); // no error but instantiates global Event
>
> This would mean that, for folks using js.swc, you couldn’t just import
> some class in a package that conflicts with a global package class and use
> it without fully qualifying it.
>
> We could add a config option to warn instead of error on use of global
> package classes.
>
> Even crazier, we could add an “unimport” directive or some compiler
> option, asdoc tag, or metadata that does the same and tells the compiler
> to never resolve to the global package.
>
> Thoughts?
> -Alex
>
> On 9/18/15, 12:09 PM, "Alex Harui"  wrote:
>
> >
> >
> >On 9/18/15, 11:54 AM, "Josh Tynjala"  wrote:
> >
> >>Of the options that you presented, I think I like  *.Event and .Event the
> >>most.
> >>
> >>The options with :: don't feel quite right. While I know that packages
> >>are
> >>namespaces (I remember making that discovery back in the day and
> >>excitedly
> >>blogging about it), other classes aren't usually referenced with :: in
> >>code. With that in mind, I like . better than :: because the . is more
> >>consistent. If it were somehow easier to implement, though, I could live
> >>with it.
> >>
> >>A simple string like global or null might conflict with some top-level
> >>variable in user code or in the standard library of some JS environment,
> >>so
> >>I think that style should be avoided.
> >
> >Agreed.
> >
> >>
> >>Of the two between *.Event and .Event, I'm not quite sure which I like
> >>better. Which of these seems more readable?
> >>
> >>var myVar:.Event = new .Event();
> >>
> >>var myVar:*.Event = new *.Event();
> >>
> >>At first, I thought I liked *.Event better, but I might be preferring
> >>.Event more now.
> >
> >Yeah, it might be easier grammar-wise to have something in front of the
> >‘.’.  I’m still digging into the compiler.  I will report my findings and
> >recommendations before committing anything.
> >
> >-Alex
> >
>
>


Re: Ambiguous Definitions (was Re: [FlexJS] Framework using externs (was: Setup Error))

2015-09-19 Thread Josh Tynjala
Responses inline.

- Josh

On Sat, Sep 19, 2015 at 8:03 AM, Alex Harui  wrote:

>
> Hmm.  Maybe, but what does that sort of import really do?  Why not just
> create a global subclass of goog.events.Event?
>

A global subclass would work only if you were creating all instances. If
you need to use the class as a method argument, where the arguments come
from somewhere else that might not be using the subclass, the global
subclass would not work:

private function listener(event:GoogEvent):void //runtime error because it
might receive goog.events.Event

If what imports do is say, "every time that you find Event, replace it with
goog.events.Event", then this new syntax would allow a little more
flexibility "every time that you find GoogEvent, replace it with
goog.events.Event".


> BTW, I realized that the choices should have had more examples.  Maybe:
>
>   var foo:.Event;
>
> doesn’t looks so bad, but once you fill it out further:
>
>   var foo:.Event = new .Event();
>   var bar:.Event = foo as .Event();
>   var baz:.Event = .Event(foo);
>
> Do we still like it?  I think I have found one place to try to change to
> make it work.
>

If the global Event can be used without any qualifier, this wouldn't be
necessary. However, yes, I think I still like it the same. I would say that
the most difficult thing to read is the colon followed by the dot (:.), but
that was in the original example

Another option is to throw in some double underscores to try to avoid
naming conflicts:

__global__.Event

I think I'd still prefer .Event, though.


> However, my new thought of the day is this:
>
> For SWFs, we can discourage folks from making conflicts with classes in
> the “global” package so this is really for JS users.  But don’t folks
> doing native JS already have the option of using “window” as the package
> name?
>
>   import window.Event;
>   var foo:window.Event = new window.Event();
>
> Could we auto-replace Event with window.Event when generating externs and
> then require folks to use window.Event when they want the “global” ones?
>

I had never considered window to be like a package before. That's a very
interesting idea.

It's worth noting that window has its own member variables too, so it's not
only classes that are stored there. Will there be a conflict if both a
window global variable and a window package exist? I guess, since AS3
supports variables and functions inside a package, window wouldn't
necessarily need to be a global variable. We could just move everything
into the package.

externc would need to be updated with a new optional argument to say that
globals should be put into a package. I think that this package name should
be configurable, to support other hypothetical JS environments.


Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Josh Tynjala
I was just trying to understand the AS3 namespace a little bit yesterday
while fixing some issues in dts2as. It appears that the AS3 namespace is
used to allow certain functions on the Object class, like toString() and
valueOf(), to be implemented in subclasses without requiring the override
keyword. I think the AS3 namespace is always available, so it ends up
acting similarly to public. Kind of interesting.

Back on topic, yes, I agree some kind of token or keyword should be used to
designate the global namespace. Like you, I'm a little wary of using the
existing AS3 namespace identifier for that.

Of the options that you presented, I think I like  *.Event and .Event the
most.

The options with :: don't feel quite right. While I know that packages are
namespaces (I remember making that discovery back in the day and excitedly
blogging about it), other classes aren't usually referenced with :: in
code. With that in mind, I like . better than :: because the . is more
consistent. If it were somehow easier to implement, though, I could live
with it.

A simple string like global or null might conflict with some top-level
variable in user code or in the standard library of some JS environment, so
I think that style should be avoided.

Of the two between *.Event and .Event, I'm not quite sure which I like
better. Which of these seems more readable?

var myVar:.Event = new .Event();

var myVar:*.Event = new *.Event();

At first, I thought I liked *.Event better, but I might be preferring
.Event more now.

- Josh


On Fri, Sep 18, 2015 at 9:38 AM, Alex Harui  wrote:

>
>
> On 9/18/15, 9:02 AM, "Josh Tynjala"  wrote:
>
> >I don't think that there's a currently a way to explicitly specify the
> >global namespace in a fully-qualified class name. I suspect it rarely came
> >up in the Flash runtime because it has so few global classes. This would
> >be
> >very useful with the very large number of classes in the JavaScript global
> >namespace, though. I hope you can figure out how to add it!
>
> I don’t know if there is currently a way or not.  I’m currently stepping
> through the lexer/parser to see how it handles namespaces.  The concept of
> namespaces is heavily used within the compiler.  There appear to be
> special namespaces like “public”, “protected” and “private” and user
> defined namespaces (like mx_internal) and packages are also namespaces and
> not objects like they are in JS.
>
> If there isn’t a current way, my first thoughts are to designate a special
> token or keyword for a user-defined namespace that implies the global
> namespace or trick the package namespace lexer/tokenizer to allow
> something.
>
> For example, user-defined namespaces are indicated in-line with ‘::’ as in:
>   mx_internal::someVar
>
> And package namespaces are indicated with a dot-path expression to fully
> qualify something as in:
>   org.apache.flex.events.Event
>
> So maybe one of the following can currently be used or the compiler can be
> taught to use as a way to fully qualify the “global” package/namespace.
>
>   ::Event  // nothing in front of the user-defined namespace delimiter
>   null::Event
>   global::Event
>   *::Event
>   *.Event
>   null.Event
>   .Event   // nothing in front of the package path delimiter
>
> FWIW, there appear to be “hidden” namespaces for the builtins like Object,
> Array, String. I see use of:
>
>   http://adobe.com/AS3/2006/builtin
>
> and
>
>   AS3
>
> as namespaces in the compiler code.  We could use AS3 as the special
> keyword so
>
>   AS3::Event
>
> is the Event in the global namespace, but that doesn’t feel right to me.
> I’m leaning towards keeping these namespaces for the true builtins for AS
> and JS.  But I’m open to change on that.
>
> Thoughts?
> -Alex
>
>


Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Alex Harui


On 9/18/15, 11:54 AM, "Josh Tynjala"  wrote:

>Of the options that you presented, I think I like  *.Event and .Event the
>most.
>
>The options with :: don't feel quite right. While I know that packages are
>namespaces (I remember making that discovery back in the day and excitedly
>blogging about it), other classes aren't usually referenced with :: in
>code. With that in mind, I like . better than :: because the . is more
>consistent. If it were somehow easier to implement, though, I could live
>with it.
>
>A simple string like global or null might conflict with some top-level
>variable in user code or in the standard library of some JS environment,
>so
>I think that style should be avoided.

Agreed.

>
>Of the two between *.Event and .Event, I'm not quite sure which I like
>better. Which of these seems more readable?
>
>var myVar:.Event = new .Event();
>
>var myVar:*.Event = new *.Event();
>
>At first, I thought I liked *.Event better, but I might be preferring
>.Event more now.

Yeah, it might be easier grammar-wise to have something in front of the
‘.’.  I’m still digging into the compiler.  I will report my findings and
recommendations before committing anything.

-Alex



Ambiguous Definitions (was Re: [FlexJS] Framework using externs (was: Setup Error))

2015-09-18 Thread Alex Harui
I’m still digging into the compiler, but I had some new thoughts:

What if you only got an ambiguous definition error if you had two classes
neither of which is in the global package and didn’t qualify its usage?
This might be easiest to implement.  If we did that, then:

Scenario 1:
import flash.events.Event;
import org.apache.flex.events.Event;

var foo:Event; // ambiguous definition error


Scenario 2 (using js.swc):
import goog.events.Event;

var foo:Event;  // always uses global package Event
var bar:Event = new goog.events.Event(); // error since bar is global
Event type
Var baz:Event = new Event(); // no error but instantiates global Event

This would mean that, for folks using js.swc, you couldn’t just import
some class in a package that conflicts with a global package class and use
it without fully qualifying it.

We could add a config option to warn instead of error on use of global
package classes.

Even crazier, we could add an “unimport” directive or some compiler
option, asdoc tag, or metadata that does the same and tells the compiler
to never resolve to the global package.

Thoughts?
-Alex

On 9/18/15, 12:09 PM, "Alex Harui"  wrote:

>
>
>On 9/18/15, 11:54 AM, "Josh Tynjala"  wrote:
>
>>Of the options that you presented, I think I like  *.Event and .Event the
>>most.
>>
>>The options with :: don't feel quite right. While I know that packages
>>are
>>namespaces (I remember making that discovery back in the day and
>>excitedly
>>blogging about it), other classes aren't usually referenced with :: in
>>code. With that in mind, I like . better than :: because the . is more
>>consistent. If it were somehow easier to implement, though, I could live
>>with it.
>>
>>A simple string like global or null might conflict with some top-level
>>variable in user code or in the standard library of some JS environment,
>>so
>>I think that style should be avoided.
>
>Agreed.
>
>>
>>Of the two between *.Event and .Event, I'm not quite sure which I like
>>better. Which of these seems more readable?
>>
>>var myVar:.Event = new .Event();
>>
>>var myVar:*.Event = new *.Event();
>>
>>At first, I thought I liked *.Event better, but I might be preferring
>>.Event more now.
>
>Yeah, it might be easier grammar-wise to have something in front of the
>‘.’.  I’m still digging into the compiler.  I will report my findings and
>recommendations before committing anything.
>
>-Alex
>



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Alex Harui


On 9/18/15, 6:19 AM, "Frédéric THOMAS"  wrote:

>> By commenting out the use of ViewBase from Application.as, I was able to
>> get Application.as to compile without errors and got what looked like a
>> reasonable list of goog.requires without changing any compiler.clients
>> classes.
>
>Have you try to run the compile-as-to-js-core-application-using-falcon
>target in the core build ?
>with this one and the convertion I did, I was able to build Application
>too without removing anything.
>
>I issue I had was with compile-as-to-js-core-application-using-oem.

I didn’t try that target yet.  I will probably try later today.

>
>> I did notice that the method bodies that had conditional compilation
>> didn’t output anything so I’m going to look at that next.  Or is that
>>what
>> you tried to fix by changing compiler.clients.*?
>
>No, it wasn't that, it seems you discovered another issue.

I have that issue fixed locally and saw what looked like a good
Application.js get generated, but I didn’t try running it yet.  I will
probably convert a few more classes like ViewBase and then swap those
generated .js files into an existing app and see what happens.

>
>Btw, I won't be able to work on it this weekend, that's my birthday and
>I'm going to party (a lot) and on Monday I'm starting on a new role, not
>sure how much it will suck my brain yet.

OK, sounds good.  Happy Birthday, and good luck with your new role.

I’ve been trying to get your GCL.swc to build from Ant without requiring
an application.home systemProperty.  I ran into an issue with missing
builtins like Object.  It could be that IJ injects these builtins no
matter what.  From Ant I need to have GCL depend on js.swc, but then I get
other conflicts that I am trying to sort through in the compiler.

-Alex
  



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Frédéric THOMAS
> By commenting out the use of ViewBase from Application.as, I was able to
> get Application.as to compile without errors and got what looked like a
> reasonable list of goog.requires without changing any compiler.clients
> classes.

Have you try to run the compile-as-to-js-core-application-using-falcon target 
in the core build ?
with this one and the convertion I did, I was able to build Application too 
without removing anything.

I issue I had was with compile-as-to-js-core-application-using-oem.

> I did notice that the method bodies that had conditional compilation
> didn’t output anything so I’m going to look at that next.  Or is that what
> you tried to fix by changing compiler.clients.*?

No, it wasn't that, it seems you discovered another issue.

Btw, I won't be able to work on it this weekend, that's my birthday and I'm 
going to party (a lot) and on Monday I'm starting on a new role, not sure how 
much it will suck my brain yet.

Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Thu, 17 Sep 2015 18:37:30 +
> 
> 
> 
> On 9/17/15, 10:05 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> >
> >> Do you still have the missing goog.require problem?
> >
> >Yes but I will fix that, the compiler.clients.* used directly does not
> >create the issue.
> 
> By commenting out the use of ViewBase from Application.as, I was able to
> get Application.as to compile without errors and got what looked like a
> reasonable list of goog.requires without changing any compiler.clients
> classes.
> 
> I did notice that the method bodies that had conditional compilation
> didn’t output anything so I’m going to look at that next.  Or is that what
> you tried to fix by changing compiler.clients.*?
> 
> Thanks,
> -Alex
> 
> 
  

RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Frédéric THOMAS
> OK, sounds good.  Happy Birthday, and good luck with your new role.

Thank you.

> I’ve been trying to get your GCL.swc to build from Ant without requiring
> an application.home systemProperty.  I ran into an issue with missing
> builtins like Object.  It could be that IJ injects these builtins no
> matter what.  From Ant I need to have GCL depend on js.swc, but then I get
> other conflicts that I am trying to sort through in the compiler.

That's my conf., basicaly, I removed all the libraries from the SDK to build it 
and don't depend on js.swc either.

http://pastebin.com/q7X3K38E

HTH
Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Fri, 18 Sep 2015 13:34:05 +
> 
> 
> 
> On 9/18/15, 6:19 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >> By commenting out the use of ViewBase from Application.as, I was able to
> >> get Application.as to compile without errors and got what looked like a
> >> reasonable list of goog.requires without changing any compiler.clients
> >> classes.
> >
> >Have you try to run the compile-as-to-js-core-application-using-falcon
> >target in the core build ?
> >with this one and the convertion I did, I was able to build Application
> >too without removing anything.
> >
> >I issue I had was with compile-as-to-js-core-application-using-oem.
> 
> I didn’t try that target yet.  I will probably try later today.
> 
> >
> >> I did notice that the method bodies that had conditional compilation
> >> didn’t output anything so I’m going to look at that next.  Or is that
> >>what
> >> you tried to fix by changing compiler.clients.*?
> >
> >No, it wasn't that, it seems you discovered another issue.
> 
> I have that issue fixed locally and saw what looked like a good
> Application.js get generated, but I didn’t try running it yet.  I will
> probably convert a few more classes like ViewBase and then swap those
> generated .js files into an existing app and see what happens.
> 
> >
> >Btw, I won't be able to work on it this weekend, that's my birthday and
> >I'm going to party (a lot) and on Monday I'm starting on a new role, not
> >sure how much it will suck my brain yet.
> 
> OK, sounds good.  Happy Birthday, and good luck with your new role.
> 
> I’ve been trying to get your GCL.swc to build from Ant without requiring
> an application.home systemProperty.  I ran into an issue with missing
> builtins like Object.  It could be that IJ injects these builtins no
> matter what.  From Ant I need to have GCL depend on js.swc, but then I get
> other conflicts that I am trying to sort through in the compiler.
> 
> -Alex
> 
> 
  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Alex Harui


On 9/18/15, 9:02 AM, "Josh Tynjala"  wrote:

>I don't think that there's a currently a way to explicitly specify the
>global namespace in a fully-qualified class name. I suspect it rarely came
>up in the Flash runtime because it has so few global classes. This would
>be
>very useful with the very large number of classes in the JavaScript global
>namespace, though. I hope you can figure out how to add it!

I don’t know if there is currently a way or not.  I’m currently stepping
through the lexer/parser to see how it handles namespaces.  The concept of
namespaces is heavily used within the compiler.  There appear to be
special namespaces like “public”, “protected” and “private” and user
defined namespaces (like mx_internal) and packages are also namespaces and
not objects like they are in JS.

If there isn’t a current way, my first thoughts are to designate a special
token or keyword for a user-defined namespace that implies the global
namespace or trick the package namespace lexer/tokenizer to allow
something.

For example, user-defined namespaces are indicated in-line with ‘::’ as in:
  mx_internal::someVar

And package namespaces are indicated with a dot-path expression to fully
qualify something as in:
  org.apache.flex.events.Event

So maybe one of the following can currently be used or the compiler can be
taught to use as a way to fully qualify the “global” package/namespace.

  ::Event  // nothing in front of the user-defined namespace delimiter
  null::Event
  global::Event
  *::Event
  *.Event
  null.Event
  .Event   // nothing in front of the package path delimiter

FWIW, there appear to be “hidden” namespaces for the builtins like Object,
Array, String. I see use of:

  http://adobe.com/AS3/2006/builtin

and

  AS3

as namespaces in the compiler code.  We could use AS3 as the special
keyword so

  AS3::Event

is the Event in the global namespace, but that doesn’t feel right to me.
I’m leaning towards keeping these namespaces for the true builtins for AS
and JS.  But I’m open to change on that.

Thoughts?
-Alex



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Frédéric THOMAS
> IMO, the externs swcs are also for developers wanting to build “native” JS
> applications without the FlexJS components, so any GCL.swc needs to
> support some developer using GCL and native JS.  So the two swcs need to
> be compatible with each other.   We could just hack up a GCL just to get
> the FlexJS JS to be written in AS but I feel like spending a day or two
> trying to see if there is a way we can be more general about it.

Well, it would be nice if the EXTERNC could compile it all to .as but IIRC, it 
was far to be able to do it, the reason why I didn't consider it as another 
extern but only as a stub with the only purpose I described before.
Now, if you can compile it entirely to .as, what you're saying would make more 
sense to me indeed but for now, only a part of the Event API has been included 
and for a big part, it was by hand.

Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Fri, 18 Sep 2015 16:20:21 +
> 
> 
> 
> On 9/18/15, 9:05 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >> Well, some SWC has to provide the builtins like Object, Array, etc.  My
> >> guess is that your config is depending on a playerglobal or airglobal,
> >>and
> >> that does work for me, but I was thinking that long-term we want GCL to
> >> depend on js.swc and use its Object and Event definitions in there
> >>because
> >> that is the true set of classes available to GCL developer at runtime.
> >> For example, in one of API right now I saw use of the Class builtin,
> >>which
> >> doesn’t exist in JS.
> >
> >Hmm, not sure I get your point about why to making it dependent of js.wc.
> >
> >To me, we use the GCL only as a stub to be able to strongly type our
> >code, not for what it means at JS point of you, doing so, until it
> >compiles and provide us with strong types, I'm happy with, am I missing
> >something ?
> >I added it as an external library in the Core and the
> >playerglobal did the trick to build it, why it doesn't work for you ?
> 
> IMO, the externs swcs are also for developers wanting to build “native” JS
> applications without the FlexJS components, so any GCL.swc needs to
> support some developer using GCL and native JS.  So the two swcs need to
> be compatible with each other.   We could just hack up a GCL just to get
> the FlexJS JS to be written in AS but I feel like spending a day or two
> trying to see if there is a way we can be more general about it.
> 
> -Alex
> 
  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Alex Harui


On 9/18/15, 9:42 AM, "Frédéric THOMAS"  wrote:

>> IMO, the externs swcs are also for developers wanting to build “native”
>>JS
>> applications without the FlexJS components, so any GCL.swc needs to
>> support some developer using GCL and native JS.  So the two swcs need to
>> be compatible with each other.   We could just hack up a GCL just to get
>> the FlexJS JS to be written in AS but I feel like spending a day or two
>> trying to see if there is a way we can be more general about it.
>
>Well, it would be nice if the EXTERNC could compile it all to .as but
>IIRC, it was far to be able to do it, the reason why I didn't consider it
>as another extern but only as a stub with the only purpose I described
>before.
>Now, if you can compile it entirely to .as, what you're saying would make
>more sense to me indeed but for now, only a part of the Event API has
>been included and for a big part, it was by hand.

Yeah, I’m just looking ahead and am in the mood to play in the compiler
code.  I figure some day we’ll have a true GCL swc, either by making
EXTERNC more tolerant, or because a d.ts file for GCL will be converted to
externs.

I’m also expecting that some day as we go further into this port from JS
back to AS, that we’ll hit some code or write some code where we need both
GCL.swc and JS.swc and I would expect collisions between Event and
EventTarget in such a case, even with the stubbed GCL.swc we currently
have, so I’m exploring ways to deal with that.

-Alex



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Alex Harui


On 9/18/15, 9:05 AM, "Frédéric THOMAS"  wrote:

>> Well, some SWC has to provide the builtins like Object, Array, etc.  My
>> guess is that your config is depending on a playerglobal or airglobal,
>>and
>> that does work for me, but I was thinking that long-term we want GCL to
>> depend on js.swc and use its Object and Event definitions in there
>>because
>> that is the true set of classes available to GCL developer at runtime.
>> For example, in one of API right now I saw use of the Class builtin,
>>which
>> doesn’t exist in JS.
>
>Hmm, not sure I get your point about why to making it dependent of js.wc.
>
>To me, we use the GCL only as a stub to be able to strongly type our
>code, not for what it means at JS point of you, doing so, until it
>compiles and provide us with strong types, I'm happy with, am I missing
>something ?
>I added it as an external library in the Core and the
>playerglobal did the trick to build it, why it doesn't work for you ?

IMO, the externs swcs are also for developers wanting to build “native” JS
applications without the FlexJS components, so any GCL.swc needs to
support some developer using GCL and native JS.  So the two swcs need to
be compatible with each other.   We could just hack up a GCL just to get
the FlexJS JS to be written in AS but I feel like spending a day or two
trying to see if there is a way we can be more general about it.

-Alex



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Frédéric THOMAS
> Well, some SWC has to provide the builtins like Object, Array, etc.  My
> guess is that your config is depending on a playerglobal or airglobal, and
> that does work for me, but I was thinking that long-term we want GCL to
> depend on js.swc and use its Object and Event definitions in there because
> that is the true set of classes available to GCL developer at runtime.
> For example, in one of API right now I saw use of the Class builtin, which
> doesn’t exist in JS.

Hmm, not sure I get your point about why to making it dependent of js.wc.

To me, we use the GCL only as a stub to be able to strongly type our code, not 
for what it means at JS point of you, doing so, until it compiles and provide 
us with strong types, I'm happy with, am I missing something ?
I added it as an external library in the Core and the 
playerglobal did the trick to build it, why it doesn't work for you ?

Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Fri, 18 Sep 2015 15:04:50 +
> 
> 
> 
> On 9/18/15, 6:56 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >> I’ve been trying to get your GCL.swc to build from Ant without requiring
> >> an application.home systemProperty.  I ran into an issue with missing
> >> builtins like Object.  It could be that IJ injects these builtins no
> >> matter what.  From Ant I need to have GCL depend on js.swc, but then I
> >>get
> >> other conflicts that I am trying to sort through in the compiler.
> >
> >That's my conf., basicaly, I removed all the libraries from the SDK to
> >build it and don't depend on js.swc either.
> >
> >http://pastebin.com/q7X3K38E
> 
> Well, some SWC has to provide the builtins like Object, Array, etc.  My
> guess is that your config is depending on a playerglobal or airglobal, and
> that does work for me, but I was thinking that long-term we want GCL to
> depend on js.swc and use its Object and Event definitions in there because
> that is the true set of classes available to GCL developer at runtime.
> For example, in one of API right now I saw use of the Class builtin, which
> doesn’t exist in JS.
> 
> Using js.swc does cause other errors.  Both GCL and js have Event and
> EventTarget definitions.  I’ve made a tweak to the compiler to not emit an
> AmbiguousDefinition error if it finds a conflict between  global namespace
> definitions and a definition in the same package as the class being
> compiled.  It will always use the one in the same package.  I think we’ll
> probably add more logic to ignore conflicts between global definitions and
> a definition that has been explicitly imported.  Right now, though, I’m on
> a little side-trip to see if there is an already existing way to specify
> the global namespace or if there is an easy way to add one.
> 
> -Alex
> 
  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Josh Tynjala
I don't think that there's a currently a way to explicitly specify the
global namespace in a fully-qualified class name. I suspect it rarely came
up in the Flash runtime because it has so few global classes. This would be
very useful with the very large number of classes in the JavaScript global
namespace, though. I hope you can figure out how to add it!

- Josh

On Fri, Sep 18, 2015 at 8:04 AM, Alex Harui  wrote:

>
>
> On 9/18/15, 6:56 AM, "Frédéric THOMAS"  wrote:
>
> >> I’ve been trying to get your GCL.swc to build from Ant without requiring
> >> an application.home systemProperty.  I ran into an issue with missing
> >> builtins like Object.  It could be that IJ injects these builtins no
> >> matter what.  From Ant I need to have GCL depend on js.swc, but then I
> >>get
> >> other conflicts that I am trying to sort through in the compiler.
> >
> >That's my conf., basicaly, I removed all the libraries from the SDK to
> >build it and don't depend on js.swc either.
> >
> >http://pastebin.com/q7X3K38E
>
> Well, some SWC has to provide the builtins like Object, Array, etc.  My
> guess is that your config is depending on a playerglobal or airglobal, and
> that does work for me, but I was thinking that long-term we want GCL to
> depend on js.swc and use its Object and Event definitions in there because
> that is the true set of classes available to GCL developer at runtime.
> For example, in one of API right now I saw use of the Class builtin, which
> doesn’t exist in JS.
>
> Using js.swc does cause other errors.  Both GCL and js have Event and
> EventTarget definitions.  I’ve made a tweak to the compiler to not emit an
> AmbiguousDefinition error if it finds a conflict betweenglobal
> namespace
> definitions and a definition in the same package as the class being
> compiled.  It will always use the one in the same package.  I think we’ll
> probably add more logic to ignore conflicts between global definitions and
> a definition that has been explicitly imported.  Right now, though, I’m on
> a little side-trip to see if there is an already existing way to specify
> the global namespace or if there is an easy way to add one.
>
> -Alex
>
>


RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-18 Thread Frédéric THOMAS
> Yeah, I’m just looking ahead and am in the mood to play in the compiler
> code.  I figure some day we’ll have a true GCL swc, either by making
> EXTERNC more tolerant, or because a d.ts file for GCL will be converted to
> externs.
> 
> I’m also expecting that some day as we go further into this port from JS
> back to AS, that we’ll hit some code or write some code where we need both
> GCL.swc and JS.swc and I would expect collisions between Event and
> EventTarget in such a case, even with the stubbed GCL.swc we currently
> have, so I’m exploring ways to deal with that.

Fair enough, would be awesome !

Thanks,
Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Fri, 18 Sep 2015 17:00:51 +
> 
> 
> 
> On 9/18/15, 9:42 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >> IMO, the externs swcs are also for developers wanting to build “native”
> >>JS
> >> applications without the FlexJS components, so any GCL.swc needs to
> >> support some developer using GCL and native JS.  So the two swcs need to
> >> be compatible with each other.   We could just hack up a GCL just to get
> >> the FlexJS JS to be written in AS but I feel like spending a day or two
> >> trying to see if there is a way we can be more general about it.
> >
> >Well, it would be nice if the EXTERNC could compile it all to .as but
> >IIRC, it was far to be able to do it, the reason why I didn't consider it
> >as another extern but only as a stub with the only purpose I described
> >before.
> >Now, if you can compile it entirely to .as, what you're saying would make
> >more sense to me indeed but for now, only a part of the Event API has
> >been included and for a big part, it was by hand.
> 
> Yeah, I’m just looking ahead and am in the mood to play in the compiler
> code.  I figure some day we’ll have a true GCL swc, either by making
> EXTERNC more tolerant, or because a d.ts file for GCL will be converted to
> externs.
> 
> I’m also expecting that some day as we go further into this port from JS
> back to AS, that we’ll hit some code or write some code where we need both
> GCL.swc and JS.swc and I would expect collisions between Event and
> EventTarget in such a case, even with the stubbed GCL.swc we currently
> have, so I’m exploring ways to deal with that.
> 
> -Alex
> 
  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-17 Thread Alex Harui


On 9/16/15, 1:13 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:

>> Yeah, like several of the interfaces.  But I’ve commented them out of
>>the
>> project right now and am just trying to get Application and all of its
>> dependencies to compile.
>
>My guess is it won't be easy in as3 to express some of the GCL calls
>though without the lib

I’m interested to see what you put in GCL.swc.  I created a few stubs for
the calls I needed and also changed the compiler so it will allow
goog.events.fireListener to be a class called goog.events with a
fireListener member and not fail by assuming goog.events was a package and
not finding the fireListener class.

Also, I observed that in HTMLElementWrapper, the element is typed as
EventTarget, but I think we’ll need to create a class like FlexHTMLElement
that adds flexjs_wrapper to an HTMLElement.  That’s interesting because it
means we won’t be able to do a straight port if we want more type-safety
from the compiler.  Instead we’ll have to create some new utilities
classes.

I’m done for today.  Will spend more time on it tomorrow.

-Alex

>
>Frédéric THOMAS
>
>> From: aha...@adobe.com
>> To: dev@flex.apache.org
>> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
>> Date: Wed, 16 Sep 2015 19:59:57 +
>> 
>> 
>> 
>> On 9/16/15, 12:55 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
>> 
>> >> I started out by trying to compile every AS file in Core with
>> >
>> >
>> >> COMPILE::AS3,false and got lots of errors.
>> >
>> >Are you talking about the ones not making use of the GCL.swc and having
>> >no dependencies with the ones which use it ?
>> 
>> Yeah, like several of the interfaces.  But I’ve commented them out of
>>the
>> project right now and am just trying to get Application and all of its
>> dependencies to compile.
>> 
>> -Alex
>>
>> 
> 



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-17 Thread Alex Harui

On 9/17/15, 9:32 AM, "Frédéric THOMAS"  wrote:

>> I’m interested to see what you put in GCL.swc.  I created a few stubs
>>for
>> the calls I needed and also changed the compiler so it will allow
>> goog.events.fireListener to be a class called goog.events with a
>> fireListener member and not fail by assuming goog.events was a package
>>and
>> not finding the fireListener class.
>
>After having cherrypicked your fix, I added a goog.events class and added
>a static getter / setter and t made the trick !

So I assume that takes care of the package-level getter/setter issue
right?  There really shouldn’t need to be package level getters and
setters if we can create classes like goog.events, which IMO, better
mirrors what is actually happening in JS (where goog and goog.events are
actually objects).

Do you still have the missing goog.require problem?

>
>I committed GCL, read the commit comments and come back to me if you need
>more details.

Yes, I’m merging in your changes right now.

I’m wondering why you decided to make such a “complete” GCL.swc.  I’m
tempted to make a much smaller one that just has the few classes we need,
then we don’t have such a huge pile of custom code to maintain.  I made my
own stubs last night and it was only four small files so far.


-Alex 



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-17 Thread Frédéric THOMAS
> > Also, I observed that in HTMLElementWrapper, the element is typed as
> > EventTarget, but I think we’ll need to create a class like FlexHTMLElement
> > that adds flexjs_wrapper to an HTMLElement.  That’s interesting because it
> > means we won’t be able to do a straight port if we want more type-safety
> > from the compiler.  Instead we’ll have to create some new utilities
> > classes.
> 
> Yes, it would allow to conditional compile only some Application's methods 
> instead of the all class as I did.

Oups, I was talking about Sprite here.

Frédéric THOMAS

> From: webdoubl...@hotmail.com
> To: dev@flex.apache.org
> Subject: RE: [FlexJS] Framework using externs (was: Setup Error)
> Date: Thu, 17 Sep 2015 17:32:01 +0100
> 
> > I’m interested to see what you put in GCL.swc.  I created a few stubs for
> > the calls I needed and also changed the compiler so it will allow
> > goog.events.fireListener to be a class called goog.events with a
> > fireListener member and not fail by assuming goog.events was a package and
> > not finding the fireListener class.
> 
> After having cherrypicked your fix, I added a goog.events class and added a 
> static getter / setter and t made the trick !
> 
> > Also, I observed that in HTMLElementWrapper, the element is typed as
> > EventTarget, but I think we’ll need to create a class like FlexHTMLElement
> > that adds flexjs_wrapper to an HTMLElement.  That’s interesting because it
> > means we won’t be able to do a straight port if we want more type-safety
> > from the compiler.  Instead we’ll have to create some new utilities
> > classes.
> 
> Yes, it would allow to conditional compile only some Application's methods 
> instead of the all class as I did.
> 
> As I mentioned before, there was some changes on the core classes it depends 
> on on the develop branch I did not reported to this one.
> Also, please double check HTMLElementWrapper and the @export in general, 
> wasn't sure whenever a subclass inherit the export behaviour, so, I might  
> have missed some.
> 
> I committed GCL, read the commit comments and come back to me if you need 
> more details.
> 
> Thanks,
> Frédéric THOMAS
> 
> > From: aha...@adobe.com
> > To: dev@flex.apache.org
> > Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> > Date: Thu, 17 Sep 2015 06:31:47 +
> > 
> > 
> > 
> > On 9/16/15, 1:13 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> > 
> > >> Yeah, like several of the interfaces.  But I’ve commented them out of
> > >>the
> > >> project right now and am just trying to get Application and all of its
> > >> dependencies to compile.
> > >
> > >My guess is it won't be easy in as3 to express some of the GCL calls
> > >though without the lib
> > 
> > I’m interested to see what you put in GCL.swc.  I created a few stubs for
> > the calls I needed and also changed the compiler so it will allow
> > goog.events.fireListener to be a class called goog.events with a
> > fireListener member and not fail by assuming goog.events was a package and
> > not finding the fireListener class.
> > 
> > Also, I observed that in HTMLElementWrapper, the element is typed as
> > EventTarget, but I think we’ll need to create a class like FlexHTMLElement
> > that adds flexjs_wrapper to an HTMLElement.  That’s interesting because it
> > means we won’t be able to do a straight port if we want more type-safety
> > from the compiler.  Instead we’ll have to create some new utilities
> > classes.
> > 
> > I’m done for today.  Will spend more time on it tomorrow.
> > 
> > -Alex
> > 
> > >
> > >Frédéric THOMAS
> > >
> > >> From: aha...@adobe.com
> > >> To: dev@flex.apache.org
> > >> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> > >> Date: Wed, 16 Sep 2015 19:59:57 +
> > >> 
> > >> 
> > >> 
> > >> On 9/16/15, 12:55 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> > >> 
> > >> >> I started out by trying to compile every AS file in Core with
> > >> >
> > >> >
> > >> >> COMPILE::AS3,false and got lots of errors.
> > >> >
> > >> >Are you talking about the ones not making use of the GCL.swc and having
> > >> >no dependencies with the ones which use it ?
> > >> 
> > >> Yeah, like several of the interfaces.  But I’ve commented them out of
> > >>the
> > >> project right now and am just trying to get Application and all of its
> > >> dependencies to compile.
> > >> 
> > >> -Alex
> > >>
> > >> 
> > > 
> > 
> 
  

RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-17 Thread Frédéric THOMAS
> I’m interested to see what you put in GCL.swc.  I created a few stubs for
> the calls I needed and also changed the compiler so it will allow
> goog.events.fireListener to be a class called goog.events with a
> fireListener member and not fail by assuming goog.events was a package and
> not finding the fireListener class.

After having cherrypicked your fix, I added a goog.events class and added a 
static getter / setter and t made the trick !

> Also, I observed that in HTMLElementWrapper, the element is typed as
> EventTarget, but I think we’ll need to create a class like FlexHTMLElement
> that adds flexjs_wrapper to an HTMLElement.  That’s interesting because it
> means we won’t be able to do a straight port if we want more type-safety
> from the compiler.  Instead we’ll have to create some new utilities
> classes.

Yes, it would allow to conditional compile only some Application's methods 
instead of the all class as I did.

As I mentioned before, there was some changes on the core classes it depends on 
on the develop branch I did not reported to this one.
Also, please double check HTMLElementWrapper and the @export in general, wasn't 
sure whenever a subclass inherit the export behaviour, so, I might  have missed 
some.

I committed GCL, read the commit comments and come back to me if you need more 
details.

Thanks,
Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Thu, 17 Sep 2015 06:31:47 +
> 
> 
> 
> On 9/16/15, 1:13 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >> Yeah, like several of the interfaces.  But I’ve commented them out of
> >>the
> >> project right now and am just trying to get Application and all of its
> >> dependencies to compile.
> >
> >My guess is it won't be easy in as3 to express some of the GCL calls
> >though without the lib
> 
> I’m interested to see what you put in GCL.swc.  I created a few stubs for
> the calls I needed and also changed the compiler so it will allow
> goog.events.fireListener to be a class called goog.events with a
> fireListener member and not fail by assuming goog.events was a package and
> not finding the fireListener class.
> 
> Also, I observed that in HTMLElementWrapper, the element is typed as
> EventTarget, but I think we’ll need to create a class like FlexHTMLElement
> that adds flexjs_wrapper to an HTMLElement.  That’s interesting because it
> means we won’t be able to do a straight port if we want more type-safety
> from the compiler.  Instead we’ll have to create some new utilities
> classes.
> 
> I’m done for today.  Will spend more time on it tomorrow.
> 
> -Alex
> 
> >
> >Frédéric THOMAS
> >
> >> From: aha...@adobe.com
> >> To: dev@flex.apache.org
> >> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> >> Date: Wed, 16 Sep 2015 19:59:57 +
> >> 
> >> 
> >> 
> >> On 9/16/15, 12:55 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> >> 
> >> >> I started out by trying to compile every AS file in Core with
> >> >
> >> >
> >> >> COMPILE::AS3,false and got lots of errors.
> >> >
> >> >Are you talking about the ones not making use of the GCL.swc and having
> >> >no dependencies with the ones which use it ?
> >> 
> >> Yeah, like several of the interfaces.  But I’ve commented them out of
> >>the
> >> project right now and am just trying to get Application and all of its
> >> dependencies to compile.
> >> 
> >> -Alex
> >>  
> >> 
> >   
> 
  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-17 Thread Josh Tynjala
I hope to release the first version of my dts2as tool soon. I haven't
finished testing it yet.

- Josh

On Thu, Sep 17, 2015 at 10:05 AM, Frédéric THOMAS <webdoubl...@hotmail.com>
wrote:

> > So I assume that takes care of the package-level getter/setter issue
> > right?  There really shouldn’t need to be package level getters and
> > setters if we can create classes like goog.events, which IMO, better
> > mirrors what is actually happening in JS (where goog and goog.events are
> > actually objects).
>
> Yes, it does, thank !
> Another thing is the legacy compiler allows to have getter / setter at
> package level, not Falcon.
>
> > Do you still have the missing goog.require problem?
>
> Yes but I will fix that, the compiler.clients.* used directly does not
> create the issue.
>
> > Yes, I’m merging in your changes right now.
>
> Ok, just take note that I  kept only Application in basic-manifest.xml,
> removed the -source-path option for the only purpose of being focussed on
> compiling only that class and its components, doing so, I wasn't bother by
> any other compilation issues of the classes I hadn't been converted yet.
>
> > I’m wondering why you decided to make such a “complete” GCL.swc.  I’m
> > tempted to make a much smaller one that just has the few classes we need,
> > then we don’t have such a huge pile of custom code to maintain.  I made
> my
> > own stubs last night and it was only four small files so far.
>
> My dream would have been that the EXTERNC compiles all the GCL, it was far
> to be able to do it, at the point that instead of trying to improve it, I
> took what it has generated and used it in a new GCL project, so, not sure
> we need all the GCL JS sources I committed, not sure either, at the end, I
> added more AS classes than what I need, could be though...
>
> Btw, Josh started to build a tool to cross compile typescripts extern
> libraries to .swc, not sure how much progress he did on it though but it
> would be awesome for other libs because the number of them is impressive.
>
> Frédéric THOMAS
>
> > From: aha...@adobe.com
> > To: dev@flex.apache.org
> > Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> > Date: Thu, 17 Sep 2015 16:43:52 +
> >
> >
> > On 9/17/15, 9:32 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> >
> > >> I’m interested to see what you put in GCL.swc.  I created a few stubs
> > >>for
> > >> the calls I needed and also changed the compiler so it will allow
> > >> goog.events.fireListener to be a class called goog.events with a
> > >> fireListener member and not fail by assuming goog.events was a package
> > >>and
> > >> not finding the fireListener class.
> > >
> > >After having cherrypicked your fix, I added a goog.events class and
> added
> > >a static getter / setter and t made the trick !
> >
> > So I assume that takes care of the package-level getter/setter issue
> > right?  There really shouldn’t need to be package level getters and
> > setters if we can create classes like goog.events, which IMO, better
> > mirrors what is actually happening in JS (where goog and goog.events are
> > actually objects).
> >
> > Do you still have the missing goog.require problem?
> >
> > >
> > >I committed GCL, read the commit comments and come back to me if you
> need
> > >more details.
> >
> > Yes, I’m merging in your changes right now.
> >
> > I’m wondering why you decided to make such a “complete” GCL.swc.  I’m
> > tempted to make a much smaller one that just has the few classes we need,
> > then we don’t have such a huge pile of custom code to maintain.  I made
> my
> > own stubs last night and it was only four small files so far.
> >
> >
> > -Alex
> >
>
>


Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-17 Thread Alex Harui


On 9/17/15, 10:05 AM, "Frédéric THOMAS"  wrote:
>
>> Do you still have the missing goog.require problem?
>
>Yes but I will fix that, the compiler.clients.* used directly does not
>create the issue.

By commenting out the use of ViewBase from Application.as, I was able to
get Application.as to compile without errors and got what looked like a
reasonable list of goog.requires without changing any compiler.clients
classes.

I did notice that the method bodies that had conditional compilation
didn’t output anything so I’m going to look at that next.  Or is that what
you tried to fix by changing compiler.clients.*?

Thanks,
-Alex
  



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Alex Harui
FYI, I’m going to start finding time to work on this port.

-Alex

On 9/9/15, 6:19 AM, "Alex Harui"  wrote:

>
>
>On 9/9/15, 3:12 AM, "Frédéric THOMAS"  wrote:
>
>>
>>One thing I discovered though is that with Falcon, the combination of
>>getter / setter for a same function at package level is not supported
>>(the legacy compiler support it):
>>
>>package goog.events {
>>public function get fireListener():Function{return null;}
>>public function set fireListener(value:Function):void{}
>>}
>>
>>Error: An externally-visible definition with the name
>>'goog.events.fireListener' was unexpectedly found.
>>
>>Can you take care of it or drive me into fixing it ?
>
>That’s interesting.  I’ve never seen a ‘global’ property in AS before.  If
>you want to try to fix it, what I would do is set a breakpoint in
>CompilerProblem.java.  Then you’ll see on the call stack what logic
>decided to generate that error and can try to add other logic to accept it
>in this case.
>
>Speaking of doing things like that, it occurred to me recently that
>ambiguous definition errors when the global Event class conflicts with
>org.apache.flex.events.Events could be handled by adjusting the logic for
>detecting ambiguous definitions.  IIRC, the logic resolves the “Event” and
>if it finds more than one definition it generates the error.  The logic
>could be adjusted to see if one of the definitions is a global definition
>and then use the global and maybe additionally generate a warning instead
>of an error.   
>BTW, it looks like this week and next will be spent on getting a release
>out the door, then I hope to work on this port from JS to AS.
>
>-Alex
>



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Frédéric THOMAS
Hi Alex,

Cool, Btw, I didn't fix the bug I had with the flex-oem-compiler yet given I 
will move those things to IJ, neither the one regarding the getter / setter 
functions at package level.

I will share the CGL.swc with its sources and details as soon as I can, 
probably tomorrow along with the Ant targets using the compiler.clients.*

Thanks,
Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Wed, 16 Sep 2015 06:08:33 +
> 
> FYI, I’m going to start finding time to work on this port.
> 
> -Alex
> 
> On 9/9/15, 6:19 AM, "Alex Harui" <aha...@adobe.com> wrote:
> 
> >
> >
> >On 9/9/15, 3:12 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> >
> >>
> >>One thing I discovered though is that with Falcon, the combination of
> >>getter / setter for a same function at package level is not supported
> >>(the legacy compiler support it):
> >>
> >>package goog.events {
> >>public function get fireListener():Function{return null;}
> >>public function set fireListener(value:Function):void{}
> >>}
> >>
> >>Error: An externally-visible definition with the name
> >>'goog.events.fireListener' was unexpectedly found.
> >>
> >>Can you take care of it or drive me into fixing it ?
> >
> >That’s interesting.  I’ve never seen a ‘global’ property in AS before.  If
> >you want to try to fix it, what I would do is set a breakpoint in
> >CompilerProblem.java.  Then you’ll see on the call stack what logic
> >decided to generate that error and can try to add other logic to accept it
> >in this case.
> >
> >Speaking of doing things like that, it occurred to me recently that
> >ambiguous definition errors when the global Event class conflicts with
> >org.apache.flex.events.Events could be handled by adjusting the logic for
> >detecting ambiguous definitions.  IIRC, the logic resolves the “Event” and
> >if it finds more than one definition it generates the error.  The logic
> >could be adjusted to see if one of the definitions is a global definition
> >and then use the global and maybe additionally generate a warning instead
> >of an error. 
> >BTW, it looks like this week and next will be spent on getting a release
> >out the door, then I hope to work on this port from JS to AS.
> >
> >-Alex
> >
> 
  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Alex Harui
Hi Fred,

I started poking around in the branch.  I’m confused by how you plan to
use the conditional compilation flags.  Whole classes seem to be marked
with COMPILE::AS3, but I would expect any conditional compilation to be on
or inside methods.  Can you explain?

Thanks,
-Alex

On 9/16/15, 2:26 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:

>Hi Alex,
>
>Cool, Btw, I didn't fix the bug I had with the flex-oem-compiler yet
>given I will move those things to IJ, neither the one regarding the
>getter / setter functions at package level.
>
>I will share the CGL.swc with its sources and details as soon as I can,
>probably tomorrow along with the Ant targets using the compiler.clients.*
>
>Thanks,
>Frédéric THOMAS
>
>> From: aha...@adobe.com
>> To: dev@flex.apache.org
>> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
>> Date: Wed, 16 Sep 2015 06:08:33 +
>> 
>> FYI, I’m going to start finding time to work on this port.
>> 
>> -Alex
>> 
>> On 9/9/15, 6:19 AM, "Alex Harui" <aha...@adobe.com> wrote:
>> 
>> >
>> >
>> >On 9/9/15, 3:12 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
>> >
>> >>
>> >>One thing I discovered though is that with Falcon, the combination of
>> >>getter / setter for a same function at package level is not supported
>> >>(the legacy compiler support it):
>> >>
>> >>package goog.events {
>> >>public function get fireListener():Function{return null;}
>> >>public function set fireListener(value:Function):void{}
>> >>}
>> >>
>> >>Error: An externally-visible definition with the name
>> >>'goog.events.fireListener' was unexpectedly found.
>> >>
>> >>Can you take care of it or drive me into fixing it ?
>> >
>> >That’s interesting.  I’ve never seen a ‘global’ property in AS before.
>> If
>> >you want to try to fix it, what I would do is set a breakpoint in
>> >CompilerProblem.java.  Then you’ll see on the call stack what logic
>> >decided to generate that error and can try to add other logic to
>>accept it
>> >in this case.
>> >
>> >Speaking of doing things like that, it occurred to me recently that
>> >ambiguous definition errors when the global Event class conflicts with
>> >org.apache.flex.events.Events could be handled by adjusting the logic
>>for
>> >detecting ambiguous definitions.  IIRC, the logic resolves the “Event”
>>and
>> >if it finds more than one definition it generates the error.  The logic
>> >could be adjusted to see if one of the definitions is a global
>>definition
>> >and then use the global and maybe additionally generate a warning
>>instead
>> >of an error.
>> >BTW, it looks like this week and next will be spent on getting a
>>release
>> >out the door, then I hope to work on this port from JS to AS.
>> >
>> >-Alex
>> >
>> 
> 



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Frédéric THOMAS
Hi Alex,

Actually, I removed all the js files from the  compilation path in order to 
re-code them one by one in as3, so, all the existing classes already in as3, I 
wrapped them with COMPILE::AS3 because for sure the output artefact for them 
will be .swc

I started to convert the Application sub components to as3 wrapping them with 
COMPILE:JS because the output artefact for them will be .js

Does it makes sense ?

Note:
1- Those core classes in JS have been modified in the master branch, so, my 
conversion is not in sync
2- I had t2 issues with the GCL.swc and Falcon, the one I mentioned relative to 
the getter / setter at package level and another one I haven't in mind at the 
moment but will describe tomorrow, proving more details about the GCL.swc

Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Wed, 16 Sep 2015 16:54:06 +
> 
> Hi Fred,
> 
> I started poking around in the branch.  I’m confused by how you plan to
> use the conditional compilation flags.  Whole classes seem to be marked
> with COMPILE::AS3, but I would expect any conditional compilation to be on
> or inside methods.  Can you explain?
> 
> Thanks,
> -Alex
> 
> On 9/16/15, 2:26 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >Hi Alex,
> >
> >Cool, Btw, I didn't fix the bug I had with the flex-oem-compiler yet
> >given I will move those things to IJ, neither the one regarding the
> >getter / setter functions at package level.
> >
> >I will share the CGL.swc with its sources and details as soon as I can,
> >probably tomorrow along with the Ant targets using the compiler.clients.*
> >
> >Thanks,
> >Frédéric THOMAS
> >
> >> From: aha...@adobe.com
> >> To: dev@flex.apache.org
> >> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> >> Date: Wed, 16 Sep 2015 06:08:33 +
> >> 
> >> FYI, I’m going to start finding time to work on this port.
> >> 
> >> -Alex
> >> 
> >> On 9/9/15, 6:19 AM, "Alex Harui" <aha...@adobe.com> wrote:
> >> 
> >> >
> >> >
> >> >On 9/9/15, 3:12 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> >> >
> >> >>
> >> >>One thing I discovered though is that with Falcon, the combination of
> >> >>getter / setter for a same function at package level is not supported
> >> >>(the legacy compiler support it):
> >> >>
> >> >>package goog.events {
> >> >>public function get fireListener():Function{return null;}
> >> >>public function set fireListener(value:Function):void{}
> >> >>}
> >> >>
> >> >>Error: An externally-visible definition with the name
> >> >>'goog.events.fireListener' was unexpectedly found.
> >> >>
> >> >>Can you take care of it or drive me into fixing it ?
> >> >
> >> >That’s interesting.  I’ve never seen a ‘global’ property in AS before.
> >> If
> >> >you want to try to fix it, what I would do is set a breakpoint in
> >> >CompilerProblem.java.  Then you’ll see on the call stack what logic
> >> >decided to generate that error and can try to add other logic to
> >>accept it
> >> >in this case.
> >> >
> >> >Speaking of doing things like that, it occurred to me recently that
> >> >ambiguous definition errors when the global Event class conflicts with
> >> >org.apache.flex.events.Events could be handled by adjusting the logic
> >>for
> >> >detecting ambiguous definitions.  IIRC, the logic resolves the “Event”
> >>and
> >> >if it finds more than one definition it generates the error.  The logic
> >> >could be adjusted to see if one of the definitions is a global
> >>definition
> >> >and then use the global and maybe additionally generate a warning
> >>instead
> >> >of an error.  
> >> >BTW, it looks like this week and next will be spent on getting a
> >>release
> >> >out the door, then I hope to work on this port from JS to AS.
> >> >
> >> >-Alex
> >> >
> >> 
> >   
> 
  

RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Frédéric THOMAS



> HTMLElementWrapper should be one of very few JS-only classes so I was
> going to keep it in another folder tree, but I’ll leave it where it is for
> now.

I've been able to convert it using GCL.swc with no AS specific part, why it 
should stay JS only ?

Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Wed, 16 Sep 2015 19:54:32 +
> 
> On 9/16/15, 12:48 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >> I’m about to start writing HTMLElementWrapper.as and try to figure out
> >> where to put it.  I don’t really want to have it in as/src, maybe in a
> >>new
> >> folder like js/as/src?
> >
> >I probably have some changes not committed for this class but most of it
> >was converted making use of the GCL.swc
> 
> Ah, glad I asked.  Somehow I missed seeing HTMLElementWrapper.as.
> 
> 
> >Also, I liked to have the AS and AS/JS counterpart in the same file, I
> >thought it was easier to maintain, what's wrong with this approach, why
> >do you prefer having them apart ?
> 
> HTMLElementWrapper should be one of very few JS-only classes so I was
> going to keep it in another folder tree, but I’ll leave it where it is for
> now.
> 
> Thanks again,
> -Alex   
> 

  

RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Frédéric THOMAS
> I’m about to start writing HTMLElementWrapper.as and try to figure out
> where to put it.  I don’t really want to have it in as/src, maybe in a new
> folder like js/as/src?

I probably have some changes not committed for this class but most of it was 
converted making use of the GCL.swc
Also, I liked to have the AS and AS/JS counterpart in the same file, I thought 
it was easier to maintain, what's wrong with this approach, why do you prefer 
having them apart ?

Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Wed, 16 Sep 2015 19:31:45 +
> 
> Hi Fred,
> 
> I started out by trying to compile every AS file in Core with
> COMPILE::AS3,false and got lots of errors. I think you may have done that
> to keep them out of the errors list while you work on Application, so I’ve
> commented a lot of classes out of the build for now.  I think for a lot of
> these classes, they won’t need conditional compilation.
> 
> I only now figured out why you were concerned about Sprite.  I will
> introduce an ApplicationBase.as class that abstracts away the differences.
> 
> I’m about to start writing HTMLElementWrapper.as and try to figure out
> where to put it.  I don’t really want to have it in as/src, maybe in a new
> folder like js/as/src?
> 
> Thanks for getting this started.
> -Alex
> 
> On 9/16/15, 12:20 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >Hi Alex,
> >
> >Actually, I removed all the js files from the  compilation path in order
> >to re-code them one by one in as3, so, all the existing classes already
> >in as3, I wrapped them with COMPILE::AS3 because for sure the output
> >artefact for them will be .swc
> >
> >I started to convert the Application sub components to as3 wrapping them
> >with COMPILE:JS because the output artefact for them will be .js
> >
> >Does it makes sense ?
> >
> >Note:
> >1- Those core classes in JS have been modified in the master branch, so,
> >my conversion is not in sync
> >2- I had t2 issues with the GCL.swc and Falcon, the one I mentioned
> >relative to the getter / setter at package level and another one I
> >haven't in mind at the moment but will describe tomorrow, proving more
> >details about the GCL.swc
> >
> >Frédéric THOMAS
> >
> >> From: aha...@adobe.com
> >> To: dev@flex.apache.org
> >> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> >> Date: Wed, 16 Sep 2015 16:54:06 +
> >> 
> >> Hi Fred,
> >> 
> >> I started poking around in the branch.  I’m confused by how you plan to
> >> use the conditional compilation flags.  Whole classes seem to be marked
> >> with COMPILE::AS3, but I would expect any conditional compilation to be
> >>on
> >> or inside methods.  Can you explain?
> >> 
> >> Thanks,
> >> -Alex
> >> 
> >> On 9/16/15, 2:26 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> >> 
> >> >Hi Alex,
> >> >
> >> >Cool, Btw, I didn't fix the bug I had with the flex-oem-compiler yet
> >> >given I will move those things to IJ, neither the one regarding the
> >> >getter / setter functions at package level.
> >> >
> >> >I will share the CGL.swc with its sources and details as soon as I can,
> >> >probably tomorrow along with the Ant targets using the
> >>compiler.clients.*
> >> >
> >> >Thanks,
> >> >Frédéric THOMAS
> >> >
> >> >> From: aha...@adobe.com
> >> >> To: dev@flex.apache.org
> >> >> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> >> >> Date: Wed, 16 Sep 2015 06:08:33 +
> >> >> 
> >> >> FYI, I’m going to start finding time to work on this port.
> >> >> 
> >> >> -Alex
> >> >> 
> >> >> On 9/9/15, 6:19 AM, "Alex Harui" <aha...@adobe.com> wrote:
> >> >> 
> >> >> >
> >> >> >
> >> >> >On 9/9/15, 3:12 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com>
> >>wrote:
> >> >> >
> >> >> >>
> >> >> >>One thing I discovered though is that with Falcon, the combination
> >>of
> >> >> >>getter / setter for a same function at package level is not
> >>supported
> >> >> >>(the legacy compiler s

RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Frédéric THOMAS
Also, probably some methods could be common and maybe there are some of them I 
didn't mark for conditional compilation but at least at the beginning, I was 
much more going to re-code the entire classes, it was less time consuming than 
checking method by method what was common or not.

Frédéric THOMAS

> From: webdoubl...@hotmail.com
> To: dev@flex.apache.org
> Subject: RE: [FlexJS] Framework using externs (was: Setup Error)
> Date: Wed, 16 Sep 2015 20:20:53 +0100
> 
> Hi Alex,
> 
> Actually, I removed all the js files from the  compilation path in order to 
> re-code them one by one in as3, so, all the existing classes already in as3, 
> I wrapped them with COMPILE::AS3 because for sure the output artefact for 
> them will be .swc
> 
> I started to convert the Application sub components to as3 wrapping them with 
> COMPILE:JS because the output artefact for them will be .js
> 
> Does it makes sense ?
> 
> Note:
> 1- Those core classes in JS have been modified in the master branch, so, my 
> conversion is not in sync
> 2- I had t2 issues with the GCL.swc and Falcon, the one I mentioned relative 
> to the getter / setter at package level and another one I haven't in mind at 
> the moment but will describe tomorrow, proving more details about the GCL.swc
> 
> Frédéric THOMAS
> 
> > From: aha...@adobe.com
> > To: dev@flex.apache.org
> > Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> > Date: Wed, 16 Sep 2015 16:54:06 +
> > 
> > Hi Fred,
> > 
> > I started poking around in the branch.  I’m confused by how you plan to
> > use the conditional compilation flags.  Whole classes seem to be marked
> > with COMPILE::AS3, but I would expect any conditional compilation to be on
> > or inside methods.  Can you explain?
> > 
> > Thanks,
> > -Alex
> > 
> > On 9/16/15, 2:26 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> > 
> > >Hi Alex,
> > >
> > >Cool, Btw, I didn't fix the bug I had with the flex-oem-compiler yet
> > >given I will move those things to IJ, neither the one regarding the
> > >getter / setter functions at package level.
> > >
> > >I will share the CGL.swc with its sources and details as soon as I can,
> > >probably tomorrow along with the Ant targets using the compiler.clients.*
> > >
> > >Thanks,
> > >Frédéric THOMAS
> > >
> > >> From: aha...@adobe.com
> > >> To: dev@flex.apache.org
> > >> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> > >> Date: Wed, 16 Sep 2015 06:08:33 +
> > >> 
> > >> FYI, I’m going to start finding time to work on this port.
> > >> 
> > >> -Alex
> > >> 
> > >> On 9/9/15, 6:19 AM, "Alex Harui" <aha...@adobe.com> wrote:
> > >> 
> > >> >
> > >> >
> > >> >On 9/9/15, 3:12 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> > >> >
> > >> >>
> > >> >>One thing I discovered though is that with Falcon, the combination of
> > >> >>getter / setter for a same function at package level is not supported
> > >> >>(the legacy compiler support it):
> > >> >>
> > >> >>package goog.events {
> > >> >>public function get fireListener():Function{return null;}
> > >> >>public function set fireListener(value:Function):void{}
> > >> >>}
> > >> >>
> > >> >>Error: An externally-visible definition with the name
> > >> >>'goog.events.fireListener' was unexpectedly found.
> > >> >>
> > >> >>Can you take care of it or drive me into fixing it ?
> > >> >
> > >> >That’s interesting.  I’ve never seen a ‘global’ property in AS before.
> > >> If
> > >> >you want to try to fix it, what I would do is set a breakpoint in
> > >> >CompilerProblem.java.  Then you’ll see on the call stack what logic
> > >> >decided to generate that error and can try to add other logic to
> > >>accept it
> > >> >in this case.
> > >> >
> > >> >Speaking of doing things like that, it occurred to me recently that
> > >> >ambiguous definition errors when the global Event class conflicts with
> > >> >org.apache.flex.events.Events could be handled by adjusting the logic
> > >>for
> > >> >detecting ambiguous definitions.  IIRC, the logic resolves the “Event”
> > >>and
> > >> >if it finds more than one definition it generates the error.  The logic
> > >> >could be adjusted to see if one of the definitions is a global
> > >>definition
> > >> >and then use the global and maybe additionally generate a warning
> > >>instead
> > >> >of an error.
> > >> >BTW, it looks like this week and next will be spent on getting a
> > >>release
> > >> >out the door, then I hope to work on this port from JS to AS.
> > >> >
> > >> >-Alex
> > >> >
> > >> 
> > > 
> > 
> 
  

RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Frédéric THOMAS
> Ah, glad I asked.  Somehow I missed seeing HTMLElementWrapper.as.

Weird, it was in my commit, I will have more time tomorrow to find out what's 
happening.

Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Wed, 16 Sep 2015 19:54:32 +
> 
> On 9/16/15, 12:48 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >> I’m about to start writing HTMLElementWrapper.as and try to figure out
> >> where to put it.  I don’t really want to have it in as/src, maybe in a
> >>new
> >> folder like js/as/src?
> >
> >I probably have some changes not committed for this class but most of it
> >was converted making use of the GCL.swc
> 
> Ah, glad I asked.  Somehow I missed seeing HTMLElementWrapper.as.
> 
> 
> >Also, I liked to have the AS and AS/JS counterpart in the same file, I
> >thought it was easier to maintain, what's wrong with this approach, why
> >do you prefer having them apart ?
> 
> HTMLElementWrapper should be one of very few JS-only classes so I was
> going to keep it in another folder tree, but I’ll leave it where it is for
> now.
> 
> Thanks again,
> -Alex   
> 
  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Alex Harui
On 9/16/15, 12:48 PM, "Frédéric THOMAS"  wrote:

>> I’m about to start writing HTMLElementWrapper.as and try to figure out
>> where to put it.  I don’t really want to have it in as/src, maybe in a
>>new
>> folder like js/as/src?
>
>I probably have some changes not committed for this class but most of it
>was converted making use of the GCL.swc

Ah, glad I asked.  Somehow I missed seeing HTMLElementWrapper.as.


>Also, I liked to have the AS and AS/JS counterpart in the same file, I
>thought it was easier to maintain, what's wrong with this approach, why
>do you prefer having them apart ?

HTMLElementWrapper should be one of very few JS-only classes so I was
going to keep it in another folder tree, but I’ll leave it where it is for
now.

Thanks again,
-Alex 



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Alex Harui


On 9/16/15, 12:55 PM, "Frédéric THOMAS"  wrote:

>> I started out by trying to compile every AS file in Core with
>
>
>> COMPILE::AS3,false and got lots of errors.
>
>Are you talking about the ones not making use of the GCL.swc and having
>no dependencies with the ones which use it ?

Yeah, like several of the interfaces.  But I’ve commented them out of the
project right now and am just trying to get Application and all of its
dependencies to compile.

-Alex
  



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Alex Harui


On 9/16/15, 12:58 PM, "Frédéric THOMAS"  wrote:

>> Ah, glad I asked.  Somehow I missed seeing HTMLElementWrapper.as.
>
>Weird, it was in my commit, I will have more time tomorrow to find out
>what's happening.


Yes, it is there and I found it, I just didn’t see it earlier.

Thanks,
-Alex
  



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Alex Harui


On 9/16/15, 1:02 PM, "Frédéric THOMAS"  wrote:

>
>
>
>> HTMLElementWrapper should be one of very few JS-only classes so I was
>> going to keep it in another folder tree, but I’ll leave it where it is
>>for
>> now.
>
>I've been able to convert it using GCL.swc with no AS specific part, why
>it should stay JS only ?

Because it isn’t used in the AS code for SWF since there is no HTMLElement
to wrap.

-Alex
  



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-16 Thread Frédéric THOMAS
> Yeah, like several of the interfaces.  But I’ve commented them out of the
> project right now and am just trying to get Application and all of its
> dependencies to compile.

My guess is it won't be easy in as3 to express some of the GCL calls though 
without the lib

Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Wed, 16 Sep 2015 19:59:57 +
> 
> 
> 
> On 9/16/15, 12:55 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >> I started out by trying to compile every AS file in Core with
> >
> >
> >> COMPILE::AS3,false and got lots of errors.
> >
> >Are you talking about the ones not making use of the GCL.swc and having
> >no dependencies with the ones which use it ?
> 
> Yeah, like several of the interfaces.  But I’ve commented them out of the
> project right now and am just trying to get Application and all of its
> dependencies to compile.
> 
> -Alex
> 
> 
  

RE: [FlexJS] Framework using externs (was: Setup Error)

2015-09-09 Thread Frédéric THOMAS
Hi Alex,

> For me, when I compile a FlexJS example like FlexJSStore, addDependency is
> called quite often while servicing “handleSyntaxTreeRequest” before any
> walking of the AST.  I wonder if there is something different about the
> way you are compiling this code you are working on.

I hadn't a lot and didn't want to spend more time on this issue until today, 
guess why :-) 
Anyway, if I call COMPJSC directly I haven't this issue, so, I will hopefully 
find out why quickly now.

One thing I discovered though is that with Falcon, the combination of getter / 
setter for a same function at package level is not supported (the legacy 
compiler support it):

package goog.events {
public function get fireListener():Function{return null;}
public function set fireListener(value:Function):void{}
}

Error: An externally-visible definition with the name 
'goog.events.fireListener' was unexpectedly found.

Can you take care of it or drive me into fixing it ?

Thanks,
Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Mon, 24 Aug 2015 16:28:37 +
> 
> 
> 
> On 8/24/15, 8:07 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >
> >
> >
> >> I’d have to dig into it, but yes, I think addDependency gets called
> >>quite
> >> often before we start walking the tree.  But once you asked the
> >>question,
> >> it did occur to me that we do call into the resolving code during the
> >> walk, but I don’t know if that also results in addDependency.
> >
> >Not sure I understood everything but I can't see any call before walking
> >the tree to FlexJSProject.addDependency() which is the function used to
> >fill the requires that are then wrote in PackageHeaderEmitter using
> >FlexJSProject.getRequires(), is there a function supposed to store the
> >library definitions before the walk ?
> 
> For me, when I compile a FlexJS example like FlexJSStore, addDependency is
> called quite often while servicing “handleSyntaxTreeRequest” before any
> walking of the AST.  I wonder if there is something different about the
> way you are compiling this code you are working on.
> 
> -Alex
>   
> 
  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-09-09 Thread Alex Harui


On 9/9/15, 3:12 AM, "Frédéric THOMAS"  wrote:

>
>One thing I discovered though is that with Falcon, the combination of
>getter / setter for a same function at package level is not supported
>(the legacy compiler support it):
>
>package goog.events {
>public function get fireListener():Function{return null;}
>public function set fireListener(value:Function):void{}
>}
>
>Error: An externally-visible definition with the name
>'goog.events.fireListener' was unexpectedly found.
>
>Can you take care of it or drive me into fixing it ?

That’s interesting.  I’ve never seen a ‘global’ property in AS before.  If
you want to try to fix it, what I would do is set a breakpoint in
CompilerProblem.java.  Then you’ll see on the call stack what logic
decided to generate that error and can try to add other logic to accept it
in this case.

Speaking of doing things like that, it occurred to me recently that
ambiguous definition errors when the global Event class conflicts with
org.apache.flex.events.Events could be handled by adjusting the logic for
detecting ambiguous definitions.  IIRC, the logic resolves the “Event” and
if it finds more than one definition it generates the error.  The logic
could be adjusted to see if one of the definitions is a global definition
and then use the global and maybe additionally generate a warning instead
of an error.
BTW, it looks like this week and next will be spent on getting a release
out the door, then I hope to work on this port from JS to AS.

-Alex



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-24 Thread Alex Harui


On 8/24/15, 2:21 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

Do you mean, the FlexJSProject.addDependency() should be called while the
AST is generated for the libraries dependencies or maybe be a pass for
collecting them as we do in the externc ?

I’d have to dig into it, but yes, I think addDependency gets called quite
often before we start walking the tree.  But once you asked the question,
it did occur to me that we do call into the resolving code during the
walk, but I don’t know if that also results in addDependency.

-Alex 



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-08-24 Thread Frédéric THOMAS



 I’d have to dig into it, but yes, I think addDependency gets called quite
 often before we start walking the tree.  But once you asked the question,
 it did occur to me that we do call into the resolving code during the
 walk, but I don’t know if that also results in addDependency.

Not sure I understood everything but I can't see any call before walking the 
tree to FlexJSProject.addDependency() which is the function used to fill the 
requires that are then wrote in PackageHeaderEmitter using 
FlexJSProject.getRequires(), is there a function supposed to store the library 
definitions before the walk ?

Frédéric THOMAS

 From: aha...@adobe.com
 To: dev@flex.apache.org
 Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
 Date: Mon, 24 Aug 2015 12:55:05 +
 
 
 
 On 8/24/15, 2:21 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:
 
 Do you mean, the FlexJSProject.addDependency() should be called while the
 AST is generated for the libraries dependencies or maybe be a pass for
 collecting them as we do in the externc ?
 
 I’d have to dig into it, but yes, I think addDependency gets called quite
 often before we start walking the tree.  But once you asked the question,
 it did occur to me that we do call into the resolving code during the
 walk, but I don’t know if that also results in addDependency.
 
 -Alex   
 

  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-24 Thread Alex Harui


On 8/24/15, 8:07 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:




 I’d have to dig into it, but yes, I think addDependency gets called
quite
 often before we start walking the tree.  But once you asked the
question,
 it did occur to me that we do call into the resolving code during the
 walk, but I don’t know if that also results in addDependency.

Not sure I understood everything but I can't see any call before walking
the tree to FlexJSProject.addDependency() which is the function used to
fill the requires that are then wrote in PackageHeaderEmitter using
FlexJSProject.getRequires(), is there a function supposed to store the
library definitions before the walk ?

For me, when I compile a FlexJS example like FlexJSStore, addDependency is
called quite often while servicing “handleSyntaxTreeRequest” before any
walking of the AST.  I wonder if there is something different about the
way you are compiling this code you are working on.

-Alex
  



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-08-24 Thread Frédéric THOMAS
Do you mean, the FlexJSProject.addDependency() should be called while the AST 
is generated for the libraries dependencies or maybe be a pass for collecting 
them as we do in the externc ?

Frédéric THOMAS

 From: aha...@adobe.com
 To: dev@flex.apache.org
 Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
 Date: Sun, 23 Aug 2015 21:15:36 +
 
 
 
 On 8/23/15, 10:59 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:
 
 Hi Alex or Mike,
 
 Thanks for the advice, I've been checking that my lib was set in
 library-path but still the same, actually there's something that make me
 confused, maybe you can enlighten me:
 
 It seems to me the requires are collected during the emit phase as I can
 see FlexJSProject.addDependency() are called along the call chain from
 the emitPackageContents() if I followed well.
 So, given the emitPackageHeader() is called even before, how the
 dependencies for a same CU which are collected after could be included ?
 
 Hmm.  I wonder if we are missing some dependencies?  But, IIRC, some/most
 should still be there as things get resolved as the AST is generated.
 
 -Alex   
 
  

RE: [FlexJS] Framework using externs (was: Setup Error)

2015-08-23 Thread Frédéric THOMAS
Hi Alex or Mike,

Thanks for the advice, I've been checking that my lib was set in library-path 
but still the same, actually there's something that make me confused, maybe you 
can enlighten me:

It seems to me the requires are collected during the emit phase as I can see 
FlexJSProject.addDependency() are called along the call chain from the 
emitPackageContents() if I followed well.
So, given the emitPackageHeader() is called even before, how the dependencies 
for a same CU which are collected after could be included ?

Maybe I'm missing something though.

Thanks,
Frédéric THOMAS

 From: aha...@adobe.com
 To: dev@flex.apache.org
 Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
 Date: Fri, 21 Aug 2015 12:58:34 +
 
 I suspect the issue is:
 
 -Classes found in SWCs on the external-library-path are not goog.required.
 -Classes found in SWCs on the library-path are goog.required.
 
 It is a bit confusing, I suppose, but I don’t have an easier way to
 distinguish right now.  A JQuery.swc would go on the external-library path
 because its classes are going to be loaded some other way than
 goog.require.  But for this exercise, if you made a set of externs for
 Google Closure Library, you would put it on the library-path so its
 classes get goog.require’d but the code in the externs will not get linked
 in.
 
 HTH,
 -Alex
 
 On 8/21/15, 1:42 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:
 
 Cool, thanks for the details, I will try to pay attention to those @expose
 
 My first goal now is to migrate and compile Application because I want to
 validate it works generating a simple app based on it, so, I'm in the
 process to migrate and compile all sub elements, I finished with
 HTMLElementWrapper.
 
 Everything compiles but I just notice the goog.require() are not emitted,
 except if you know some of the possible reasons it can occur, I will have
 to debug it, in this case can you speed me up telling me where to break
 and what to check ?
 
 Thanks,
 Frédéric THOMAS
 
  From: aha...@adobe.com
  To: dev@flex.apache.org
  Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
  Date: Thu, 20 Aug 2015 23:06:33 +
  
  I think I have discovered that Sprite is intended to be more like
  SimpleApplication and serve as the base class for other applications.  I
  may end up creating some other base class in the org.apache.flex
 packages
  instead.
  
  On 8/8/15, 10:33 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:
  
   We shouldn’t. Make sure you are using the latest from flex-falcon
 repo.
  
  My bad, thanks.
  
   I don’t remember why we have sprite.js. Maybe Erik does. I’d rather
   remove it if we can.
  
  Yep, @Erik, any hint ?
  
  Still remain the start function def, should it be moved to an interface
  or removed too ?
  
  Frédéric THOMAS
  
  
  
   From: aha...@adobe.com
   To: dev@flex.apache.org
   Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
   Date: Sat, 8 Aug 2015 16:27:53 +
  
  
  
   On 8/8/15, 8:46 AM, Frédéric THOMAS webdoubl...@hotmail.com
 wrote:
  
  I thought I could have used the framework as a test for what I'm
 about
  to
  implement in the compiler to make IJ compiling externs/as3 based
  projects
  with 1 build conf.
  Apparently I was wrong but I will try to implement it first anyway.
  
  For the framework migration, I just had a look and indeed I will
 have a
  lot of questions, the 2 first ones:
  
  1- If I'm not wrong, sprite.js can't have an AS counterpart, this one
  needs to stay JS only but it includes a start method definition,
 not
  having this methos in the AS part, I won't be able to use it, should
  this
  definition be moved to an interface in asjs and be shared by both
 sides
  ?
  
   I don’t remember why we have sprite.js. Maybe Erik does. I’d rather
   remove it if we can.
  
  
  2- Classes and Interfaces are written this way in JS:
  
  org.apache.flex.core.IStrand.prototype.FLEXJS_CLASS_INFO ={ names: [{
  name: 'IStrand', qName: 'org.apache.flex.core.IStrand' }] };
  
  But if I cross compile IStrand.as, I get:
  
  org_apache_flex_core_IStrand.prototype.FLEXJS_CLASS_INFO = { names:
 [{
  name: 'IStrand', qName: 'org_apache_flex_core_IStrand'}] };
  
  Why we still have the underscores ?
  
   We shouldn’t. Make sure you are using the latest from flex-falcon
 repo.
  
   -Alex
  
  
  

 
  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-23 Thread Alex Harui


On 8/23/15, 10:59 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

Hi Alex or Mike,

Thanks for the advice, I've been checking that my lib was set in
library-path but still the same, actually there's something that make me
confused, maybe you can enlighten me:

It seems to me the requires are collected during the emit phase as I can
see FlexJSProject.addDependency() are called along the call chain from
the emitPackageContents() if I followed well.
So, given the emitPackageHeader() is called even before, how the
dependencies for a same CU which are collected after could be included ?

Hmm.  I wonder if we are missing some dependencies?  But, IIRC, some/most
should still be there as things get resolved as the AST is generated.

-Alex 



Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-21 Thread Alex Harui
I suspect the issue is:

-Classes found in SWCs on the external-library-path are not goog.required.
-Classes found in SWCs on the library-path are goog.required.

It is a bit confusing, I suppose, but I don’t have an easier way to
distinguish right now.  A JQuery.swc would go on the external-library path
because its classes are going to be loaded some other way than
goog.require.  But for this exercise, if you made a set of externs for
Google Closure Library, you would put it on the library-path so its
classes get goog.require’d but the code in the externs will not get linked
in.

HTH,
-Alex

On 8/21/15, 1:42 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

Cool, thanks for the details, I will try to pay attention to those @expose

My first goal now is to migrate and compile Application because I want to
validate it works generating a simple app based on it, so, I'm in the
process to migrate and compile all sub elements, I finished with
HTMLElementWrapper.

Everything compiles but I just notice the goog.require() are not emitted,
except if you know some of the possible reasons it can occur, I will have
to debug it, in this case can you speed me up telling me where to break
and what to check ?

Thanks,
Frédéric THOMAS

 From: aha...@adobe.com
 To: dev@flex.apache.org
 Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
 Date: Thu, 20 Aug 2015 23:06:33 +
 
 I think I have discovered that Sprite is intended to be more like
 SimpleApplication and serve as the base class for other applications.  I
 may end up creating some other base class in the org.apache.flex
packages
 instead.
 
 On 8/8/15, 10:33 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:
 
  We shouldn’t. Make sure you are using the latest from flex-falcon
repo.
 
 My bad, thanks.
 
  I don’t remember why we have sprite.js. Maybe Erik does. I’d rather
  remove it if we can.
 
 Yep, @Erik, any hint ?
 
 Still remain the start function def, should it be moved to an interface
 or removed too ?
 
 Frédéric THOMAS
 
 
 
  From: aha...@adobe.com
  To: dev@flex.apache.org
  Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
  Date: Sat, 8 Aug 2015 16:27:53 +
 
 
 
  On 8/8/15, 8:46 AM, Frédéric THOMAS webdoubl...@hotmail.com
wrote:
 
 I thought I could have used the framework as a test for what I'm
about
 to
 implement in the compiler to make IJ compiling externs/as3 based
 projects
 with 1 build conf.
 Apparently I was wrong but I will try to implement it first anyway.
 
 For the framework migration, I just had a look and indeed I will
have a
 lot of questions, the 2 first ones:
 
 1- If I'm not wrong, sprite.js can't have an AS counterpart, this one
 needs to stay JS only but it includes a start method definition,
not
 having this methos in the AS part, I won't be able to use it, should
 this
 definition be moved to an interface in asjs and be shared by both
sides
 ?
 
  I don’t remember why we have sprite.js. Maybe Erik does. I’d rather
  remove it if we can.
 
 
 2- Classes and Interfaces are written this way in JS:
 
 org.apache.flex.core.IStrand.prototype.FLEXJS_CLASS_INFO ={ names: [{
 name: 'IStrand', qName: 'org.apache.flex.core.IStrand' }] };
 
 But if I cross compile IStrand.as, I get:
 
 org_apache_flex_core_IStrand.prototype.FLEXJS_CLASS_INFO = { names:
[{
 name: 'IStrand', qName: 'org_apache_flex_core_IStrand'}] };
 
 Why we still have the underscores ?
 
  We shouldn’t. Make sure you are using the latest from flex-falcon
repo.
 
  -Alex
 
   
 
 



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-08-21 Thread Frédéric THOMAS
Cool, thanks for the details, I will try to pay attention to those @expose

My first goal now is to migrate and compile Application because I want to 
validate it works generating a simple app based on it, so, I'm in the process 
to migrate and compile all sub elements, I finished with HTMLElementWrapper.

Everything compiles but I just notice the goog.require() are not emitted, 
except if you know some of the possible reasons it can occur, I will have to 
debug it, in this case can you speed me up telling me where to break and what 
to check ?

Thanks,
Frédéric THOMAS

 From: aha...@adobe.com
 To: dev@flex.apache.org
 Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
 Date: Thu, 20 Aug 2015 23:06:33 +
 
 I think I have discovered that Sprite is intended to be more like
 SimpleApplication and serve as the base class for other applications.  I
 may end up creating some other base class in the org.apache.flex packages
 instead.
 
 On 8/8/15, 10:33 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:
 
  We shouldn’t. Make sure you are using the latest from flex-falcon repo.
 
 My bad, thanks.
 
  I don’t remember why we have sprite.js. Maybe Erik does. I’d rather
  remove it if we can.
 
 Yep, @Erik, any hint ?
 
 Still remain the start function def, should it be moved to an interface
 or removed too ?
 
 Frédéric THOMAS
 
 
 
  From: aha...@adobe.com
  To: dev@flex.apache.org
  Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
  Date: Sat, 8 Aug 2015 16:27:53 +
 
 
 
  On 8/8/15, 8:46 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:
 
 I thought I could have used the framework as a test for what I'm about
 to
 implement in the compiler to make IJ compiling externs/as3 based
 projects
 with 1 build conf.
 Apparently I was wrong but I will try to implement it first anyway.
 
 For the framework migration, I just had a look and indeed I will have a
 lot of questions, the 2 first ones:
 
 1- If I'm not wrong, sprite.js can't have an AS counterpart, this one
 needs to stay JS only but it includes a start method definition, not
 having this methos in the AS part, I won't be able to use it, should
 this
 definition be moved to an interface in asjs and be shared by both sides
 ?
 
  I don’t remember why we have sprite.js. Maybe Erik does. I’d rather
  remove it if we can.
 
 
 2- Classes and Interfaces are written this way in JS:
 
 org.apache.flex.core.IStrand.prototype.FLEXJS_CLASS_INFO ={ names: [{
 name: 'IStrand', qName: 'org.apache.flex.core.IStrand' }] };
 
 But if I cross compile IStrand.as, I get:
 
 org_apache_flex_core_IStrand.prototype.FLEXJS_CLASS_INFO = { names: [{
 name: 'IStrand', qName: 'org_apache_flex_core_IStrand'}] };
 
 Why we still have the underscores ?
 
  We shouldn’t. Make sure you are using the latest from flex-falcon repo.
 
  -Alex
 

 
  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-20 Thread Alex Harui
I think I have discovered that Sprite is intended to be more like
SimpleApplication and serve as the base class for other applications.  I
may end up creating some other base class in the org.apache.flex packages
instead.

On 8/8/15, 10:33 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

 We shouldn’t. Make sure you are using the latest from flex-falcon repo.

My bad, thanks.

 I don’t remember why we have sprite.js. Maybe Erik does. I’d rather
 remove it if we can.

Yep, @Erik, any hint ?

Still remain the start function def, should it be moved to an interface
or removed too ?

Frédéric THOMAS



 From: aha...@adobe.com
 To: dev@flex.apache.org
 Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
 Date: Sat, 8 Aug 2015 16:27:53 +



 On 8/8/15, 8:46 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

I thought I could have used the framework as a test for what I'm about
to
implement in the compiler to make IJ compiling externs/as3 based
projects
with 1 build conf.
Apparently I was wrong but I will try to implement it first anyway.

For the framework migration, I just had a look and indeed I will have a
lot of questions, the 2 first ones:

1- If I'm not wrong, sprite.js can't have an AS counterpart, this one
needs to stay JS only but it includes a start method definition, not
having this methos in the AS part, I won't be able to use it, should
this
definition be moved to an interface in asjs and be shared by both sides
?

 I don’t remember why we have sprite.js. Maybe Erik does. I’d rather
 remove it if we can.


2- Classes and Interfaces are written this way in JS:

org.apache.flex.core.IStrand.prototype.FLEXJS_CLASS_INFO ={ names: [{
name: 'IStrand', qName: 'org.apache.flex.core.IStrand' }] };

But if I cross compile IStrand.as, I get:

org_apache_flex_core_IStrand.prototype.FLEXJS_CLASS_INFO = { names: [{
name: 'IStrand', qName: 'org_apache_flex_core_IStrand'}] };

Why we still have the underscores ?

 We shouldn’t. Make sure you are using the latest from flex-falcon repo.

 -Alex

 



RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-19 Thread Frédéric THOMAS
Also, I don't know what to do with Language as() is(), there are reserved 
words, should we change them ?

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: Wed, 19 Aug 2015 22:17:29 +0100







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 +
 
 
 
  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
 
 
 


  

Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-19 Thread Alex Harui


On 8/19/15, 3:57 PM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

Also, I don't know what to do with Language as() is(), there are reserved
words, should we change them ?

I’m ok with changing it.

-Alex



RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-19 Thread Frédéric THOMAS
 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 ?
 
 Maybe to @export it?

Maybe I don't get it, what is the interest to export it ? 

In goog.events.Event it is declared like that:


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: Wed, 19 Aug 2015 21:47:17 +
 
 
 
 On 8/19/15, 2:17 PM, Frédéric THOMAS webdoubl...@hotmail.com wrote:
 
 
 
 
 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 ?
 
 You can try doing it as ‘expected’.  That could be old code, but GCL is
 picky about circular dependencies.
 
 
 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 ?
 
 Maybe to @export it?
 
 I don't see any reason either why CHANGE should be in
 org.apache.flex.events.Event.EventType, any idea ?
 
 Probably because it is a commonly used event name.  It doesn’t have to be
 that way.
 
 
 /**
  * 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 ?
 
 I think so.
 
 
 It takes time because I'm reviewing in the same time and my time is
 limited.
 
 Thanks for working on it.  Every little bit helps.
 
 -Alex
 
 
  

RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-19 Thread Frédéric THOMAS



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 +
 
 
 
  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
 
 
 

  

Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-19 Thread Alex Harui


On 8/19/15, 2:17 PM, Frédéric THOMAS webdoubl...@hotmail.com wrote:




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 ?

You can try doing it as ‘expected’.  That could be old code, but GCL is
picky about circular dependencies.


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 ?

Maybe to @export it?

I don't see any reason either why CHANGE should be in
org.apache.flex.events.Event.EventType, any idea ?

Probably because it is a commonly used event name.  It doesn’t have to be
that way.


/**
 * 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 ?

I think so.


It takes time because I'm reviewing in the same time and my time is
limited.

Thanks for working on it.  Every little bit helps.

-Alex
  



Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-19 Thread Alex Harui


On 8/19/15, 4:06 PM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

 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 ?
 
 Maybe to @export it?

Maybe I don't get it, what is the interest to export it ?

We currently export way more than we need to because things like
dataBinding and MXML attribute assignments use string names.  The Google
Closure Compiler may rename ’type' to ‘qq’.

Subclassing works fine, just name lookups fail.  Even event[‘type’] can
fail after optimization.

-Alex   
  



Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Alex Harui


On 8/10/15, 6:19 PM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

I'm trying now to compile the AS files in conditional compilation with
COMPILE::AS3, because the first phase of the compilation is COMPILE::JS,
I have JS.swc in my library-path.

I was aware that some conflicts could occur for example the Event class,
so I had the idea to introduce a new configuration variable
exclude-native-js-libraries that the compiler client set to true when
is in phase to COMPILE::AS3, the idea behind was to allow me, after the
configuration merge, at configuration validation time, to remove the
Native JS libraries (externs) from the list of library-path and
external-library-path, at the moment, I check the path contains js/libs
only, it is to be improved.

The code bellow shows how I do and when I inspect the ConfigurationBuffer
at the end of the method, the JS.swc is removed as expected, the problem
is that I still had some AmbiguousDefinition, after a bit of debug,
checking at the scope file, I've seen one of them was in the JS.swc, it
was included despite I removed it from the merged ConfigurationBuffer.

What did I miss ?

No idea.  You did remind me that I never finished investigating whether
there was a valid AS3 syntax for disambiguating a class without a package
and a class with a package.  Maybe the best thing for you right now is to
not worry about the conflict and see if there are other issues?  Or does
this issue block you somehow?

-Alex 



Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Alex Harui


On 8/10/15, 11:05 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

I even removed the entire library-path section and I've have no
compilation errors and the core tests passes, is that enough to ensure it
can be safely removed ?

Well, try running ‘ant main’, then in examples/DataBindingTest run Ant
again and see if you get any errors or warnings.  Maybe something changed
so that isn’t needed anymore.  You might just want to use a new
compile-js-config.xml file.


Another thing, I see that in BrowserEvent.js

/**
 * @type {?goog.events.BrowserEvent}
 */
org.apache.flex.events.BrowserEvent.prototype.wrappedEvent = null;

There is no extern definition for the GCL, I type those as Object, is it
fine ?

That file contains some dirty hacks, maybe we just won’t cross-compile it.


I added some missing potentially other properties and functions to this
class, one of them required an enum, instead, I did like that:

package org.apache.flex.core.BrowserEvent {

COMPILE::AS3
internal class MouseButton {}

COMPILE::JS
public class MouseButton {
public static const LEFT:MouseButton = new MouseButton(0, LEFT);
public static const MIDDLE:MouseButton = new MouseButton(1, MIDDLE);
public static const RIGHT:MouseButton = new MouseButton(2, RIGHT);

private var _index:uint;
private var _name:String;

public function MouseButton(index:uint, name:String):void {
_index = index;
_name = name;

}

public function get index():uint {
return _index;
}

public function get name():String {
return _name;
}
}
}


Is it ok or it is overkilling ?

What is the advantage of doing it this way?

Thanks for working on this,
Alex
  



RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Frédéric THOMAS
 Well, try running ‘ant main’, then in examples/DataBindingTest run Ant
 again and see if you get any errors or warnings. Maybe something changed
 so that isn’t needed anymore. You might just want to use a new
 compile-js-config.xml file.

Until Core is not totally migrated, that won't be possible.

I've seen in core/asjs, the default.css but haven't seen where it is used.

 What is the advantage of doing it this way?

My point in migrating the framework is also to figure out how a framework 
developer would feel comfortable working with, using and developing new 
component seeing how the others are developed, for example, even though this 
class is emitted in JS only, it is now coded in AS, except of the comments I 
added to this class which is a wrapper to the goog.events.BrowserEvent, if he 
needs to use it, the developer will probably look at the google doc too and I 
guess, expect to have as close as possible the same API.

Well, at least I did this assumption and was wondering if it wasn't to much.

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 06:37:13 +



 On 8/10/15, 11:05 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

I even removed the entire library-path section and I've have no
compilation errors and the core tests passes, is that enough to ensure it
can be safely removed ?

 Well, try running ‘ant main’, then in examples/DataBindingTest run Ant
 again and see if you get any errors or warnings. Maybe something changed
 so that isn’t needed anymore. You might just want to use a new
 compile-js-config.xml file.


Another thing, I see that in BrowserEvent.js

/**
 * @type {?goog.events.BrowserEvent}
 */
org.apache.flex.events.BrowserEvent.prototype.wrappedEvent = null;

There is no extern definition for the GCL, I type those as Object, is it
fine ?

 That file contains some dirty hacks, maybe we just won’t cross-compile it.


I added some missing potentially other properties and functions to this
class, one of them required an enum, instead, I did like that:

package org.apache.flex.core.BrowserEvent {

COMPILE::AS3
internal class MouseButton {}

COMPILE::JS
public class MouseButton {
 public static const LEFT:MouseButton = new MouseButton(0, LEFT);
 public static const MIDDLE:MouseButton = new MouseButton(1, MIDDLE);
 public static const RIGHT:MouseButton = new MouseButton(2, RIGHT);

 private var _index:uint;
 private var _name:String;

 public function MouseButton(index:uint, name:String):void {
 _index = index;
 _name = name;

 }

 public function get index():uint {
 return _index;
 }

 public function get name():String {
 return _name;
 }
}
}


Is it ok or it is overkilling ?

 What is the advantage of doing it this way?

 Thanks for working on this,
 Alex


  

RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Frédéric THOMAS
 No idea. You did remind me that I never finished investigating whether
 there was a valid AS3 syntax for disambiguating a class without a package
 and a class with a package. Maybe the best thing for you right now is to
 not worry about the conflict and see if there are other issues? Or does
 this issue block you somehow?

Actually, I've been to far, it was enough to filter the (external-) / 
library-path when set, taking care the new config var was set first.
I will probably have to add this new config var to the ant conf too.

Btw, I can now produce the Core.swc filled with the compiled AS3 classes and 
the JS in a once and in IntelliJ, indeed, I only migrated 1 JS file to AS but 
it is what I wanted first, validate I can do it, so, I will continue on it.

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 06:25:19 +



 On 8/10/15, 6:19 PM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

I'm trying now to compile the AS files in conditional compilation with
COMPILE::AS3, because the first phase of the compilation is COMPILE::JS,
I have JS.swc in my library-path.

I was aware that some conflicts could occur for example the Event class,
so I had the idea to introduce a new configuration variable
exclude-native-js-libraries that the compiler client set to true when
is in phase to COMPILE::AS3, the idea behind was to allow me, after the
configuration merge, at configuration validation time, to remove the
Native JS libraries (externs) from the list of library-path and
external-library-path, at the moment, I check the path contains js/libs
only, it is to be improved.

The code bellow shows how I do and when I inspect the ConfigurationBuffer
at the end of the method, the JS.swc is removed as expected, the problem
is that I still had some AmbiguousDefinition, after a bit of debug,
checking at the scope file, I've seen one of them was in the JS.swc, it
was included despite I removed it from the merged ConfigurationBuffer.

What did I miss ?

 No idea. You did remind me that I never finished investigating whether
 there was a valid AS3 syntax for disambiguating a class without a package
 and a class with a package. Maybe the best thing for you right now is to
 not worry about the conflict and see if there are other issues? Or does
 this issue block you somehow?

 -Alex

  

Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Alex Harui


On 8/11/15, 5:22 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:


 What is the advantage of doing it this way?

My point in migrating the framework is also to figure out how a framework
developer would feel comfortable working with, using and developing new
component seeing how the others are developed, for example, even though
this class is emitted in JS only, it is now coded in AS, except of the
comments I added to this class which is a wrapper to the
goog.events.BrowserEvent, if he needs to use it, the developer will
probably look at the google doc too and I guess, expect to have as close
as possible the same API.

Well, at least I did this assumption and was wondering if it wasn't to
much.

Makes sense.  I was just wondering why a MouseButton class is needed at
all and not just a plain String constant.

-Alex
  



Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Alex Harui


On 8/11/15, 5:31 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:


Btw, I can now produce the Core.swc filled with the compiled AS3 classes
and the JS in a once and in IntelliJ, indeed, I only migrated 1 JS file
to AS but it is what I wanted first, validate I can do it, so, I will
continue on it.

Awesome!

-Alex
  



RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Frédéric THOMAS
 Makes sense. I was just wondering why a MouseButton class is needed at
 all and not just a plain String constant.

Maybe is not, but I added, maybe I shouldn't had, isButton(button) = boolean 
which tests to see which button was pressed during the event, the type of 
button is goog.events.BrowserEvent.MouseButton which is declared as enum in 
goog.events.BrowserEvent:

/**
 * Normalized button constants for the mouse.
 * @enum {number}
 */
goog.events.BrowserEvent.MouseButton = {
  LEFT: 0,
  MIDDLE: 1,
  RIGHT: 2
};

The closer things I know to match the package and look close to enum is the 
code I shown (well, I could have prevented the constructor to be called to be 
closer).

The other solution would have been to let the developer fill the parameter with 
a uint or a constant but given that's a public API which is a wrapper to 
another public one, it seems to me it should be protected against bad values 
and should match as much as possible the google doc found for the wrapped 
class, I could be wrong to do that way though, that what why I asked before to 
continue this way for other classes which is btw more time consuming.

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 12:49:35 +



 On 8/11/15, 5:22 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:


 What is the advantage of doing it this way?

My point in migrating the framework is also to figure out how a framework
developer would feel comfortable working with, using and developing new
component seeing how the others are developed, for example, even though
this class is emitted in JS only, it is now coded in AS, except of the
comments I added to this class which is a wrapper to the
goog.events.BrowserEvent, if he needs to use it, the developer will
probably look at the google doc too and I guess, expect to have as close
as possible the same API.

Well, at least I did this assumption and was wondering if it wasn't to
much.

 Makes sense. I was just wondering why a MouseButton class is needed at
 all and not just a plain String constant.

 -Alex


  

Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Alex Harui


On 8/11/15, 6:37 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

 but no objection if that’s what folks want.

My first reaction when it comes to a public, is to offer a consistent,
safe and clear API but I'm open to anything too.

I think the definition of consistent and safe might have some trade-offs.
The resulting production code still needs to be small and fast so I tend
to prefer solutions where you can remove development-time checking you
don’t need I production.

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” /


Btw, I noticed the package, class and Object.defineProperties comments
are not copied to the generated JS, so neither the Apache header, is that
an issue ?

see: https://gist.github.com/doublefx/20b7949d3b9ff20daaa1

Generated code is not “source” so it won’t be in the source package or
repo and thus doesn’t have to have a header, but we might want to add one
anyway so it looks more official.

-Alex



RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Frédéric THOMAS
 I think the definition of consistent and safe might have some trade-offs.
 The resulting production code still needs to be small and fast so I tend
 to prefer solutions where you can remove development-time checking you
 don’t need I production.

I understand your point.

 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.

 Generated code is not “source” so it won’t be in the source package or
 repo and thus doesn’t have to have a header, but we might want to add one
 anyway so it looks more official.

Ah yeah, correct !

Thanks,
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 14:40:56 +



 On 8/11/15, 6:37 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

 but no objection if that’s what folks want.

My first reaction when it comes to a public, is to offer a consistent,
safe and clear API but I'm open to anything too.

 I think the definition of consistent and safe might have some trade-offs.
 The resulting production code still needs to be small and fast so I tend
 to prefer solutions where you can remove development-time checking you
 don’t need I production.

 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” /


Btw, I noticed the package, class and Object.defineProperties comments
are not copied to the generated JS, so neither the Apache header, is that
an issue ?

see: https://gist.github.com/doublefx/20b7949d3b9ff20daaa1

 Generated code is not “source” so it won’t be in the source package or
 repo and thus doesn’t have to have a header, but we might want to add one
 anyway so it looks more official.

 -Alex

  

Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Alex Harui


On 8/11/15, 6:06 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

 Makes sense. I was just wondering why a MouseButton class is needed at
 all and not just a plain String constant.

Maybe is not, but I added, maybe I shouldn't had, isButton(button) =
boolean which tests to see which button was pressed during the event, the
type of button is goog.events.BrowserEvent.MouseButton which is declared
as enum in goog.events.BrowserEvent:

/**
 * Normalized button constants for the mouse.
 * @enum {number}
 */
goog.events.BrowserEvent.MouseButton = {
  LEFT: 0,
  MIDDLE: 1,
  RIGHT: 2
};

The closer things I know to match the package and look close to enum is
the code I shown (well, I could have prevented the constructor to be
called to be closer).

The other solution would have been to let the developer fill the
parameter with a uint or a constant but given that's a public API which
is a wrapper to another public one, it seems to me it should be protected
against bad values and should match as much as possible the google doc
found for the wrapped class, I could be wrong to do that way though, that
what why I asked before to continue this way for other classes which is
btw more time consuming.

IMO, it would cause too much code bloat and take too much time to try to
protect inputs against bad values by adding classes like this.  In my
vision for FlexJS, we might produce debug-time beads that have extra
checking of uints and strings done at the start of the method.  In theory,
if you have tested your code before deploying, the production version
shouldn’t need this checking or extra class definitions.  What is more
important to me right now is that we get just enough functionality to
allow customers to produce something useful.  Folks did just fine with
current Flex not checking parameters, so I wouldn’t spend too much time on
something like this, but no objection if that’s what folks want.

-Alex



RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Frédéric THOMAS
 but no objection if that’s what folks want.

My first reaction when it comes to a public, is to offer a consistent, safe and 
clear API but I'm open to anything too.

Btw, I noticed the package, class and Object.defineProperties comments are not 
copied to the generated JS, so neither the Apache header, is that an issue ?

see: https://gist.github.com/doublefx/20b7949d3b9ff20daaa1


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 13:25:35 +



 On 8/11/15, 6:06 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

 Makes sense. I was just wondering why a MouseButton class is needed at
 all and not just a plain String constant.

Maybe is not, but I added, maybe I shouldn't had, isButton(button) =
boolean which tests to see which button was pressed during the event, the
type of button is goog.events.BrowserEvent.MouseButton which is declared
as enum in goog.events.BrowserEvent:

/**
 * Normalized button constants for the mouse.
 * @enum {number}
 */
goog.events.BrowserEvent.MouseButton = {
 LEFT: 0,
 MIDDLE: 1,
 RIGHT: 2
};

The closer things I know to match the package and look close to enum is
the code I shown (well, I could have prevented the constructor to be
called to be closer).

The other solution would have been to let the developer fill the
parameter with a uint or a constant but given that's a public API which
is a wrapper to another public one, it seems to me it should be protected
against bad values and should match as much as possible the google doc
found for the wrapped class, I could be wrong to do that way though, that
what why I asked before to continue this way for other classes which is
btw more time consuming.

 IMO, it would cause too much code bloat and take too much time to try to
 protect inputs against bad values by adding classes like this. In my
 vision for FlexJS, we might produce debug-time beads that have extra
 checking of uints and strings done at the start of the method. In theory,
 if you have tested your code before deploying, the production version
 shouldn’t need this checking or extra class definitions. What is more
 important to me right now is that we get just enough functionality to
 allow customers to produce something useful. Folks did just fine with
 current Flex not checking parameters, so I wouldn’t spend too much time on
 something like this, but no objection if that’s what folks want.

 -Alex

  

RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Frédéric THOMAS
 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 +



 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


  

Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-11 Thread Alex Harui


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
  



RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-10 Thread Frédéric THOMAS
I even removed the entire library-path section and I've have no compilation 
errors and the core tests passes, is that enough to ensure it can be safely 
removed ?

Another thing, I see that in BrowserEvent.js

/**
 * @type {?goog.events.BrowserEvent}
 */
org.apache.flex.events.BrowserEvent.prototype.wrappedEvent = null;

There is no extern definition for the GCL, I type those as Object, is it fine ?

Except of that, after some tweaking, BrowserEvent.as cross compiles and I have 
the @exports back, it was probably due to some config problem when trying to 
compile both AS3 / JS.

I added some missing potentially other properties and functions to this class, 
one of them required an enum, instead, I did like that:

package org.apache.flex.core.BrowserEvent {

COMPILE::AS3
internal class MouseButton {}

COMPILE::JS
public class MouseButton {
    public static const LEFT:MouseButton = new MouseButton(0, LEFT);
    public static const MIDDLE:MouseButton = new MouseButton(1, MIDDLE);
    public static const RIGHT:MouseButton = new MouseButton(2, RIGHT);

    private var _index:uint;
    private var _name:String;

    public function MouseButton(index:uint, name:String):void {
    _index = index;
    _name = name;

    }

    public function get index():uint {
    return _index;
    }

    public function get name():String {
    return _name;
    }
}
}


Is it ok or it is overkilling ?

As you can noticed, I had to create an empty AS3 internal class otherwise the 
sources are not found for the COMPILE::JS only classes.

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: Mon, 10 Aug 2015 13:07:35 +

 Hmm, might be a copy/paste error. Try removing HTML and Charts and see if
 you get an error.

 -Alex

 On 8/10/15, 5:57 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

Hi Alex,

I don't understand why we have that in
frameworks\projects\Core\compile-asjs-config.xml

library-path

 path-element../../libs/Core.swc/path-element
 path-element../../libs/Graphics.swc/path-element
 path-element../../libs/HTML.swc/path-element
 path-element../../libs/Charts.swc/path-element
/library-path

It looks like circular dependency, could you explain ?

Thanks,
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: Sun, 9 Aug 2015 16:42:19 +0100

 If that's the core swc then that's a mistake. Svg manifest should be
in html project

 Ok, thanks, will start migrating JS to AS in my next session.

 Frédéric THOMAS


 
 From: aha...@adobe.com
 To: webdoubl...@hotmail.com; dev@flex.apache.org
 Subject: Re: Re : Re: [FlexJS] Framework using externs (was: Setup
Error)
 Date: Sun, 9 Aug 2015 15:32:41 +

 If that's the core swc then that's a mistake. Svg manifest should be
in html project


 Sent from my LG G3, an ATT 4G LTE smartphone


 -- Original message--

 From: Frédéric THOMAS

 Date: Sun, Aug 9, 2015 8:16 AM

 To: dev@flex.apache.org;

 Subject:RE: Re : Re: [FlexJS] Framework using externs (was: Setup
Error)


 @Alex,

 Except of the @export, I've got an issue with:

 include-namespaces
 urilibrary://ns.apache.org/flexjs/basic/uri
 urilibrary://ns.apache.org/flexjs/svg/uri
 /include-namespaces


 TextButton is not found in library://ns.apache.org/flexjs/svg, where
is the manifest ? I'm a bit confuse here.

 If I remove it from include-namespace, I can now compile Core in
IntelliJ with only one build configuration, it generates all the JS and
the SWC in a once, not sure it is a valid SWC yet given I had to remove
this namespace, in more I didn't migrate the JS to AS yet, I copy them
into the SWC at the moment but my other test project tells me that I'm
on the right way because it uses conditional compilation and I can
generate the JS and SWC in a once too and it works.

 Frédéric THOMAS


 
 Date: Sun, 9 Aug 2015 12:28:51 +0100
 Subject: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
 From: webdoubl...@hotmail.com
 To: dev@flex.apache.org

 That's that Mike.
 I don't use the externc.

 --- Message initial ---

 De : Michael Schmalle teotigraphix...@gmail.com
 Envoyé : 9 août 2015 11:59
 A : dev@flex.apache.org
 Objet : Re: [FlexJS] Framework using externs (was: Setup Error)

 On Sun, Aug 9, 2015 at 1:06 AM, Alex Harui aha...@adobe.com wrote:



 On 8/8/15, 12:38 PM, Michael Schmalle teotigraphix...@gmail.com
wrote:

On Sat, Aug 8, 2015 at 1:39 PM, Frédéric THOMAS
webdoubl...@hotmail.com
wrote:

 Also, What to do to keep as doc, I've been trying -keep-asdoc but


Fred, I looked at the code quickly, this should work right now and
-keep-asdoc is ONLY for the @param description etc.

 It is supposed to grab all of the asdoc from

RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-10 Thread Frédéric THOMAS
I'm trying now to compile the AS files in conditional compilation with 
COMPILE::AS3, because the first phase of the compilation is COMPILE::JS, I have 
JS.swc in my library-path.

I was aware that some conflicts could occur for example the Event class, so I 
had the idea to introduce a new configuration variable 
exclude-native-js-libraries that the compiler client set to true when is in 
phase to COMPILE::AS3, the idea behind was to allow me, after the configuration 
merge, at configuration validation time, to remove the Native JS libraries 
(externs) from the list of library-path and external-library-path, at the 
moment, I check the path contains js/libs only, it is to be improved.

The code bellow shows how I do and when I inspect the ConfigurationBuffer at 
the end of the method, the JS.swc is removed as expected, the problem is that I 
still had some AmbiguousDefinition, after a bit of debug, checking at the scope 
file, I've seen one of them was in the JS.swc, it was included despite I 
removed it from the merged ConfigurationBuffer.

What did I miss ?

/**
 * Validate configuration options values.
 * 
 * @param configurationBuffer Configuration buffer.
 * @throws ConfigurationException Error.
 */
    public void validate(ConfigurationBuffer configurationBuffer) throws 
ConfigurationException
    {
    // process the merged configuration buffer. right, can't just process 
the args.
    processDeprecatedAndRemovedOptions(configurationBuffer);

    removeNativeJSLibrariesIfNeeded(configurationBuffer, 
compiler.library-path);
    removeNativeJSLibrariesIfNeeded(configurationBuffer, 
compiler.external-library-path);

    validateDumpConfig(configurationBuffer);
    }

    private void removeNativeJSLibrariesIfNeeded(ConfigurationBuffer buffer, 
String libraryPathVariable)
    throws ConfigurationException
    {

    boolean excludeNativeJS = false;
    try
    {
    final String configurationVar = 
buffer.peekSimpleConfigurationVar(exclude-native-js-libraries);

    if (configurationVar != null)
    {
    excludeNativeJS = 
configurationVar.equals(Boolean.TRUE.toString());
    }
    }
    catch (ConfigurationException ignored)
    {
    }

    if (excludeNativeJS)
    {
    ListConfigurationValue libPaths = null;
    try {
    libPaths = buffer.peekConfigurationVar(libraryPathVariable);
    } catch (ConfigurationException ignored) {
    }

    if (libPaths != null) {
    final ConfigurationValue configurationValue = libPaths.get(0);
    final ListString paths = configurationValue.getArgs();

    IteratorString pathIterator = paths.iterator();

    while (pathIterator.hasNext())
    {
    final String path = pathIterator.next();
    final boolean isNativeJS = path.contains(js/libs);

    if (isNativeJS)
    {
    pathIterator.remove();
    }
    }

    buffer.setVar(libraryPathVariable, paths, 
configurationValue.getSource() + .updated, configurationValue.getLine());
    }
    }
    }



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: Mon, 10 Aug 2015 19:05:54 +0100

 I even removed the entire library-path section and I've have no compilation 
 errors and the core tests passes, is that enough to ensure it can be safely 
 removed ?

 Another thing, I see that in BrowserEvent.js

 /**
 * @type {?goog.events.BrowserEvent}
 */
 org.apache.flex.events.BrowserEvent.prototype.wrappedEvent = null;

 There is no extern definition for the GCL, I type those as Object, is it fine 
 ?

 Except of that, after some tweaking, BrowserEvent.as cross compiles and I 
 have the @exports back, it was probably due to some config problem when 
 trying to compile both AS3 / JS.

 I added some missing potentially other properties and functions to this 
 class, one of them required an enum, instead, I did like that:

 package org.apache.flex.core.BrowserEvent {

 COMPILE::AS3
 internal class MouseButton {}

 COMPILE::JS
 public class MouseButton {
 public static const LEFT:MouseButton = new MouseButton(0, LEFT);
 public static const MIDDLE:MouseButton = new MouseButton(1, MIDDLE);
 public static const RIGHT:MouseButton = new MouseButton(2, RIGHT);

 private var _index:uint;
 private var _name:String;

 public function MouseButton(index:uint, name:String):void {
 _index = index;
 _name = name;

 }

 public function get index():uint {
 return _index;
 }

 public function get name():String {
 return _name;
 }
 }
 }


 Is it ok

RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-10 Thread Frédéric THOMAS
Hi Alex,

I don't understand why we have that in 
frameworks\projects\Core\compile-asjs-config.xml

library-path
    !-- compjsc won't 'link' these classes in, but will list their requires
     if these swcs are on the external-library-path then their requires
     will not be listed --
    path-element../../libs/Core.swc/path-element
    path-element../../libs/Graphics.swc/path-element
    path-element../../libs/HTML.swc/path-element
    path-element../../libs/Charts.swc/path-element
/library-path

It looks like circular dependency, could you explain ?

Thanks,
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: Sun, 9 Aug 2015 16:42:19 +0100

 If that's the core swc then that's a mistake. Svg manifest should be in html 
 project

 Ok, thanks, will start migrating JS to AS in my next session.

 Frédéric THOMAS


 
 From: aha...@adobe.com
 To: webdoubl...@hotmail.com; dev@flex.apache.org
 Subject: Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
 Date: Sun, 9 Aug 2015 15:32:41 +

 If that's the core swc then that's a mistake. Svg manifest should be in html 
 project


 Sent from my LG G3, an ATT 4G LTE smartphone


 -- Original message--

 From: Frédéric THOMAS

 Date: Sun, Aug 9, 2015 8:16 AM

 To: dev@flex.apache.org;

 Subject:RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)


 @Alex,

 Except of the @export, I've got an issue with:

 include-namespaces
 urilibrary://ns.apache.org/flexjs/basic/uri
 urilibrary://ns.apache.org/flexjs/svg/uri
 /include-namespaces


 TextButton is not found in library://ns.apache.org/flexjs/svg, where is the 
 manifest ? I'm a bit confuse here.

 If I remove it from include-namespace, I can now compile Core in IntelliJ 
 with only one build configuration, it generates all the JS and the SWC in a 
 once, not sure it is a valid SWC yet given I had to remove this namespace, 
 in more I didn't migrate the JS to AS yet, I copy them into the SWC at the 
 moment but my other test project tells me that I'm on the right way because 
 it uses conditional compilation and I can generate the JS and SWC in a once 
 too and it works.

 Frédéric THOMAS


 
 Date: Sun, 9 Aug 2015 12:28:51 +0100
 Subject: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
 From: webdoubl...@hotmail.com
 To: dev@flex.apache.org

 That's that Mike.
 I don't use the externc.

 --- Message initial ---

 De : Michael Schmalle teotigraphix...@gmail.com
 Envoyé : 9 août 2015 11:59
 A : dev@flex.apache.org
 Objet : Re: [FlexJS] Framework using externs (was: Setup Error)

 On Sun, Aug 9, 2015 at 1:06 AM, Alex Harui aha...@adobe.com wrote:



 On 8/8/15, 12:38 PM, Michael Schmalle teotigraphix...@gmail.com wrote:

On Sat, Aug 8, 2015 at 1:39 PM, Frédéric THOMAS webdoubl...@hotmail.com
wrote:

 Also, What to do to keep as doc, I've been trying -keep-asdoc but


Fred, I looked at the code quickly, this should work right now and
-keep-asdoc is ONLY for the @param description etc.

 It is supposed to grab all of the asdoc from the AS and append to the
 JSDoc. It sounds like the JSDoc emitter isn’t wired up correctly, and it
 is possible that the asdoc delegate is no longer configured correctly for
 externs.

 -Alex


 What is this thread actually about, I was aware of what was being copied
 but I thought this was about porting FlexJS .js code to AS classes.

 Is Fred making extern files for FlexJS code? If he is porting, then he is
 using the FlexJS emitter, I didn't do anything weird, is he using the JSC
 compiler?

 Mike


  

Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-10 Thread Alex Harui
Hmm, might be a copy/paste error.  Try removing HTML and Charts and see if
you get an error.

-Alex

On 8/10/15, 5:57 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

Hi Alex,

I don't understand why we have that in
frameworks\projects\Core\compile-asjs-config.xml

library-path
!-- compjsc won't 'link' these classes in, but will list their
requires
 if these swcs are on the external-library-path then their requires
 will not be listed --
path-element../../libs/Core.swc/path-element
path-element../../libs/Graphics.swc/path-element
path-element../../libs/HTML.swc/path-element
path-element../../libs/Charts.swc/path-element
/library-path

It looks like circular dependency, could you explain ?

Thanks,
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: Sun, 9 Aug 2015 16:42:19 +0100

 If that's the core swc then that's a mistake. Svg manifest should be
in html project

 Ok, thanks, will start migrating JS to AS in my next session.

 Frédéric THOMAS


 
 From: aha...@adobe.com
 To: webdoubl...@hotmail.com; dev@flex.apache.org
 Subject: Re: Re : Re: [FlexJS] Framework using externs (was: Setup
Error)
 Date: Sun, 9 Aug 2015 15:32:41 +

 If that's the core swc then that's a mistake. Svg manifest should be
in html project


 Sent from my LG G3, an ATT 4G LTE smartphone


 -- Original message--

 From: Frédéric THOMAS

 Date: Sun, Aug 9, 2015 8:16 AM

 To: dev@flex.apache.org;

 Subject:RE: Re : Re: [FlexJS] Framework using externs (was: Setup
Error)


 @Alex,

 Except of the @export, I've got an issue with:

 include-namespaces
 urilibrary://ns.apache.org/flexjs/basic/uri
 urilibrary://ns.apache.org/flexjs/svg/uri
 /include-namespaces


 TextButton is not found in library://ns.apache.org/flexjs/svg, where
is the manifest ? I'm a bit confuse here.

 If I remove it from include-namespace, I can now compile Core in
IntelliJ with only one build configuration, it generates all the JS and
the SWC in a once, not sure it is a valid SWC yet given I had to remove
this namespace, in more I didn't migrate the JS to AS yet, I copy them
into the SWC at the moment but my other test project tells me that I'm
on the right way because it uses conditional compilation and I can
generate the JS and SWC in a once too and it works.

 Frédéric THOMAS


 
 Date: Sun, 9 Aug 2015 12:28:51 +0100
 Subject: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
 From: webdoubl...@hotmail.com
 To: dev@flex.apache.org

 That's that Mike.
 I don't use the externc.

 --- Message initial ---

 De : Michael Schmalle teotigraphix...@gmail.com
 Envoyé : 9 août 2015 11:59
 A : dev@flex.apache.org
 Objet : Re: [FlexJS] Framework using externs (was: Setup Error)

 On Sun, Aug 9, 2015 at 1:06 AM, Alex Harui aha...@adobe.com wrote:



 On 8/8/15, 12:38 PM, Michael Schmalle teotigraphix...@gmail.com
wrote:

On Sat, Aug 8, 2015 at 1:39 PM, Frédéric THOMAS
webdoubl...@hotmail.com
wrote:

 Also, What to do to keep as doc, I've been trying -keep-asdoc but


Fred, I looked at the code quickly, this should work right now and
-keep-asdoc is ONLY for the @param description etc.

 It is supposed to grab all of the asdoc from the AS and append to the
 JSDoc. It sounds like the JSDoc emitter isn’t wired up correctly,
and it
 is possible that the asdoc delegate is no longer configured
correctly for
 externs.

 -Alex


 What is this thread actually about, I was aware of what was being
copied
 but I thought this was about porting FlexJS .js code to AS classes.

 Is Fred making extern files for FlexJS code? If he is porting, then
he is
 using the FlexJS emitter, I didn't do anything weird, is he using the
JSC
 compiler?

 Mike


 



Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-09 Thread Frédéric THOMAS
That's that Mike.
I don't use the externc.

--- Message initial ---

De : Michael Schmalle teotigraphix...@gmail.com
Envoyé : 9 août 2015 11:59
A : dev@flex.apache.org
Objet : Re: [FlexJS] Framework using externs (was: Setup Error)

On Sun, Aug 9, 2015 at 1:06 AM, Alex Harui aha...@adobe.com wrote:



 On 8/8/15, 12:38 PM, Michael Schmalle teotigraphix...@gmail.com wrote:

 On Sat, Aug 8, 2015 at 1:39 PM, Frédéric THOMAS webdoubl...@hotmail.com
 wrote:
 
  Also, What to do to keep as doc, I've been trying -keep-asdoc but
 
 
 Fred, I looked at the code quickly, this should work right now and
 -keep-asdoc is ONLY for the @param description etc.

 It is supposed to grab all of the asdoc from the AS and append to the
 JSDoc.  It sounds like the JSDoc emitter isn’t wired up correctly, and it
 is possible that the asdoc delegate is no longer configured correctly for
 externs.

 -Alex


What is this thread actually about, I was aware of what was being copied
but I thought this was about porting FlexJS .js code to AS classes.

Is Fred making extern files for FlexJS code? If he is porting, then he is
using the FlexJS emitter, I didn't do anything weird, is he using the JSC
compiler?

Mike


Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-09 Thread Michael Schmalle
On Sun, Aug 9, 2015 at 1:06 AM, Alex Harui aha...@adobe.com wrote:



 On 8/8/15, 12:38 PM, Michael Schmalle teotigraphix...@gmail.com wrote:

 On Sat, Aug 8, 2015 at 1:39 PM, Frédéric THOMAS webdoubl...@hotmail.com
 wrote:
 
  Also, What to do to keep as doc, I've been trying -keep-asdoc but
 
 
 Fred, I looked at the code quickly, this should work right now and
 -keep-asdoc is ONLY for the @param description etc.

 It is supposed to grab all of the asdoc from the AS and append to the
 JSDoc.  It sounds like the JSDoc emitter isn’t wired up correctly, and it
 is possible that the asdoc delegate is no longer configured correctly for
 externs.

 -Alex


What is this thread actually about, I was aware of what was being copied
but I thought this was about porting FlexJS .js code to AS classes.

Is Fred making extern files for FlexJS code? If he is porting, then he is
using the FlexJS emitter, I didn't do anything weird, is he using the JSC
compiler?

Mike


RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-09 Thread Frédéric THOMAS
@Alex,

Except of the @export, I've got an issue with:

    include-namespaces
    urilibrary://ns.apache.org/flexjs/basic/uri
        urilibrary://ns.apache.org/flexjs/svg/uri
    /include-namespaces  


TextButton is not found in library://ns.apache.org/flexjs/svg, where is the 
manifest ? I'm a bit confuse here.

If I remove it from include-namespace, I can now compile Core in IntelliJ with 
only one build configuration, it generates all the JS and the SWC in a once, 
not sure it is a valid SWC yet given I had to remove this namespace, in more I 
didn't migrate the JS to AS yet, I copy them into the SWC at the moment but my 
other test project tells me that I'm on the right way because it uses 
conditional compilation and I can generate the JS and SWC in a once too and it 
works.

Frédéric THOMAS



 Date: Sun, 9 Aug 2015 12:28:51 +0100
 Subject: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
 From: webdoubl...@hotmail.com
 To: dev@flex.apache.org

 That's that Mike.
 I don't use the externc.

 --- Message initial ---

 De : Michael Schmalle teotigraphix...@gmail.com
 Envoyé : 9 août 2015 11:59
 A : dev@flex.apache.org
 Objet : Re: [FlexJS] Framework using externs (was: Setup Error)

 On Sun, Aug 9, 2015 at 1:06 AM, Alex Harui aha...@adobe.com wrote:



 On 8/8/15, 12:38 PM, Michael Schmalle teotigraphix...@gmail.com wrote:

On Sat, Aug 8, 2015 at 1:39 PM, Frédéric THOMAS webdoubl...@hotmail.com
wrote:

 Also, What to do to keep as doc, I've been trying -keep-asdoc but


Fred, I looked at the code quickly, this should work right now and
-keep-asdoc is ONLY for the @param description etc.

 It is supposed to grab all of the asdoc from the AS and append to the
 JSDoc. It sounds like the JSDoc emitter isn’t wired up correctly, and it
 is possible that the asdoc delegate is no longer configured correctly for
 externs.

 -Alex


 What is this thread actually about, I was aware of what was being copied
 but I thought this was about porting FlexJS .js code to AS classes.

 Is Fred making extern files for FlexJS code? If he is porting, then he is
 using the FlexJS emitter, I didn't do anything weird, is he using the JSC
 compiler?

 Mike
  

Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-09 Thread Alex Harui
If that's the core swc then that's a mistake. Svg manifest should be in html 
project


Sent from my LG G3, an ATT 4G LTE smartphone


-- Original message--

From: Frédéric THOMAS

Date: Sun, Aug 9, 2015 8:16 AM

To: dev@flex.apache.org;

Subject:RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)


@Alex,

Except of the @export, I've got an issue with:

include-namespaces
urilibrary://ns.apache.org/flexjs/basic/uri
urilibrary://ns.apache.org/flexjs/svg/uri
/include-namespaces


TextButton is not found in library://ns.apache.org/flexjs/svg, where is the 
manifest ? I'm a bit confuse here.

If I remove it from include-namespace, I can now compile Core in IntelliJ with 
only one build configuration, it generates all the JS and the SWC in a once, 
not sure it is a valid SWC yet given I had to remove this namespace, in more I 
didn't migrate the JS to AS yet, I copy them into the SWC at the moment but my 
other test project tells me that I'm on the right way because it uses 
conditional compilation and I can generate the JS and SWC in a once too and it 
works.

Frédéric THOMAS



 Date: Sun, 9 Aug 2015 12:28:51 +0100
 Subject: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
 From: webdoubl...@hotmail.com
 To: dev@flex.apache.org

 That's that Mike.
 I don't use the externc.

 --- Message initial ---

 De : Michael Schmalle teotigraphix...@gmail.com
 Envoyé : 9 août 2015 11:59
 A : dev@flex.apache.org
 Objet : Re: [FlexJS] Framework using externs (was: Setup Error)

 On Sun, Aug 9, 2015 at 1:06 AM, Alex Harui aha...@adobe.com wrote:



 On 8/8/15, 12:38 PM, Michael Schmalle teotigraphix...@gmail.com wrote:

On Sat, Aug 8, 2015 at 1:39 PM, Frédéric THOMAS webdoubl...@hotmail.com
wrote:

 Also, What to do to keep as doc, I've been trying -keep-asdoc but


Fred, I looked at the code quickly, this should work right now and
-keep-asdoc is ONLY for the @param description etc.

 It is supposed to grab all of the asdoc from the AS and append to the
 JSDoc. It sounds like the JSDoc emitter isn’t wired up correctly, and it
 is possible that the asdoc delegate is no longer configured correctly for
 externs.

 -Alex


 What is this thread actually about, I was aware of what was being copied
 but I thought this was about porting FlexJS .js code to AS classes.

 Is Fred making extern files for FlexJS code? If he is porting, then he is
 using the FlexJS emitter, I didn't do anything weird, is he using the JSC
 compiler?

 Mike



RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-09 Thread Frédéric THOMAS
 If that's the core swc then that's a mistake. Svg manifest should be in html 
 project

Ok, thanks, will start migrating JS to AS in my next session.

Frédéric THOMAS



 From: aha...@adobe.com
 To: webdoubl...@hotmail.com; dev@flex.apache.org
 Subject: Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
 Date: Sun, 9 Aug 2015 15:32:41 +

 If that's the core swc then that's a mistake. Svg manifest should be in html 
 project


 Sent from my LG G3, an ATT 4G LTE smartphone


 -- Original message--

 From: Frédéric THOMAS

 Date: Sun, Aug 9, 2015 8:16 AM

 To: dev@flex.apache.org;

 Subject:RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)


 @Alex,

 Except of the @export, I've got an issue with:

 include-namespaces
 urilibrary://ns.apache.org/flexjs/basic/uri
 urilibrary://ns.apache.org/flexjs/svg/uri
 /include-namespaces


 TextButton is not found in library://ns.apache.org/flexjs/svg, where is the 
 manifest ? I'm a bit confuse here.

 If I remove it from include-namespace, I can now compile Core in IntelliJ 
 with only one build configuration, it generates all the JS and the SWC in a 
 once, not sure it is a valid SWC yet given I had to remove this namespace, in 
 more I didn't migrate the JS to AS yet, I copy them into the SWC at the 
 moment but my other test project tells me that I'm on the right way because 
 it uses conditional compilation and I can generate the JS and SWC in a once 
 too and it works.

 Frédéric THOMAS


 
 Date: Sun, 9 Aug 2015 12:28:51 +0100
 Subject: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
 From: webdoubl...@hotmail.com
 To: dev@flex.apache.org

 That's that Mike.
 I don't use the externc.

 --- Message initial ---

 De : Michael Schmalle teotigraphix...@gmail.com
 Envoyé : 9 août 2015 11:59
 A : dev@flex.apache.org
 Objet : Re: [FlexJS] Framework using externs (was: Setup Error)

 On Sun, Aug 9, 2015 at 1:06 AM, Alex Harui aha...@adobe.com wrote:



 On 8/8/15, 12:38 PM, Michael Schmalle teotigraphix...@gmail.com wrote:

On Sat, Aug 8, 2015 at 1:39 PM, Frédéric THOMAS webdoubl...@hotmail.com
wrote:

 Also, What to do to keep as doc, I've been trying -keep-asdoc but


Fred, I looked at the code quickly, this should work right now and
-keep-asdoc is ONLY for the @param description etc.

 It is supposed to grab all of the asdoc from the AS and append to the
 JSDoc. It sounds like the JSDoc emitter isn’t wired up correctly, and it
 is possible that the asdoc delegate is no longer configured correctly for
 externs.

 -Alex


 What is this thread actually about, I was aware of what was being copied
 but I thought this was about porting FlexJS .js code to AS classes.

 Is Fred making extern files for FlexJS code? If he is porting, then he is
 using the FlexJS emitter, I didn't do anything weird, is he using the JSC
 compiler?

 Mike

  

Re: [FlexJS] Framework using externs (was: Setup Error)

2015-08-08 Thread Alex Harui


On 8/8/15, 8:46 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

I thought I could have used the framework as a test for what I'm about to
implement in the compiler to make IJ compiling externs/as3 based projects
with 1 build conf.
Apparently I was wrong but I will try to implement it first anyway.

For the framework migration, I just had a look and indeed I will have a
lot of questions, the 2 first ones:

1- If I'm not wrong, sprite.js can't have an AS counterpart, this one
needs to stay JS only but it includes a start method definition, not
having this methos in the AS part, I won't be able to use it, should this
definition be moved to an interface in asjs and be shared by both sides ?

I don’t remember why we have sprite.js.  Maybe Erik does.  I’d rather
remove it if we can.


2- Classes and Interfaces are written this way in JS:

org.apache.flex.core.IStrand.prototype.FLEXJS_CLASS_INFO ={ names: [{
name: 'IStrand', qName: 'org.apache.flex.core.IStrand' }] };

But if I cross compile IStrand.as, I get:

org_apache_flex_core_IStrand.prototype.FLEXJS_CLASS_INFO = { names: [{
name: 'IStrand', qName: 'org_apache_flex_core_IStrand'}] };

Why we still have the underscores ?

We shouldn’t.  Make sure you are using the latest from flex-falcon repo.

-Alex 



RE: [FlexJS] Framework using externs (was: Setup Error)

2015-08-08 Thread Frédéric THOMAS
 We shouldn’t. Make sure you are using the latest from flex-falcon repo.

My bad, thanks.

 I don’t remember why we have sprite.js. Maybe Erik does. I’d rather
 remove it if we can.

Yep, @Erik, any hint ?

Still remain the start function def, should it be moved to an interface or 
removed too ?

Frédéric THOMAS



 From: aha...@adobe.com
 To: dev@flex.apache.org
 Subject: Re: [FlexJS] Framework using externs (was: Setup Error)
 Date: Sat, 8 Aug 2015 16:27:53 +



 On 8/8/15, 8:46 AM, Frédéric THOMAS webdoubl...@hotmail.com wrote:

I thought I could have used the framework as a test for what I'm about to
implement in the compiler to make IJ compiling externs/as3 based projects
with 1 build conf.
Apparently I was wrong but I will try to implement it first anyway.

For the framework migration, I just had a look and indeed I will have a
lot of questions, the 2 first ones:

1- If I'm not wrong, sprite.js can't have an AS counterpart, this one
needs to stay JS only but it includes a start method definition, not
having this methos in the AS part, I won't be able to use it, should this
definition be moved to an interface in asjs and be shared by both sides ?

 I don’t remember why we have sprite.js. Maybe Erik does. I’d rather
 remove it if we can.


2- Classes and Interfaces are written this way in JS:

org.apache.flex.core.IStrand.prototype.FLEXJS_CLASS_INFO ={ names: [{
name: 'IStrand', qName: 'org.apache.flex.core.IStrand' }] };

But if I cross compile IStrand.as, I get:

org_apache_flex_core_IStrand.prototype.FLEXJS_CLASS_INFO = { names: [{
name: 'IStrand', qName: 'org_apache_flex_core_IStrand'}] };

Why we still have the underscores ?

 We shouldn’t. Make sure you are using the latest from flex-falcon repo.

 -Alex

  

  1   2   >