Firstly, I got distracted to my require-tiny “code sketch” (as coined by micmath). After my initial (non-functional – not as in requirements) brain-to-code dump, I’d joined the new amd-implement group (initially as a lurker). I’d also got AMD compliance tests that James Burke has written (this guy is serious ) running against the code. So far only basic functionality is implemented and not all the tests pass (see below), but I’m confident that a fairly decent AMD loader can be delivered in 2-3k minified and gzipped (think mobile).
The failing test seems to be a problem satisfying circular dependencies. If you have a pair of modules that depend on one another, then I think the correct behaviour is that when the second
define call is encountered, the implementation callback should be invoked without waiting for the first (as it will never be ready). The value that is passed in for the first module (and that available from the synchronous require that can be passed in) is the same object that will be available to the first module as its
exports. Something like that anyway – I haven’t quite got to the bottom of it. Credit to James though for making tests available that exercise this behaviour (I think it’s made the difference between a throwaway prototype and something I could continue to work on). Anyway, that soaked up quite a bit of time (via bugfixes in Micro and Spectrum, to get the server I created to run the tests working).
Other than that, I made a couple of tweaks to this blog in order to get nicer URLs working (note to self: remember that you put rewrite directives in a directory block, not a virtual host – bloody Apache) and to make image uploads work (for the above).
Right, back to Yokel…