Yeah, if we could make it work without creating a SWC, I think that would be ideal. The fewer steps it takes to add third-party libraries to a project, the better.
I notice that you seem to have a preference for custom ASDoc tags, like @externs or @flexjsignorecoercion for changing the compiler's behavior. Why not metadata, like [Extern] or [IgnoreCoercion], instead? Personally, using ASDoc tags for something other than documentation doesn't feel quite right to me. Metadata has long been used to pass extra information to the compiler, though. Plus, if something needs more complex configuration, metadata is more like setting properties on an object: [Metadata(option1="true",option2="hello world")]. I've been meaning to ask you about this for a while, but I kept forgetting. - Josh On Mon, Dec 12, 2016 at 8:46 AM, Alex Harui <aha...@adobe.com> wrote: > > > On 12/12/16, 8:37 AM, "Josh Tynjala" <joshtynj...@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 > >