"Krinkle" changed the status of MediaWiki.r108184 to "fixme" and commented it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/108184#c29865

Old Status: resolved
> New Status: fixme

Commit summary for MediaWiki.r108184:

ResourceLoader: Add an experimental option to move the main module loading 
queue (the bottom queue) from the bottom of the <body> up into the <head> , 
while still being loaded asynchronously. This makes them load earlier, which 
should make the page load faster. This is the product of a long discussion on 
bug 27488

* Added a "blocking" state to mw.loader . When loading scripts while the 
document is not ready, the loader will use document.write() if blocking is 
true, and append to the <body> or the <head> if blocking is false. If the 
document is ready, the loader will always append to the <body>
* Enable blocking mode while loading the top queue, and disable it after. This 
ensures that modules in the top queue are still loaded in a blocking way as 
they were before
* If $wgResourceLoaderExperimentalAsyncLoading is true, the bottom queue is 
also loaded in the head, but with blocking mode disabled. Otherwise, it's 
loaded at the bottom of the <body> as before
* scripts-only and messages-only requests need special treatment:
** in the top queue, they can continue to use <script src="..."> tags because 
they are blocking
** if the bottom queue is at the bottom of the <body> (experimental async 
loading disabled), they can continue to use <script src="..."> tags as before
** if the bottom queue is in the <head> (experimental async loading enabled), 
they cannot use <script src="..."> tags, because those would block. Instead, 
call mw.loader.load() on the load.php URL

Krinkle's comment:

Re-opening. Top queue looks like this:
<pre>
mw.loader.setBlocking( true );
mw.loader.load( .. );
mw.loader.setBlocking( false );
</pre>

The requests made to <tt>load.php</tt> by <code>mw.loader.load()</code> are 
added synchronously, these are all correctly made blocking. However, as soon as 
<code>mw.loader.load()</code> returns, blocking is set to false. This works 
well for production mode, but fails in debug mode.

In debug mode the <tt>load.php</tt> calls contain 
<code>mw.loader.implement()</code>, which contain file paths. Which 
<code>implement()</code> will addScript, but at that point blocking is 
apparently false. I haven't quite figured out what the exact cause is).

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to