MediaWiki 1.42, online doc. URLs, and fixes#42
MediaWiki 1.42, online doc. URLs, and fixes#42siddharthvp merged 17 commits intowikimedia-gadgets:mainfrom
Conversation
- add `$.cookie`, `$.removeCookie`, `mw.loader.addSource`, `mw.templates`, `mw.user.getFirstRegistration`, `mw.util.isInfinity` - `new mw.Api().loadMessagesIfMissing` now accepts a single `string` message key as argument - `mw.loader.impl`/`implement`/`register`/`state` are now annotated private - `mw.Map` is no longer annotated private - `body` argument of `new mw.Rest().post` is now optional - various small jsdoc fixes, either from 1.42 updates or oversights from previous PR
- synchronize `mw.cookie.get` TS type with JSdoc: only allow `string|null` as argument - fix `mw.notify` not targetting the mw implementation of `NotificationOptions` - add missing JSdoc to `mw.experiments` and `mw.Rest.Options.ajax` - add missing code block language annotations
so library and widget types can be specified in this package (or other ones)
missed some imports in the previous commits
Update JSdoc of `mw.template` based on MW 1.42. Some interface declarations for `TemplateCompiler` and `TemplateRenderer` were also added in JSdoc, so use these types.
- update types of `mw.template`, based on interfaces in MW 1.42 JSdoc
- update `doc.wikimedia.org` urls to new format (with migration of source code from jsduck to jsdoc), almost all urls are currently broken
- remove `doc.wikimedia.org` urls to private members (that linked to nothing, since jsdoc of private members is not generated)
- add missing `doc.wikimedia.org` urls
- add `doc.wikimedia.org` urls for specific `mw.hook` events, since their jsdoc is now generated
- use `Special:MyLanguage` when possible with wiki urls
- use `{@link some-url …}` consistently, instead of `[…](some-url)`, `<some-url>`, or plain `some-url`
consistency
check other authors/commits at wikimedia-gadgets#42
- fix remaining `NotificationOptions` issues - move remaining Options objects to their own interfaces, so descriptions in some code editors (like VSC) only show relenvant information about the the object itself, not all of its methods and properties. This includes `JQuery.textSelection`, `mw.requestIdleCallback`, and `mw.Title.newFromUserInput` options. - synchronize `TableSorterOptions` with online doc: change its name and make all its properties optional - remove redundant jsdoc in `mw.experiments` and empty `@see` annotation in `mw.hook` - fix some jsdoc link, indent & type inconsistencies
…k other authors/commits at wikimedia-gadgets#42
| * Title text to use for the 'No' button. | ||
| * Optional title text to use for the 'No' button. | ||
| */ | ||
| noTitle: string | undefined; |
There was a problem hiding this comment.
should this be noTitle?: string instead?
| noTitle: string | undefined; | |
| noTitle?: string; |
There was a problem hiding this comment.
Sorry for the late response. Yeah, that's a mistake, thank you very much, this is applied in the latest commit. defaultOptions has all its properties required (and set to undefined if missing), so I suggest either we keep it as a special case, or we use noTitle?: string | undefined; to match both use cases.
| * Title text to use for the 'Yes' button. | ||
| * Optional title text to use for the 'Yes' button. | ||
| */ | ||
| yesTitle: string | undefined; |
There was a problem hiding this comment.
same as above
| yesTitle: string | undefined; | |
| yesTitle?: string; |
…k other authors/commits at wikimedia-gadgets#42
- fix `$().confirmable` not allowing omitting some option properties - update some jQuery plugin URLs, changed since 1.42 release
The `resizeUrl` method may be missing, in which case the method is specified and `null`
for consistency, missed small interfaces from previous commits wikimedia-gadgets@0680f01 Also simplify `RequiredOrUndefined` type
- add various `@since`/`@deprecated` annotations for declarations added/modified/deprecated/removed with 1.40/1.41/1.42 - add `isoDate`/`url` tablesorter parsers, removed since 1.40 - add `jquery.tipsy` RL module, removed since 1.41 - add `mw.language.commafy`, removed since 1.40 - add missing `script` property of a RL module (not added recently, just an oversight)
|
Can you also update the package version to 1.8.0? |
|
Thanks. This looks thorough as usual! I sent you an invite for commit access to this repo a month ago, but it expired. I am sending it again. Also, you may want to link your git email with GitHub to get credited in the contributors page |
check other authors/commits at wikimedia-gadgets#42
|
Btw I submitted a patch to doc.wikimedia.org that fixes most redirects from old docs, it's merged but not online yet. |
MediaWiki 1.42 is expected to be released in may or june, 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 from oversights of previous PRs (unrelated to 1.42) and addition of deprecated/removed declarations since 1.39 (current LTS release).
All changes are liste below, breaking changes are annotated with ⚠.
MediaWiki 1.42 update
Added:
mw.tempUserCreatedmodulemw.user.getFirstRegistrationmw.util.isInfinityModified:
new mw.Api().loadMessagesIfMissingnow accepts a singlestringmessage key as argumentdefaultargument ofmw.cookie.get/getCrossSiteis now explicitely typed (in JSdoc) withstring|null, instead ofany⚠mw.loader.impl/implement/register/stateare now annotated privatemw.Mapis no longer annotated private (and described as internal)bodyargument ofnew mw.Rest().postis now optionalCompatibility with MediaWiki 1.39 (LTS)
@sinceannotations for declarations added or modified with 1.40 and 1.41.@deprecateannotation:isoDate/urltablesorter parsers, up to 1.40.mw.language.commafy, up to 1.40.jquery.tipsyResourceLoader module, up to 1.41.Miscellaneous changes
jquery.cookiemodule (which contains$.cookie,$.removeCookie)mw.loader.addSource,mw.templates, andscriptproperty of a RL module declarationsmw.libsandmw.widgetsnamespaces instead of records ⚠widgetsandlibs#47pluralRuleParserlibrarymw.experimentsandmw.Rest.Options.ajaxmw.errorLoggerto its own filemw.logmw.notifytaking a JS globalNotificationOptionsas argument (not targetting the MediaWiki implementation) ⚠ColorUtil/mw.Api/mw.Restinterfaces andmw.templatenamespaceJSdoc update
@typedefhave been added to the original JSdoc in 1.42, either as file-local declarations or global declarations in themwnamespace, so update some interfaces to share similar names (and declaration location) with online types.ApiOptions/ForeignApiOptions/ForeignRestOptions/RestOptionstomw.Api.Options/mw.ForeignApi.Options/mw.ForeignRest.Options/mw.Rest.Optionsand make all properties optional ⚠ApiOptions/ForeignApiOptions/RestOptionswere exported, so to prevent breaking things, exports are just deprecated for nowUserInfotomw.Api.UserInfo⚠user.d.ts, so to prevent breaking things, the export is just deprecated for nowWatchStatustomw.Api.WatchedPageNotificationOptionstomw.notification.NotificationOptionsResultInfotoResponseMetaData(insearchSuggest.d.ts)CompiledTemplate/CompilertoTemplateRenderer/TemplateCompiler(intemplate.d.ts)rendermethod.UriOptionstomw.Uri.UriOptionsand make all properties optionalImageUrlDatatoResizeableThumbnailUrl(inutil.d.ts)mw.Api.EditTransformmw.cookie.CookieOptionsResponseFunction(insearchSuggest.d.ts)TitleExistenceStore(inTitle.d.ts)URLs update
doc.wikimedia.orgURLs to new formatdoc.wikimedia.orgURLsmw.hookevents is now generated, so also add URLs to their associated sectionSpecial:MyLanguagein URLs of wikis that use subpages for translationswww.mediawiki.org{@link some-url …}syntax consistently in JSdoc[…](some-url),<some-url>, or plainsome-url