> I think I can now pinpoint the difference to RequireJS: It is in the > existence of deps.js. > deps.js says it's generated, and seems to be the extracted dependencies of > all the other JS files, right? Aha, so this is how the necessary scripts > get loaded in advance. And this is where you need the build tool: To > extract the dependencies and generate this additional file deps.js.
No, the deps.js is just a list of ALL the require statements in the entire library + application (indeed generate during the publish process. However, ONLY the files listed that are ACTUALLY USED are loaded dynamically by the code in 'base.js'. If you look in either Chrome or FF you can see which script files are actually loaded and compare that list agains the 'deps.js' list. You'll see that the only file hard-coded into the HTML is 'base.js', which is the equivalent of 'require.js' in your approach. All the other script files are loaded dynamically, in order, based on the dependencies as given in their contents, much like with Require.js. > With the AMD approach, you can re-generate exactly one file and reload in > the browser, and everything will work. Same with the 'goog' way. > One more thing, something I didn't find out is how deps.js gets loaded. It > has to be triggered by base.js somehow. Can you please explain? It's a kind of magic :-) As I explain above, 'base.js' uses it, together with the 'provide' and 'require' statements to figure out which other project files to load. Let me press that point, since it seems to be pivotal to the discussion: ONLY the files that are ACTUALLY needed to run the application are loaded into the browser. NOT all the files in 'deps.js' and certainly not all the files in the Closure Library. > Okay, we can wait for that, but since Michael says what I did with Jangaroo > 3 is easily re-implemented in Falcon, why not compare now? The output > will/should be very very similar to what the Jangaroo 3 output looks like > now, e.g. the one of the Open Flash Chart example. > Another idea would be I take your example code (or any other code you want) > and compile it with Jangaroo 3 and also deploy the output. What do you > think? I enabled "View Source" on the Flash output, so you can grab the AS source and put it through Jangaroo if you please. You can also pick up Alex's FlexJS source and do the same with that.Might be interesting to see what comes out and compare the various approaches when using a different compiler. I think you're not going to convince me to throw away all the work I did so far (and I strongly believe is at least as valid for our purpose as what you are suggesting) and start the whole process again based on your approach, only to do away with one step in the build process of the intermediate output (the 'deps.js' you object to plays no role in generating the 'release' code). I'll continue development of my proof of concept and I hope to find other contributors willing to help out. EdB -- Ix Multimedia Software Jan Luykenstraat 27 3521 VB Utrecht T. 06-51952295 I. www.ixsoftware.nl