Honestly, I'm not convinced about modules, Tapestry doesn't have so much javascript to benefit from parallel/lazy script loading suggested in the presentation, one minified file should be faster.
I like the idea of separating tapestry.js into more files: ZoneManager, Effects, Validation, Form etc. > Part of the overall goal here is to de-emphasize and eventually > deprecate T5.initializers, and instead, make it easy to include a > per-page or per-component JavaScript. Initializers could be removed and replaced by jquery's "on" event handlers and attaching required parameters to the element using html5 custom data attribute "data-": <a href="#" class="zoneLink" data-zone-update-url="..." data-zone="myZone" data-zone-effect="someeffect">... dom.on 'click', '.zoneLink', -> zoneId = $.data this, 'zone' zone = T.ZoneManager.getOrFindAndCreateZone zoneId url = $.data this, 'zone-update-url' ... > I'd prefer A or C. C is more work, but may be the correct answer; for > example, think what a disaster tapestry-yuicompressor would have been > if it was built right into tapestry-core. Rhino is not so fast right now, with big coffee files it could take minutes to compile. I'm using it in my CoffeeScript plugin for NetBeans https://github.com/dstepanov/coffeescript-netbeans. Why not to have precompiled files and the support to use native less and coffee files? Tapestry will have core coffee and less files precompiled, but there be an option to use live files while developing or testing. Some application servers have crippled Rhino and it is why yuicompressor doesn't work for someone and it could be a problem if there was no precompiled files. > // Dynamic page initialization (refactored): > > T5.onDOMLoaded(function() { > T5.init([ > ["app/inits/serverSideValidate", [...]], > ["app/inits/setupLiveChange", [...]] > }); Why does it need to wait for DOM? The Init function can wait for dom. I don't really understand all that about modules and dynamic initialization, I would write static jquery-plugin-like initilization: T5.init.linkZone = (spec) -> modules("zone").linkZone(spec) Denis
