FlexJS Closure warnings

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

FlexJS Closure warnings

Harbs
I’ve been getting hundreds of warnings when FlexJS runs GCC.

It’s kind of weird that the errors seem to be in the Google library files.

FlexJSStore generates 119 warnings for me. My app generates over 300 warnings. Some of additional ones are in the typedef files.

Harbs
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS Closure warnings

piotrz
Hi Harbs,

I can confirm that I have also a lot of warnings in Maven build. Even with simple project.

Thanks,
Piotr

Reply | Threaded
Open this post in threaded view
|

Re: FlexJS Closure warnings

Josh Tynjala
In reply to this post by Harbs
I remember seeing that Alex updated to a newer version of Closure compiler
recently. I don't recall if he updated Closure library at the same time. As
I understand it, it's a good idea to keep them both in sync.

- Josh

On Aug 22, 2017 3:43 AM, "Harbs" <[hidden email]> wrote:

> I’ve been getting hundreds of warnings when FlexJS runs GCC.
>
> It’s kind of weird that the errors seem to be in the Google library files.
>
> FlexJSStore generates 119 warnings for me. My app generates over 300
> warnings. Some of additional ones are in the typedef files.
>
> Harbs
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS Closure warnings

piotrz
I did it for Maven as I remember [1], but it seems that we are missing it here [2]. - It doesn't have influence on warnings. - Could I miss some places ?

As for the ant I think closure library has been downloaded from master without pointing any specific version, but I'm not sure - It has to be confirmed.

[1] https://github.com/apache/flex-falcon/blob/develop/compiler-jx/pom.xml
[2] https://github.com/apache/flex-falcon/blob/develop/debugger/pom.xml

Thanks,
Piotr
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS Closure warnings

Alex Harui-2
Some are from Closure Library. I haven't really looked into why.  I don't
think we are on the absolute latest, so we might need to move there.

Others are from our code because we are now annotating the
Object.defineProperties getter/setters with @type information, but we
don't force the inclusion of the types used by getter/setters in the
output.  So, a simple getter of some interface type where the interface
isn't ever really used can cause such a warning.  So does references to
WrappedHTMLElement which is just a fake type we use at compile time.  We
need to decide whether to suppress those warnings, or fatten the output by
including types only referenced by getter/setters that aren't referenced
in elsewhere, including their method bodies, or probably, indicate in the
code which ones can be suppressed or rewritten to not cause a warning.
Haven't thought about it too much as this was part of seeing if
minification could act as obfuscation.  Not sure if we've reached a
conclusion on that either.

Thoughts?
-Alex

On 8/22/17, 6:31 AM, "piotrz" <[hidden email]> wrote:

>I did it for Maven as I remember [1], but it seems that we are missing it
>here [2]. - It doesn't have influence on warnings. - Could I miss some
>places ?
>
>As for the ant I think closure library has been downloaded from master
>without pointing any specific version, but I'm not sure - It has to be
>confirmed.
>
>[1]
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
>m%2Fapache%2Fflex-falcon%2Fblob%2Fdevelop%2Fcompiler-jx%2Fpom.xml&data=02%
>7C01%7C%7C421273163ecb41539c1208d4e962681c%7Cfa7b1b5a7b34438794aed2c178dec
>ee1%7C0%7C0%7C636390056254236146&sdata=4scr0UhFN8MWjf%2BV2KhIptQsxxhJmrKw7
>RSX3U9btW8%3D&reserved=0
>[2]
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
>m%2Fapache%2Fflex-falcon%2Fblob%2Fdevelop%2Fdebugger%2Fpom.xml&data=02%7C0
>1%7C%7C421273163ecb41539c1208d4e962681c%7Cfa7b1b5a7b34438794aed2c178decee1
>%7C0%7C0%7C636390056254236146&sdata=TszqCn2%2BgjnJ7IzkxHajNJq%2Bw3BTubaqSI
>DYdQwzoCA%3D&reserved=0
>
>Thanks,
>Piotr
>
>
>
>
>-----
>Apache Flex PMC
>[hidden email]
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.2333347.n4.nabble.com%2FFlexJS-Closure-warnings-tp63939p6394
>2.html&data=02%7C01%7C%7C421273163ecb41539c1208d4e962681c%7Cfa7b1b5a7b3443
>8794aed2c178decee1%7C0%7C0%7C636390056254236146&sdata=YnM%2B3O9diZg931PjGm
>%2BO3Dn60xEPPIBEc3mwTZ1RjX8%3D&reserved=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: FlexJS Closure warnings

piotrz
Alex,

What do you mean by rewriting those getter/setters ? Could you point to an some example ?

Thanks,
Piotr
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS Closure warnings

Alex Harui-2
We don't do any rewriting right now, but we might be able to rewrite them
in the future.

One warning I see is from this code:

/**
  * @export
  * @type {org.apache.flex.core.WrappedHTMLElement} */
positioner: {
get: org.apache.flex.core.UIBase.prototype.get__positioner,
set: org.apache.flex.core.UIBase.prototype.set__positioner},

I think this is needed so that


    positioner.flexjs_wrapper

gets properly handled during minification.  However, WrappedHTMLElement
doesn't really get used at runtime.  The positioner is really only going
be an HTMLElement that we add a flexjs_wrapper property to.  We only use
WrappedHTMLElement to satisfy the compilers.  I'd rather not include the
JS for WrappedHTMLElement just to satisfy GCC.  We could scan through the
output JS and find all references to flexjs_wrapper and rewrite them to be
["fw"] or something like that and then replace the @type with HTMLElement.


Or maybe there's a better idea on how to handle this.  I'm leaning towards
just suppressing the warning.

Thoughts?
-Alex


On 8/22/17, 7:43 AM, "piotrz" <[hidden email]> wrote:

>Alex,
>
>What do you mean by rewriting those getter/setters ? Could you point to an
>some example ?
>
>Thanks,
>Piotr
>
>
>
>-----
>Apache Flex PMC
>[hidden email]
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.2333347.n4.nabble.com%2FFlexJS-Closure-warnings-tp63939p6394
>4.html&data=02%7C01%7C%7C64a23899f1a54bb416d708d4e96c95a1%7Cfa7b1b5a7b3443
>8794aed2c178decee1%7C0%7C0%7C636390099994613429&sdata=DcPm4bhO2S%2F9gjFtYW
>6iiOdpOZmu7nmiBrPEaT1nYso%3D&reserved=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.