flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: Avoiding goog renaming
Date Mon, 12 Dec 2016 16:46:14 GMT


On 12/12/16, 8:37 AM, "Josh Tynjala" <joshtynjala@gmail.com> wrote:

>I think most developers would be
>more comfortable writing a few classes in ActionScript for a third-party
>library,

Agreed, because not only do you get type-checking, but you also get to
"bullet-proof" the API.  For these JS libraries that you pass a plain
object to that has to have certain properties with certain values, you can
define a type for it with appropriate defaults and constants so you don't
make typos, don't pass the wrong thing into the wrong method, etc.

So there are two ideas, not mutually exclusive, on the table right now:
1) Add an externs output type that only COMPJS would recognize.  It would
skip the goog.provide and goog.requires output and maybe automatically
package any .JS files into a SWC.
2) Allow an @externs ASDoc annotation that would cause the compiler to use
the output JS file as an extern.  Then you don't need to actually build a
SWC.  You would be designating certain files in your project's source code
as an extern.  IMO, we want to encourage folks to build out re-usable SWCs
to be shared with the community, but this option might be the lowest
barrier for some, especially if you have to hook into some in-house JS
library.

Other ideas are welcome.

-Alex

Mime
View raw message