Page MenuHomePhabricator

ResourceLoader dependencies are not always reliable in debug mode
Closed, ResolvedPublic

Description

ResourceLoader dependencies are not always reliable in debug mode. This generally pops up when a module from the top queue depends on a module from the bottom queue, or with the custom-hacked private embedded modules. Examples from the past include T36542, T49457, T102718.

I think it all comes down to this bit in mediawiki.js, addScript() function:

document.write( mw.html.element( 'script', { 'src': src }, '' ) );
if ( callback ) {
	// Document.write is synchronous, so this is called when it's done.
	// FIXME: That's a lie. doc.write isn't actually synchronous.
	callback();
}

Like the FIXME says, document.write isn't actually synchronous, and therefore dependent modules sometimes execute before their dependencies are loaded.

Event Timeline

matmarex raised the priority of this task from to Normal.
matmarex updated the task description. (Show Details)
matmarex added a subscriber: matmarex.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 15 2015, 11:28 AM
He7d3r added a subscriber: He7d3r.
Krinkle closed this task as Resolved.Aug 5 2015, 1:46 AM
Krinkle claimed this task.
Krinkle moved this task from Backlog to Assigned on the MediaWiki-ResourceLoader board.

Solved by T107399. Thanks!