Use the new 'difftotextpst' option of prop=revisions API in live preview script
authorMatt Russell <public@matt-russell.com>
Wed, 21 Oct 2015 15:08:34 +0000 (02:08 +1100)
committerDerk-Jan Hartman <hartman.wiki@gmail.com>
Sun, 25 Oct 2015 11:32:25 +0000 (12:32 +0100)
commit35f76024a124ed1266677ac29e84cedaf30a5143
tree3d40424fc2faa5ed582be42bd527eeae5f2df652
parenta6a6d55c5397153054fda3aedc570b9d3e31110e
Use the new 'difftotextpst' option of prop=revisions API in live preview script

This should improve the diff performance on large pages by a fair amount,
especially on slow connections, as you now just upload the page content once
and then download the diff, rather than having to upload the page content,
download the PST'd page content, re-upload the PST'd page content, and then
finally download the diff.

If there is a summary, the parse request is still performed with just the summary
text, but it is done in parallel to the diff request, and will likely finish
before the diff request anyway, so won't impact the diff performance.
A further improvement could be potentially made, by not sending a summary parse
request when the summary is plain text. This would be fairly easy to detect
(assuming extensions can't modify what is parsed in a summary), just
look for "[[" and "/*".

Also improves the error handling to show errors occurring on the diff request.

Bug: T116178
Change-Id: Ic81bad25ccc8b96c862feb31b7dedd80d1507eeb
resources/src/mediawiki.action/mediawiki.action.edit.preview.js