Last modified: 2014-06-09 08:10:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68360, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66360 - Mantle compiles all handlebars templates on initial load
Mantle compiles all handlebars templates on initial load
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Mantle (Other open bugs)
master
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-09 05:48 UTC by spage
Modified: 2014-06-09 08:10 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description spage 2014-06-09 05:48:37 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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links