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

Reply via email to