Moment.js is quite a large library and seems to replicate some of the logic we have in mw.msg. In Popups for example, this library is used to render a message "Edited 33 minutes ago", and this accounts for over 50% of the code. (See T137775)~ [JR: Popups no longer uses]
In MobileFrontend rather than using Moment.js we use a small library to provide information about last modified time with units. We then use this information in getLastModifiedMessage to render one of several messages.
This approach seems cheaper.
My question: should we deprecate use of moment.js in core for a more simplistic library, based on the MobileFrontend library (or some other library), that can be used with messages?
Usages in core:
- mediawiki.Upload.BookletLayout
- mediawiki.ForeignStructuredUpload.BookletLayout
- mediawiki.special.block
- mediawiki.special.editrecovery
- mediawiki.widgets.DateInputWidget
- mediawiki.widgets.expiry