Date formatting (e.g.
a day ago) and calculations are common within Backstage.
Date object. The popular Moment.js library has been
commonly used to fill this gap but is affected by large bundle sizes and mutable
state issues. On top of this,
being sunset and the project
recommends using one of the more modern alternative libraries.
We will use Luxon as the standard date library within Backstage.
Luxon provides a similar feature set and API to
Moment.js, but improves on
Intl). This results in smaller bundle sizes while providing a full feature set
and avoids the need for using additional libraries for common date & time tasks.
- All core packages and plugins within Backstage should use
- Using a single date library avoids having to learn multiple library APIs
- Having a single date library will reduce bundle sizes