royale-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] aharui commented on issue #57: Dependency error when extending class and implementing interface from "external" SWC library
Date Tue, 20 Nov 2018 00:24:22 GMT
aharui commented on issue #57: Dependency error when extending class and implementing interface
from "external" SWC library
URL: https://github.com/apache/royale-compiler/issues/57#issuecomment-440091062
 
 
   Well, after playing with it a bit, my conclusion is that using Royale JS output as externs
"mostly works".  If you change to use ADVANCED_OPTIMIZATIONS, you get warnings.  The Closure
Compiler does appear to do the right thing regarding renaming though.  It is nice to know
that they can handle more complex code like Object.defineProperties in externs.  However,
the warnings make me lean away from just handing over JS files from the SWC to the compiler
as externs.
   
   In your earlier comments, you mentioned having to create the loadable file that contains
the definitions that you are declaring as externs.  I don't know how familiar you are with
Adobe/Apache Flex, but that loadable file is called a Module (in Flex, sometimes it was also
called a runtime-shared-library (RSL)).
   
   SWCs are Libraries, and shouldn't know how they are going to be loaded/linked.  I haven't
used Microsoft Visual C++ in a long time, but similarly, you might link a C/C++ library into
a DLL or the main app to actually load the code.  Flex works similarly.  Royale should too,
IMO.
   
   What I am proposing is to replicate the Flex module workflow in Royale.  Ideally, you should
never have to call the Closure Compiler yourself.  You should be able to use the Royale compiler
to create that loadable file.  It should be as simple as creating a file like our BasicClasses.as
which imports and declares all the files that should go into a loadable file and compiling
that one file.
   
   I propose to add the ability for the compiler to generate a legitimate externs file based
on what actually went into the loadable file, which could then be a subset of a SWC or classes
from multiple SWCs.  And doing do will enable the same sort of optimization that folks are
used to if they are familiar with Flex modules.  In adding this feature we enable the Module
optimization where a module might use some classes from a SWC that the main application doesn't
and we will only use the classes the main application actually used in the externs.
   
   Yes, I am basically suggesting that you change your workflow once I get the externs-report
feature working.  That away I only have to implement one feature that should help both you
and users of Royale Modules.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message