flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frédéric THOMAS <webdoubl...@hotmail.com>
Subject RE: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
Date Tue, 11 Aug 2015 15:15:31 GMT
> I think the definition of consistent and safe might have some trade-offs.
> The resulting production code still needs to be small and fast so I tend
> to prefer solutions where you can remove development-time checking you
> don’t need I production.

I understand your point.

> Also, another point I just remembered is MXML. I don’t know that
> MouseButton would actually show up in MXML attribute values but for other
> things it might be better to use simple String constants and do extra
> checking inside so your MXML looks like:
>
> <sometag someAttribute=“someValue” />
>
> Instead of
>
> <sometag someAttribute=“{SomeClass.someValue}” />
>
> Or
>
> <sometag someAttribute=“{new UtilityClass(‘someValue’))}”
>
> At least for now until someone figures out how to get the compiler to
> optimize out the binding expression. I’ve always wished we could do:
>
> <sometag someAttribute=“SomeClass.someConst” />

In libraries, for the Enum like classes, I use to add things like MyEnum.fromIndex(index:uint):MyEnum
and MyEnum.fromLabel(label:String):MyEnum, so, it can be used in the same way than "new UtilityClass(‘someValue’))"
but it belongs the same class where the data resides.

> Generated code is not “source” so it won’t be in the source package or
> repo and thus doesn’t have to have a header, but we might want to add one
> anyway so it looks more official.

Ah yeah, correct !

Thanks,
Frédéric THOMAS


----------------------------------------
> From: aharui@adobe.com
> To: dev@flex.apache.org
> Subject: Re: Re : Re: [FlexJS] Framework using externs (was: Setup Error)
> Date: Tue, 11 Aug 2015 14:40:56 +0000
>
>
>
> On 8/11/15, 6:37 AM, "Frédéric THOMAS" <webdoublefx@hotmail.com> wrote:
>
>>> but no objection if that’s what folks want.
>>
>>My first reaction when it comes to a public, is to offer a consistent,
>>safe and clear API but I'm open to anything too.
>
> I think the definition of consistent and safe might have some trade-offs.
> The resulting production code still needs to be small and fast so I tend
> to prefer solutions where you can remove development-time checking you
> don’t need I production.
>
> Also, another point I just remembered is MXML. I don’t know that
> MouseButton would actually show up in MXML attribute values but for other
> things it might be better to use simple String constants and do extra
> checking inside so your MXML looks like:
>
> <sometag someAttribute=“someValue” />
>
> Instead of
>
> <sometag someAttribute=“{SomeClass.someValue}” />
>
> Or
>
> <sometag someAttribute=“{new UtilityClass(‘someValue’))}”
>
> At least for now until someone figures out how to get the compiler to
> optimize out the binding expression. I’ve always wished we could do:
>
> <sometag someAttribute=“SomeClass.someConst” />
>
>>
>>Btw, I noticed the package, class and Object.defineProperties comments
>>are not copied to the generated JS, so neither the Apache header, is that
>>an issue ?
>>
>>see: https://gist.github.com/doublefx/20b7949d3b9ff20daaa1
>
> Generated code is not “source” so it won’t be in the source package or
> repo and thus doesn’t have to have a header, but we might want to add one
> anyway so it looks more official.
>
> -Alex
>
 		 	   		  
Mime
View raw message