Curious Josh if your typescript definition compiler can replace externc?
How much overlap is there?

I wanted to do exactly what you did with typescipt and use it's compiler
but I didn't have enough time so I went the gcc extern route, there was a
couple massive discussions a year ago bout that and using typescript
definition files.

Mike

On Sun, Mar 13, 2016 at 4:08 PM, Christofer Dutz <christofer.d...@c-ware.de>
wrote:

> Thanks for the explanation :-)
>
> And what's actually happening in GCL? Here I can see a whole bunch of
> JavaScript files as well as matching ActionScript sources. Here the out/as
> sort of contains the same classes as the src directory, but the ones in the
> src contain Apache headers and some imports. Is this eventually a relic
> because the generated code had problems, that the generated code was
> checked in in order to manually fix stuff. The generated code isn't picked
> up as it is not mentioned in the source-path of the compile-config.xml
> file. So actually downloading the lib, processing it and generating the AS
> is simply obsolete now?
>
> The "js" extern directory seems to be similar, but in this case it seems
> that only a hand full of classes are manually added. Is this too just a
> "monkey patch" of falsely generated code and the "src" directory has
> precedence before the "out/as" one?
>
> Chris
>
> ________________________________________
> Von: Josh Tynjala <joshtynj...@gmail.com>
> Gesendet: Sonntag, 13. März 2016 19:09
> An: dev@flex.apache.org
> Betreff: Re: AW: AW: AW: AW: AW: AW: AW: LAST CALL] Release
> FlexJS/FalconJX 0.6.0
>
> 1. Externs tell the Google Closure compiler which JS APIs it shouldn't
> rename when optimizing/minifying because they come from external libraries.
>
> They're also a handy way to get all the interfaces for a JS library
> because...
>
> 2. externc generates ActionScript stubs from the externs. When we compile a
> SWC from them, we get something kind of like playerglobal.swc, but for a JS
> library. Something the compiler can use the check types, and an IDE can use
> to suggest APIs, but not actually included in the output.
>
> 3. The SWF would compile, but you'd get runtime errors in Flash Player or
> AIR because the libraries don't exist there.
>
> - Josh
> On Mar 13, 2016 9:46 AM, "Christofer Dutz" <christofer.d...@c-ware.de>
> wrote:
>
> > Hi Alex,
> >
> > having a look at everything I think I am figuring out how to build the
> > externs:
> > 1. Get the JavaScript code:
> >         - google_maps, jasmine, jquery, js are downloaded in
> > compiler.jx/downloads.xml
> >         - cordova, GCL and node is manually checked in (Guess the input
> > didn't work well with EXTERNC, so it was manually
> >           tweaked instead of writing the replacement rules for it.)
> >         - createjs is downloaded by externs/createjs/build.xml
> >     In the end each directory contains an "externs" directory containing
> > JavaScript input
> >
> > 2. Do some post processing by replacing stuff, that was probably causing
> > problems with EXTERNC
> >
> > 3. Run EXTERNC to generate ActionScript from the JavaScript input and
> > output that code to "out/as"
> >
> > 4. Use falcon to compile the code in "src" and "out/as" into an swc.
> >
> > Am I correct with this? If yes, it would have been great, if at least two
> > externs would actually do it the same way ;-)
> >
> > In any case, I do have a few big questions:
> > - What are externs?
> > - What does EXTERNC actually do? The Input JavaScript files don't seem to
> > contain any form of logic and only seem to be some sort of interface, but
> > interfaces to what?
> > - If EXTERNC generates an ActionScript stub to connect to the real lib in
> > a real JavaScript environment, what happens if I do a Flash compile with
> > externs?
> >
> > I think the best solution would be to provide a maven-plugin with 2/3
> > goals:
> > - prepare: to download/unpack any javascript resources and do the
> > replacing of strings (executed in Mavens generate-sources phase). The
> stuff
> > will be output to "target/generated-sources/externs-js"
> > - externc: to generate the ActionScript code based on the "externs-js"
> > JavaScript to "target/generated-sources/externs-as"(executed in Mavens
> > generate-sources phase after the prepare goal) (Eventually I should merge
> > both logical goals into one real one)
> > - compile: a simple wrapper that passes the 3 or 4 commandline args to
> the
> > falcon compiler to compile the sources in "src/main/flex" and
> > "target/generated-sources/externs-as" into a SWC
> > - Pull out the tests that use externs from compiler.jx as they seem to
> add
> > a circular dependency between compiler.jx and the externs as I need the
> > externs built in order to run some of the tests and I need part of
> > compiler.jx to be built in order to build the externs. (Would suggest
> some
> > sort of "testsuite" project, that could also contain the "SDKSWCTests"
> form
> > the compiler package, which causes a similar circularity with the flex
> sdk
> > and the compiler itself.
> >
> > Currently I used the exec-maven-plugin for both goals, but I guess a
> > dedicated goal is easier to understand and makes the configuration a lot
> > easier.
> >
> > Chris
> >
> > ________________________________________
> > Von: Alex Harui <aha...@adobe.com>
> > Gesendet: Sonntag, 13. März 2016 15:26
> > An: dev@flex.apache.org
> > Betreff: Re: AW: AW: AW: AW: AW: AW: LAST CALL] Release FlexJS/FalconJX
> > 0.6.0
> >
> > On 3/13/16, 3:53 AM, "Christofer Dutz" <christofer.d...@c-ware.de>
> wrote:
> >
> > >Ok so it seems that I will have to convert each one into a dedicated
> > >maven module. This will take some time :-(
> >
> > Unfortunately, that's probably true.
> >
> > IMO, there is some source, usually JS, which is downloaded, sometimes
> > modified by script, or handwritten.  A few like GCL have AS source.
> >
> > If there is JS source, it is then converted to AS output.
> >
> > Then a SWC is built in the "usual" way.
> >
> > HTH,
> > -Alex
> >
> > >
> > >Eventually I'll create a maven-plugin to build the externs but for now
> > >I'll start creating the artifacts individually until I find out how to
> > >setup a common build.
> > >
> > >Chris
> > >
> > >________________________________________
> > >Von: Alex Harui <aha...@adobe.com>
> > >Gesendet: Sonntag, 13. März 2016 06:14
> > >An: dev@flex.apache.org
> > >Betreff: Re: AW: AW: AW: AW: AW: LAST CALL] Release FlexJS/FalconJX
> 0.6.0
> > >
> > >I assume you mean "externs".
> > >
> > >There are now 8 extern swcs, and they are created with at least 3
> > >different formulas.
> > >
> > >GCL.swc is created from .AS files in GCL/src
> > >createjs.swc has its own build.xml that downloads the CreateJS source,
> > >does a bunch of replace/sed on that source.
> > >I have not looked at how node.swc is created.
> > >cordova.swc is created from .JS files we made up.
> > >jquery, jasmine, google_maps are created by downloading from github. In
> > >the Ant build, the download happens in compiler.jx/downloads.xml
> > >For JS.swc, the compiler.jx/downloads.xml also downloads the Google
> > >Closure Compiler source, and in GCC source is a file called externs.zip
> > >which contains the files used for js.swc (along with missing.js which we
> > >wrote).
> > >
> > >HTH,
> > >-Alex
> > >
> > >On 3/12/16, 1:04 PM, "Christofer Dutz" <christofer.d...@c-ware.de>
> wrote:
> > >
> > >>Hi Alex (or anyone able to explain to me the thing with the
> "externals")
> > >>
> > >>What is the externals directory and how is it built? It sort of looks
> as
> > >>if Ant downloads stuff and unpacks it in the externals directory but
> it's
> > >>really tricky to understand what's actually happening. I want to
> > >>replicate the behaviour in Maven, but this is hard, if you don't
> > >>understand what's actually going on.
> > >>
> > >>Chris
> > >>
> > >>________________________________________
> > >>Von: Christofer Dutz <christofer.d...@c-ware.de>
> > >>Gesendet: Samstag, 12. März 2016 20:01
> > >>An: dev@flex.apache.org
> > >>Betreff: AW: AW: AW: AW: AW: LAST CALL] Release FlexJS/FalconJX 0.6.0
> > >>
> > >>Well I'm currently down to 0 errors and failures for "compiler" and
> > >>managed to get "compiler.jx" down to:
> > >>
> > >>Tests run: 1274, Failures: 15, Errors: 26, Skipped: 9
> > >>
> > >>I guess the ones still failing have to be related to the externs
> modules.
> > >>These are the ones I'm dealing with at the moment.
> > >>
> > >>Well I'm currently making great progress on this topic and hoping to
> have
> > >>it finished till ApacheCon ... I just didn't want a release to hold me
> > >>back for long. How long would I have to keep my feet still in case of a
> > >>release?
> > >>
> > >>Chris
> > >>
> > >>________________________________________
> > >>Von: Alex Harui <aha...@adobe.com>
> > >>Gesendet: Samstag, 12. März 2016 16:09
> > >>An: dev@flex.apache.org
> > >>Betreff: Re: AW: AW: AW: AW: LAST CALL] Release FlexJS/FalconJX 0.6.0
> > >>
> > >>On 3/12/16, 3:56 AM, "Christofer Dutz" <christofer.d...@c-ware.de>
> > wrote:
> > >>
> > >>>I am currently on the finishing line of preparing falcon and falcon.jx
> > >>>to
> > >>>be converted to Maven.
> > >>>For this I will probably need to do a few more tweaks of the
> testsuite,
> > >>>but it's looking good.
> > >>
> > >>Wow! Great progress!
> > >>
> > >>>
> > >>>When are you planning on cutting the release branch?
> > >>
> > >>Are you asking about getting the Maven integration into the 0.6.0
> > >>release?
> > >> Or just trying to merge it into develop after I cut the release
> branch?
> > >>
> > >>-Alex
> > >>
> > >
>

Reply via email to