Yes, I meant to tell the list sooner, but right after I fixed the Jenkins build, I got pulled into something urgent. Apologies!
- Josh On Fri, Apr 22, 2016 at 1:10 AM, Christofer Dutz <christofer.d...@c-ware.de> wrote: > Hi Josh, > > Well how about anyone making changes to the dependencies drop a note here > in the list? > But I migrated your changes to the maven branch and it's building nicely > :-) > > Chris > > ________________________________________ > Von: Josh Tynjala <joshtynj...@gmail.com> > Gesendet: Donnerstag, 21. April 2016 23:01 > An: dev@flex.apache.org > Betreff: [FalconJX] More Node.js stuff > > Hey folks, > > I've been working on improving Node.js support for the next release of > FlexJS. Sorry for forcing you to wipe your builds of flex-falcon after I > added new externs downloads! > > In FlexJS 0.6, you could use require() to load Node modules, but you'd have > untyped objects: > > var http:Object = require("http"); > > It's just enough to make things work, but you probably wouldn't want to do > a whole project that way. > > Starting today, if a class in an externs SWC has [JSModule] metadata, the > compiler will automatically require the module in the generated JS. > > package { > [JSModule] > public class http {} > } > > package http > { > [JSModule(name="http")] > public class Server {} > } > > If you use http or http.Server in your ActionScript code, the compiler will > know to require it in the generated JavaScript. > > In the process, I fixed several issues in externc. I also added a new > named-module command line argument to externc that lets you specify exactly > which packages should include [JSModule] metadata. I updated the Node.js > externs, and it works great! > > Here's a little example: > > package > { > public class HelloNode > { > public function HelloNode() > { > var newPath:String = > path.normalize("./sub/../test/./whatever.txt"); > console.log(newPath); > } > } > } > > The path class is required automatically by the compiler. It's in the > top-level package, so it doesn't need to be imported. Classes in > sub-packages are imported normally in ActionScript. The console class is > used in this example too, but because it considered a global, it doesn't > have [JSModule] metadata, so it gets treated normally. > > - Josh >