Page MenuHomePhabricator

Defer DOM lookups until necessary in IP Info
Closed, ResolvedPublic2 Estimated Story Points

Description

As a performance improvement, make sure more complex actions like initiating OOUI widgets and DOM node lookups are only performed if necessary (i.e. no early returns) - from T260821#6600060.

In this example, complex objects are initialized then thrown away if the method returns early. We should refactor this to ensure these objects are only made when they are needed.

Event Timeline

Change 641583 had a related patch set uploaded (by STran; owner: STran):
[mediawiki/extensions/IPInfo@master] Refactor when DOM-dependent variable values are assigned in IPInfo init

https://gerrit.wikimedia.org/r/641583

Change 641583 merged by jenkins-bot:
[mediawiki/extensions/IPInfo@master] Refactor when DOM-dependent variable values are assigned in IPInfo init

https://gerrit.wikimedia.org/r/641583

Bypassing QA since this was a small refactor and was tested in code review