types-mediawiki icon indicating copy to clipboard operation
types-mediawiki copied to clipboard

MediaWiki 1.42, online doc. URLs, and fixes

Open Derugon opened this issue 10 months ago • 0 comments

MediaWiki 1.42 is expected to be released in a few weeks, so this PR contains (supposedly) all type and JSdoc changes related to it. This release also comes with a JS documentation overall, with a lot of small description, type, and url changes, which makes this PR way bigger (and harder to review, I'm sorry, I recommend looking at changes commit by commit) than it should be.

This PR also contains some other changes (unrelated to 1.42), from oversights of previous PRs.

MediaWiki 1.42 update

Added:

  • mw.tempUserCreated module
  • mw.user.getFirstRegistration
  • mw.util.isInfinity

Modified:

  • new mw.Api().loadMessagesIfMissing now accepts a single string message key as argument
  • default argument of mw.cookie.get is now explicitely typed (in JSdoc) with string|null, instead of any (breaking change)
  • mw.loader.impl/implement/register/state are now annotated private
  • mw.Map is no longer annotated private (and described as internal)
  • body argument of new mw.Rest().post is now optional

Miscellaneous changes

  • Add jquery.cookie module (which contains $.cookie, $.removeCookie)
    • oversight from #34
  • Add missing mw.loader.addSource and mw.templates declarations
    • oversights from #36
  • Make mw.libs and mw.widgets namespaces instead of records (breaking change)
    • so library and widget types can be specified in this package (or other ones)
  • Add pluralRuleParser library
    • related to the modification above
  • Add missing JSdoc to mw.experiments and mw.Rest.Options.ajax
    • oversight from #34
  • Move namespace mw.errorLogger to its own file
    • was added in #36 and put with mw.log
    • on top of consistency reasons, these are two distinct set of functions with different purpose
  • Fix mw.notify taking a JS global NotificationOptions as argument (not targetting the MediaWiki implementation) (breaking change)
  • Sort members lexicographically
    • where it was not the case, namely in ColorUtil/mw.Api/mw.Rest interfaces and mw.template namespace

JSdoc update

  • Some @typedef have been added to the original JSdoc in 1.42, either as file-local declarations or global declarations in the mw namespace, so update some interfaces to share similar names (and declaration location) with online types.
    • rename ApiOptions/ForeignApiOptions/ForeignRestOptions/RestOptions to mw.Api.Options/mw.ForeignApi.Options/mw.ForeignRest.Options/mw.Rest.Options and make all properties optional (breaking change)
      • ApiOptions/ForeignApiOptions/RestOptions were exported, so to prevent breaking things, exports are just deprecated for now
    • rename UserInfo to mw.Api.UserInfo (breaking change)
      • was exported from user.d.ts, so to prevent breaking things, the export is just deprecated for now
    • rename WatchStatus to mw.Api.WatchedPage
    • rename NotificationOptions to mw.notification.NotificationOptions
    • rename ResultInfo to ResponseMetaData (in searchSuggest.d.ts)
    • rename CompiledTemplate/Compiler to TemplateRenderer/TemplateCompiler (in template.d.ts)
      • also require that any template has a render method.
    • rename UriOptions to mw.Uri.UriOptions and make all properties optional
    • rename ImageUrlData to ResizeableThumbnailUrl (in util.d.ts)
    • add mw.Api.EditTransform
    • add mw.cookie.CookieOptions
    • add ResponseFunction (in searchSuggest.d.ts)
    • add TitleExistenceStore (in Title.d.ts)
  • Fix various small inconsistencies with punctuation, links, indent, and code blocks, either from 1.42 updates to original JSdoc, or oversights from previous PRs.

URLs update

  • Update doc.wikimedia.org URLs to new format
    • most of the URLs used in JSdoc are currently broken
    • URLs to undocumented (usually private) members are removed, since these did not link to anything
  • Add missing doc.wikimedia.org URLs
    • documentation for mw.hook events is now generated, so also add URLs to their associated section
  • Use Special:MyLanguage in URLs of wikis that use subpages for translations
    • mostly URLs to www.mediawiki.org
  • Use {@link some-url …} syntax consistently in JSdoc
    • replace uses of […](some-url), <some-url>, or plain some-url

Derugon avatar Apr 24 '24 08:04 Derugon