-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MediaWiki 1.42, online doc. URLs, and fixes #42
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
jquery/confirmable.d.ts
Outdated
*/ | ||
no: string; | ||
|
||
/** | ||
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be noTitle?: string
instead?
noTitle: string | undefined; | |
noTitle?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
jquery/confirmable.d.ts
Outdated
*/ | ||
yes: string; | ||
|
||
/** | ||
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.tempUserCreated
modulemw.user.getFirstRegistration
mw.util.isInfinity
Modified:
new mw.Api().loadMessagesIfMissing
now accepts a singlestring
message key as argumentdefault
argument ofmw.cookie.get/getCrossSite
is now explicitely typed (in JSdoc) withstring|null
, instead ofany
⚠mw.loader.impl
/implement
/register
/state
are now annotated privatemw.Map
is no longer annotated private (and described as internal)body
argument ofnew mw.Rest().post
is now optionalCompatibility with MediaWiki 1.39 (LTS)
@since
annotations for declarations added or modified with 1.40 and 1.41.@deprecate
annotation:isoDate
/url
tablesorter parsers, up to 1.40.mw.language.commafy
, up to 1.40.jquery.tipsy
ResourceLoader module, up to 1.41.Miscellaneous changes
jquery.cookie
module (which contains$.cookie
,$.removeCookie
)mw.loader.addSource
,mw.templates
, andscript
property of a RL module declarationsmw.libs
andmw.widgets
namespaces instead of records ⚠widgets
andlibs
#47pluralRuleParser
librarymw.experiments
andmw.Rest.Options.ajax
mw.errorLogger
to its own filemw.log
mw.notify
taking a JS globalNotificationOptions
as argument (not targetting the MediaWiki implementation) ⚠ColorUtil
/mw.Api
/mw.Rest
interfaces andmw.template
namespaceJSdoc update
@typedef
have been added to the original JSdoc in 1.42, either as file-local declarations or global declarations in themw
namespace, so update some interfaces to share similar names (and declaration location) with online types.ApiOptions
/ForeignApiOptions
/ForeignRestOptions
/RestOptions
tomw.Api.Options
/mw.ForeignApi.Options
/mw.ForeignRest.Options
/mw.Rest.Options
and make all properties optional ⚠ApiOptions
/ForeignApiOptions
/RestOptions
were exported, so to prevent breaking things, exports are just deprecated for nowUserInfo
tomw.Api.UserInfo
⚠user.d.ts
, so to prevent breaking things, the export is just deprecated for nowWatchStatus
tomw.Api.WatchedPage
NotificationOptions
tomw.notification.NotificationOptions
ResultInfo
toResponseMetaData
(insearchSuggest.d.ts
)CompiledTemplate
/Compiler
toTemplateRenderer
/TemplateCompiler
(intemplate.d.ts
)render
method.UriOptions
tomw.Uri.UriOptions
and make all properties optionalImageUrlData
toResizeableThumbnailUrl
(inutil.d.ts
)mw.Api.EditTransform
mw.cookie.CookieOptions
ResponseFunction
(insearchSuggest.d.ts
)TitleExistenceStore
(inTitle.d.ts
)URLs update
doc.wikimedia.org
URLs to new formatdoc.wikimedia.org
URLsmw.hook
events is now generated, so also add URLs to their associated sectionSpecial:MyLanguage
in URLs of wikis that use subpages for translationswww.mediawiki.org
{@link some-url …}
syntax consistently in JSdoc[…](some-url)
,<some-url>
, or plainsome-url