flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: FlexJS creating new typedefs
Date Sun, 31 Jul 2016 06:20:25 GMT

On 7/30/16, 10:59 PM, "Harbs" <harbs.lists@gmail.com> wrote:

>What’s the best way of going about creating new typedefs for a JS library
>which doesn’t have JSDoc type definitions?
>I’d like to create typedefs for OpenTypeJS[1] but there’s no comments to
>The only two ways I can think of are:
>1. Go into the JS code and manually add comments for everything (and then
>do a pull request). Then use externc to produce a swc.
>2. Create ActionScript stubs for all the functions and use compc to
>create a swc.
>Is there another option (or tool to make it easier) that I’m missing?
>Which of these two approaches makes more sense?

What do you get when you run externc?  Can the results be post-processed?

IMO, option #1 is the theoretical best.  If you can convince the OpenType
folks to switch to Google's JSDoc then you get any future changes for free
(assuming they are accurate).

Option #2 will let you compile and debug so if you are in a hurry and
OpenType doesn't change much, AS Stubs might be quickest, but in
production you still need a JS file in externs format for the GCC
optimizer.  ExternC has a -jsroot option to generate an externs format .js
file from js source with JSDoc.  See the CreateJS build.

Note that the Ant and Maven builds allow for patching of the downloaded
source.  For CreateJS, we do a fair amount of find/replace to automate
creating a better set of .js files for externc to consume.



View raw message