[GitHub] jgranick commented on issue #232: (Feature Request) Support for JS extern output with royale-js
jgranick commented on issue #232: (Feature Request) Support for JS extern output with royale-js URL: https://github.com/apache/royale-asjs/issues/232#issuecomment-389910412 Yeah, I think it makes sense to allow both, for example, allowing "node_modules/openfl/lib" as a source path vs. "node_modules/openfl/dist/openfl.swc" as an external library path, is similar to how we allow ES6/TypeScript developers to either use `require` (which comes from "lib" as separate modules) or to require/import a precompiled "openfl.js" or "openfl.min.js" which comes from "dist". I apologize in advance for fitting a couple new questions within this one issue, but I have a couple questions that are somewhat related that I could not find documentation about. After my SWC created, where do I put my source files? Can I give a compiler argument to specify where external JS files are located? Can I use `require` instead of using `window` references? Can this work with CommonJS-style modules (`var openfl_display_Sprite = require ("../path/openfl/display/Sprite").default`)? Is there a way to avoid using "bin/js-debug" and "bin/js-release" (to customize the output directory)? Warnings about public variables and minification prints as a warning, but seems to emit an error code and stop my compilation. Can I ignore this warning, or do something automatic to "keep" a variable? Thank you 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jgranick commented on issue #232: (Feature Request) Support for JS extern output with royale-js
jgranick commented on issue #232: (Feature Request) Support for JS extern output with royale-js URL: https://github.com/apache/royale-asjs/issues/232#issuecomment-389327824 Great! Thank you, I appreciate the help. Using `royale-js` really is better than `royale-js-swf` for generating a lib extern SWC. Here's the command that's working for me (similar to the one shared): ``` compc -load-config=node_modules/@apache-royale/royale-js/royale-asjs/frameworks/js-config.xml -keep-as3-metadata=JSModule -include-sources=lib -compiler.targets=SWF -output=dist/openfl.swc ``` Regarding the second, I must have misunderstand. Haxe does not generate JavaScript for extern classes, it means "please don't generate this, it exists at runtime." Perhaps I misunderstood what was happening :shipit: 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jgranick commented on issue #232: (Feature Request) Support for JS extern output with royale-js
jgranick commented on issue #232: (Feature Request) Support for JS extern output with royale-js URL: https://github.com/apache/royale-asjs/issues/232#issuecomment-388917652 For the second case, here's a little sample. It's using one class path, but in our case we'd expect instead to add another include path (pointing to `node_modules/openfl/lib` for example) https://github.com/jgranick/MinimalASExternTest Using the real AS externs we're creating, it did compile, but it generated JavaScript files for each of our externs. It worked at runtime because we imported a global "openfl.js" which override the references previously defined in the Royale-generated JavaScript, but in the above test, it does not fully compile. Either way, it would be nice to be able to (have the option to) compile pointing at "@externs" marked AS sources rather than packing in an SWC :smile: 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jgranick commented on issue #232: (Feature Request) Support for JS extern output with royale-js
jgranick commented on issue #232: (Feature Request) Support for JS extern output with royale-js URL: https://github.com/apache/royale-asjs/issues/232#issuecomment-388916990 Sure thing! :smile: Here's a quick sample: https://github.com/jgranick/MinimalSWCTest I tried this before using "js" as the target, but I think letting the target remain the default ("royale") is probably what would (ideally) work. We want to take these source files, and pack them into an SWC for code completion later. Using `royale-js`, this outputs nothing, where it does generate an SWC with `royale-js-swf` 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: us...@infra.apache.org With regards, Apache Git Services