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] dts2as, meet as2dts (was: Release FlexJS/FalconJX 0.6.0)
Date Wed, 16 Mar 2016 00:00:25 GMT

On 3/15/16, 3:16 PM, "Andy Dufilie" <andy.dufilie@gmail.com> wrote:

>I'm using as2dts in my own project [5] because we're writing all the GUI
>TypeScript/React (which I highly recommend looking into) but using an AS
>core [6] via FlexJS and it would be a nightmare to develop things without
>strong typing information.

I just took a quick look at React.  What is it you like about it?  If it
is the actual UI library itself, I would have to wonder what it would take
to wrap up their UI Library so it could be used in MXML.  The JSX I saw
seemed to have a lot of non-XML around it.

>An interesting note is that TypeScript allows templating like
>Array<MyClass>, so I've added a way in as2dts to support that.  It handles
>comments surrounded by /*/../*/ to denote TS typings and/or template info
>inline in your AS code.  For example [7][8]:
>public static function getDescendants/*/<T>/*/(object:ILinkableObject,
>filter:/*/new(..._:any[])=>T | string/*/Class = null):Array/*/<T &
>static getDescendants<T>(object: ILinkableObject, filter?: new (..._:
>=> T | string): Array<T & ILinkableObject>;
>TS does type inference, so if you create a variable like this (using the
>class Weave):
>var result = Weave.getDescendants(root, MyClass);
>the compiler will now know that result is of type MyClass[], without
>to specify it like var result:MyClass[].

If FlexJS becomes popular, I'm sure we'll end up having to support
templates some day.  Volunteers are welcome to start now.


View raw message