Hi Piotr,



These are good questions. I think they are more suited for the dev mailing list 
because it involves discussion of the internals. If you want to learn more 
about the compiler this [1] could be a good start.



[1] https://github.com/apache/royale-compiler/wiki/developer-guide



Thanks,

Yishay



From: Piotr Grudzinski<mailto:[email protected]>
Sent: Friday, October 23, 2020 9:39 PM
To: [email protected]<mailto:[email protected]>
Subject: Re: How to minify mxroyale\HelloWorld .js file

Looking at the index.html in the bin/js-debug folder, it contains 250 
goog.goog.addDependency() lines.
Hope someone can help me to understand:
1. How does the index.html relate to HelloWorld.js in the js-release folder? Is 
the stuff in js-release generated based on the js-debug?
2. Are all the 250 goog.goog.addDependency() lines really needed?
3. In the first line:
goog.addDependency('../../../HelloWorld_mx_managers_SystemManager.js', ...
I have removed many item(?) in the 'requires' argument, e.g. 
'org.apache.royale.utils.Timer', and the webpage is not visibly affected.
How/where is it decided what does into this argument?

Any help will be appreciated,
Piotr


On Tue, Oct 20, 2020 at 2:42 PM Greg Dove 
<[email protected]<mailto:[email protected]>> wrote:
Hi Piotr,

Emulation will always have more weight because, in addition to a reasonably 
'heavy' (but very capable) framework, in js there is also emulation of certain 
flash player features that were not part of the flex framework itself but are 
not present in the browser. (such as emulation of flash.utils.Timer, for 
example).
There are undoubtedly improvements that we can make over time to reduce size. 
But emulation's main priority is to 'get things working' first, so I do expect 
that will come later.

But also it is not simply correct to compare
HelloWorld.swf with HelloWorld.js

The HelloWorld.swf is internally compressed with lzma compression after it has 
been built.

HelloWorld.js would typically be deployed on a server that uses gzip 
compression when sending content. The 'minified' js output is optimized for 
this expectation, so it is better to gzip that javascript file and compare that 
to the swf size.
So to compare/test, in the past on windows I have used the 7zip application (I 
use 'normal' compression level, I don't know what is used on web servers).

Hope that helps...

Greg


On Wed, Oct 21, 2020 at 6:10 AM Carlos Rovira 
<[email protected]<mailto:[email protected]>> wrote:
Hi Piotr,

I think it is the same issue that happened with Flex. And the reason why PAYG 
was adopted
If you don't want that overweight you must leave emulation and go with pure 
Royale, is a bit more work in the layout, but I think it's worth it.

El mar., 20 oct. 2020 a las 19:06, Piotr Grudzinski 
(<[email protected]<mailto:[email protected]>>) escribió:
The HelloWorld.swf file is only 79KB in size.
Looking at the initial part of the HelloWorld.js with a text editor gives me an 
impression that most of the stuff in this file is never used.
Examples:
Bl='org.apache.royale.utils.Timer'
vf='org.apache.royale.graphics.GradientEntry'


On Tue, Oct 20, 2020 at 12:08 PM Yishay Weiss 
<[email protected]<mailto:[email protected]>> wrote:
Sorry, missed that.

So to expand a bit on Carlos’s answer, using emulation will probably cut down 
dev time but will certainly increase app size. If you are looking for the 
leanest solution that’s what Basic is for. Jewel is less focused on app size 
but will probably still be somewhat smaller than emulation. I don’t think we 
ever made precise measurements, but that’s the general idea.

Hope this helps.

From: Carlos Rovira<mailto:[email protected]>
Sent: Tuesday, October 20, 2020 6:13 PM
To: [email protected]<mailto:[email protected]>
Subject: Re: How to minify mxroyale\HelloWorld .js file

Hi Yishay,

he's talking about reducing size of the js-release version

El mar., 20 oct. 2020 a las 17:07, Yishay Weiss 
(<[email protected]<mailto:[email protected]>>) escribió:
There should be [1] a minified version under js-release

[1] https://apache.github.io/royale-docs/get-started/hello-world


From: Carlos Rovira<mailto:[email protected]>
Sent: Monday, October 19, 2020 11:06 PM
To: [email protected]<mailto:[email protected]>
Subject: Re: How to minify mxroyale\HelloWorld .js file

Hi,

Don't think so. I'm not an expert on Flex emulation in Royale but it's trying 
to work as Flex did, so I think if original flex hello world was around 500kb 
is normal that emulation is around that size.

Although Royale has a better architecture based on PAYG and strand/beads, only 
using UI Sets like Basic or Jewel will make you get better and lower sizes in 
your app.

That's one of the tradebacks in using emulation vs a newer ui set you get it 
working with less changes in your code, but the size will be pretty similar I 
think.



El lun., 19 oct. 2020 a las 16:41, Piotr Grudzinski 
(<[email protected]<mailto:[email protected]>>) escribió:
Hi all,

I have built the the mxroyale\HelloWorld example using a command line with the 
following options:
-debug=false -targets=JSRoyale +configname=flex
The HelloWorld.js file in the js-release folder is 504KB in size which feels 
quite big for such a simple application.
Are there any compiler options available to minify the generated .js file?
Any other ideas to minify it?

Regards,
Piotr



--
Carlos Rovira
Apache Member & Apache Royale PMC
Apache Software Foundation
http://about.me/carlosrovira




--
Carlos Rovira
Apache Member & Apache Royale PMC
Apache Software Foundation
http://about.me/carlosrovira




--
Carlos Rovira
Apache Member & Apache Royale PMC
Apache Software Foundation
http://about.me/carlosrovira


Reply via email to