Given that mobile.init.js seems to be the real entrypoint of MobileFrontend where code is executed including the construction of a Skin instance, and that Skin is a View, which has a lot of baggage in itself, and mobile.init.js has all the dependencies already, moving lazily loaded references initialization to mobile.init.js seems sensible. This will cut out a small chunk from Skin and also allow Skin.page to removed.
if ( mw.config.get( 'wgMFLazyLoadReferences' ) ) { this.eventBus.on( 'section-toggled', function ( data ) { lazyReferencesLoader.loadReferences( self.eventBus, data, self.referencesGateway, self.page ); } ); }
Acceptance criteria
- Skin doesn't know about lazily loaded references.
- Lazily loaded references are configured in mobile.init.js.
- No regressions to tests, production, or production beta code.