Last modified: 2014-10-28 15:47:06 UTC
In order to load widgets on demand rather than on page load, a new lightweight toolbar needs to be introduced which then loads the full toolbar and the related widgets when needed.
I would propose closing the ticket after https://gerrit.wikimedia.org/r/#/c/161959/ has been merged. Major toolbar refactorings have been done with that change being the last one in the chain. With all the refactorings applied, the toolbars have become as lightweight as can be. The DOM structure rendered by the back-end is reused completely and no DOM structure unused before triggering any action is generated anymore. The final enhancement in terms of performance would be to just assign an event to the static buttons rendered by the back-end. However, that would cause major logical implications requiring to considerably restructure the overall toolbar logic.
Just one note: As of https://gerrit.wikimedia.org/r/#/c/167177/, some toolbars (e.g. the statement "edit" toolbars) are not rendered in the static output since they cannot be provided a useful link target. Consequently, the JS toolbar widgets need to render the DOM structure in JavaScript. In terms of performance, it would be better to always have the back-end render the toolbars--apart from that, there should be sensible link targets for the static toolbars anyhow...