royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <>
Subject Re: Public Vars
Date Tue, 20 Feb 2018 18:23:05 GMT
As a said, it mainly matters for MXML, Binding, and States.

I believe it will matter in accessing modules and a module accessing the
thing that loaded the module, and any other access by the original
property name.

I think it will matter in accessing Value Objects that are instantiated in
the code instead of externally if that Value Object is not [Bindable].
IOW, if you take some JSON and convert it to a plain Objects and tell the
compiler that it is one of your Value Objects, that should work, but if
you then create a new instance of a Value Object and set its properties in
the code, I think that won't always work.

Maybe we'll end up turning this flag off by default in MXMLC and on by
default for COMPC or something like that.  The goal is to catch places in
the framework where it could matter to increase the chances that the
js-release will work on the first try.  The sweep definitely caught some
things that needed to be changed.  I might have suppressed some warnings
on things that will need to be changed, not sure.

Of course, I could be wrong...

On 2/20/18, 10:07 AM, "Gabe Harbs" <> wrote:

>I have over 700 public vars in my app and it handles minification just
>AFAIK, public vars are only a problem for classes and properties used in
>MXML. Am I wrong?
>> On Feb 20, 2018, at 7:26 PM, Alex Harui <>
>> Hi,
>> I just pushed compiler changes that will default to reporting a new
>> warning if you have public var in your Royale code.  Public methods,
>> getters and setters are fine, but public vars do not handle
>> I also just pushed a sweep of the framework code to eliminate public var
>> usage or add a directive to suppress the warning.  At some point in
>>time I
>> will probably sweep the examples, but I'm letting it spit a few warnings
>> for now.  I hope to remove the * selector this week and that will
>> another sweep of the examples.
>> Not using public vars should increase the changes that your minified
>> will run.  I put some information about public var usage in the wiki.
>> not sure if or where it should go in the user doc.  Users may be able
>> survive with more public vars since it mainly matters for vars used in
>> MXML, Binding, and States.  But we want the framework to be clean, so if
>> you see a warning from your framework code, please clean it up.
>> Thanks,
>> -Alex

View raw message