mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-14 11:16:16 +00:00
99ce7178c0
This boilerplate at the beginning of most files is an anti-pattern from very early 2011 frontend experiments (I take full blame), where I didn't understand (or had confidence in) the load order of scripts. I won't remove it all at once, as that requires careful review of dependencies. But this one file seemed like low-hanging fruit. The "ext.echo.dm" contained a file that lazy-created `mw.echo` as empty as empty object, and `mw.echo.config` as `{ maxPrioritizedActions: 2 }`. The "ext.echo.init" module loaded on every page already does the same. Remove this file and depend on that module instead. The same modules will be downloaded, in the same way, and in the same order as before. What changes is that the order of execution is now defined instead of implied, thus making the dm-version of it redundant. In practice, while fragile, the load order was already consistently running init before dm. I found this through code coverage analysis in Chrome DevTools, <https://phabricator.wikimedia.org/F28421786>. Change-Id: Iaed7cf0e47479ce8ce76aee1bfe479d82b4f61ed
0 lines
JavaScript
0 lines
JavaScript