informatics-isi-edu / ermrestjs

ERMrest client library in JavaScript
Apache License 2.0
4 stars 3 forks source link

Replace moment.js with alternative library #922

Closed RFSH closed 2 months ago

RFSH commented 2 years ago

Based on the "Project Status" in moment.js repository

Moment.js is a legacy project, now in maintenance mode. In most cases, you should choose a different library.

This is not a high priority since they stated that they will keep addressing critical security concerns as well as updating moment-timezone based on changes in IANA time zone database. But I think at some point after migrating Chaise we should work on this. Apart from making sure we're using an updated library, this should also reduce the size of our dependencies and increase performance.

One of the alternatives that we might want to use is day.js. Its APIs are very similar to moment, so migration shouldn't be difficult. Apart from being lightweight and up to date with current JavaScript standards, the main difference from what I gathered is the timezone support where it's relying on ECMAScript IntlAPI.

P.S. We're using moment.js for test cases in Chaise, so we need to make sure to update moment.js in that repository as well. I also saw traces of moment in lineplot, but I think we should retire lineplot completely and we don't need to worry about moment.js in there)