-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class paths remain in minified output #202
Comments
I can look into this, but probably not until late December or early January - feel free to assign to me unless others want to take it on first. On a related note, does anyone know why there is a 'names' Array instance in the ROYALE_CLASS_INFO - we only ever have one element in these, and it is always accessed as ROYALE_CLASS_INFO.names[0].qName, for example. I assume it could be changed to be a single Object with name, qName , etc. Also there are a few places where this is used directly I think (outside of the Reflection lib). Slightly OT: I have vague notions of other ways to support reflective functionality that might be more selective (for tuning the amount of reflection data in the final build, for example) so I might give that a shot at some point too. |
Just some random investigation out of curiosity. I couldn't remember if the fully qualified names have always been compiled into release builds like this, or if it was something that was (perhaps unintentionally) introduced at some point more recently. I went as far back as Royale 0.9.0, and that version also included the qnames in release builds. I doubt it was any different in older FlexJS builds. |
Well, it seems like that was only partially the issue. I created a branch ( I confirmed that switching to I'm not sure what the right solution is. Preserving class names for classes which have CSS lookups seems like it might be necessary. I'm not sure how else we can preserve those lookups. Any thoughts on that? But even if yes, not EVERY class needs those lookups. Most classes will never be accessed by the |
One more thing that we probably need to do to prevent rename issues is to make sure the compiler doesn't add quotes to the property names: |
I added exceptions here: 6c1bd52 I'd appreciate if someone who's more familiar with the compiler code looks at what I did. I don't know if there's a better way to do it... |
Using this simple app:
If you compile using this config:
You get this at the top of the minified code:
That's a lot of unnecessary cruft.
My best guess on why that's happening is:
name
andqname
is preserved.Only the interface information is needed by Language. The
name
andqname
are only needed for reflection.The solution is probably to separate the class
name
andqname
from the interface dependencies. It seems like they should be two variables.That should free up
name
andqname
to be removed unless Reflection is used.Names that make sense would be
ROYALE_CLASS_INFO
andROYALE_INTERFACE_INFO
. A question I have would be whether pulling out the interface info might cause problems for existing SWC libraries. Probably yes, but requiring rebuilding SWCs is probably reasonable.The text was updated successfully, but these errors were encountered: