https://bugzilla.wikimedia.org/show_bug.cgi?id=66360
Bug ID: 66360 Summary: Mantle compiles all handlebars templates on initial load Product: MediaWiki extensions Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: Unprioritized Component: Mantle Assignee: wikibugs-l@lists.wikimedia.org Reporter: sp...@wikimedia.org CC: jrob...@wikimedia.org, sp...@wikimedia.org Web browser: --- Mobile Platform: --- 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. -- You are receiving this mail because: You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l