Last modified: 2014-06-09 08:10:21 UTC
AIUI, all templates in a RL module turn into mw.mantle.template.add("name.handlebars", "...the template's handlebars 'HTML-like' source"); add() immediately compiles the template into an object with a JavaScript render() function to output the HTML. It works, but it means that using a module with lots of templates results in the browser compiling every single template, even if some are rarely invoked. We should measure the overhead; if it's significant, maybe there's a way to defer the compilation. It could be an explicit step (template.use()?) or defer it until the first time render() is called. The design should also account for pre-compilation (bug 64735), wherein RL would optionally load handlebars templates pre-compiled to JavaScript. The JS in code invoking mantle template functions should not have to change.