On Mon, Jan 21, 2013 at 9:06 PM, Michael Schmalle <apa...@teotigraphix.com>wrote:
> Yeah, thanks that makes the build process clear, > > What about the app development, debug from code to browser develop cycle? > > Like how do you envision the code being debugged, like how there is a > Run/Debug and with breakpoints. This happens in the browser separate of the > IDE? I have IntelliJ Ultimate, that is why I am asking about that in > particular. > > Yes, usually we debug directly in the browser. See http://www.jangaroo.net/tutorial/debugging/ Works like this: 1. spot the class and line you want to debug in IDEA, where you can easily naviagte & serach 2. switch to browser, enter JS debug tool 3. most JS debug tools allow typing the script file name to find it (IE only takes the first character :-(). So type the class name (which is exactly the script name). E.g. in Firebug, you click on "Script" tab, then on second combo-box (first combo should be set to "static"), then start typing. 4. Then use the JS debugger's "goto line" command. In Firebug, this is #<line-number> in the script search box, in Chrome, this is Ctrl-G. Enter the source code line, and the code in the generated JS will look strikingly familiar :-) 5. Set breakpoint 6. When breakpoint is hit, the stack trace as well as the local variables show readable names. Only private members have a $n suffix. So this works really well once you got used to it. Of course, what you'd really want would be to set the breakpoint directly in the IDE. IDEA can remote-debug JavaScript in the browser, and you can even easily map URLs to local files. So I tried to map the JavaScript URLs to local *.as files. Didn't work, because you can only change the path, not the file name (extension!), and IDEA's Flex support already "stole" the breakpoints in AS code. So I hacked both IDEA's Flex support and the JavaScript debugger and got it to run! I could set a breakpoint in AS code, connect to the application running in the browser (IDEA supports only Firefox and Chrome), and the breakpoint was hit and I could debug in IDEA! However, I didn't publish the patched plugins, because I found them too hard to maintain (create new patched version for every IDEA version...). It was just a proof of concept that it would be very easy for IDEA to support AS-JS-debugging directly in the IDE. So I guess it will be right there for Apache Flex JS! Have fun -Frank- J8)