aharui commented on issue #232: (Feature Request) Support for JS extern output 
with royale-js
URL: https://github.com/apache/royale-asjs/issues/232#issuecomment-390072757
   A SWC is a package of pre-compiled AS.  So once you distribute it, your AS 
source files are no longer needed to compile and run.  Inside the SWC (it is a 
ZIP so just unzip it to see what is in it) is a SWF containing the compiled AS 
as ActionScript Byte Code, and the transpiled JS files.
   You can deliver just JS files and point to them with the -sdk-js-lib=<path 
to root folder of JS files>.
   You can specify more than one -sdk-js-lib option.
   Set -warn-public-vars=false to suppress warnings about public vars.  I'm 
surprised it generates an error code.  There is a way to turn off the warning 
per declaration in the source files.
   There is no current compiler option to change the js-debug/js-release folder 
names.  You should be able to set where those two folders go with the 
-output=<path to output folder> option.
   I'm not familiar enough with CommonJS modules to know how to answer the 
'require' vs 'window' question so I have some questions for you instead.  Do 
you want to have the Google Closure Compiler process your output?  Especially 
to minify/optimize it?  Because that will require being careful about public 
vars.  And as I'm looking into your bug #234 I ran into an issue where our 
compiler currently doesn't handle output where a class extends an @extern 
class.  So far, all of the @externs we've used are just APIs to be called, not 
extended.  Currently, our output is tuned to what Google Closure Compiler 
wants, but the compiler was designed to allow the output to be swapped to 
generate something else.  We/you might want to write what we call an Emitter 
that outputs CommonJS-style JS.

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:

With regards,
Apache Git Services

Reply via email to