Last modified: 2014-04-30 16:24:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T66654, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64654 - ResourceLoader: Use XHR instead of <script> when possible
ResourceLoader: Use XHR instead of <script> when possible
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-30 13:54 UTC by Krinkle
Modified: 2014-04-30 16:24 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2014-04-30 13:54:28 UTC
When a wiki has its load.php endpoint on the same domain, and when the load queue is passed the blocking/synchronous part, there is no reason to use <script> for everything.

While this won't affect Wikimedia production (not unless we start using local /w/load.php or adopt CORS more in a way that still falls back for older browsers), it will increase performance for the majority of normal installs.

In addition, it will allow us to more easily mock the server in our unit tests.
Comment 1 Krinkle 2014-04-30 16:24:12 UTC
Hm.. upon closer inspection, never mind.

We have our own copy of the "script" transport logic of $.ajax, not because jQuery messes up line numbers, but because eval does in general (obviously). If we do our own XHR when possible, we'd have to eval the script since XHR retrieves text only.

And XHR is actually less performant than a script. At least enough concerns about it that there's talk in the jQuery team of dropping the XHR pipeline altogether in the "script" code path of $.ajax.

See also https://gerrit.wikimedia.org/r/#/c/130602/ which adopts $.ajax again in mediawiki.js (though it doesn't change behaviour).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links