I spent some time today trying to get Tour De Flex to run in production mode with the main app and modules being separately minified.
I've fixed a few things here and there, but an interesting issue I ran into has to do with the plain object we use in ROYALE_CLASS_INFO (and will apply to other objects). The ROYALE_CLASS_INFO is generated on each class and has a "names" property and an optional "interfaces" property. An example is: org.apache.royale.html.beads.models.PanelModel.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'PanelModel', qName: 'org.apache.royale.html.beads.models.PanelModel', kind: 'class' }], interfaces: [org.apache.royale.core.IBead, org.apache.royale.core.IPanelModel] }; Because the field names are not quoted, then in most output, the field name "interfaces" is renamed and all code referencing this field is renamed as well. This is good because it means that you don't have to download the word "interfaces" once per-class. Instead of 10 characters, it is usually one or two. 100 classes saves you about 900 bytes. However, it turns out that in Tour De Flex, the main app uses Reflection and Reflection uses a quoted 'interfaces' string and thus, the field name 'interfaces' in ROYALE_CLASS_INFO isn't renamed, but in most modules "interfaces" is renamed since no other code in the module has a quoted string for 'interfaces'. But that means that when a module loads, the Language.is/as won't work since classes in the main app are using "interfaces" but the classes in the module are using some short name. One solution is to always quote that field in the compiler output and Language is/as so it doesn't get renamed, but that means that field will never get renamed and you lose saving those bytes. Another is let folks figure out their own workarounds, by adding some code that will prevent the renaming in the modules. Other ideas are welcome. I'm done for tonight. Thoughts? -Alex