Jump to content

User talk:SoledadKabocha/common-rewrite.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Planned structure

If a comment looks like pseudocode, it probably is.

Do not retry anything on error unless there is an exceptionally good reason.

XXX: Possibly have the AJAX request call mw.loader.using rather than the other way around?

// Initialize constants that do not depend on properties of mw

function realCommonStuff( dblag ) {
  // Import and configure all sub-scripts
  // (For simplicity, importing should be unconditional.
  // Avoid dependence on whether or not we are editing,
  // like I did in my original common.js.)
}

mw.loader.using( [ 'mediawiki.util', 'mediawiki.user' ], function ( ) {
  // Initialize constants that do depend on properties of mw
  // (by "constants" I also mean functions not loaded from external scripts)

  // Make AJAX request to obtain database lag
  // Callbacks should point to realCommonStuff
} )

--SoledadKabocha (talk) 04:15, 5 June 2018 (UTC) + 06:16, 6 July 2018 (UTC) + deprecation of mediawiki.notify: 01:47, 14 May 2020 (UTC)[reply]

Also: importScript has been deprecated for a long, long time—it doesn't even exist in a "plain" non-WMF installation of MediaWiki anymore, at least as of 1.30. This rewrite effort would be a good time to replace it with mw.loader.load like I should have done years ago. --SoledadKabocha (talk) 04:39, 22 August 2018 (UTC)[reply]