Closed connor-baer closed 5 months ago
Are you planning to keep moment.js in this library ?
No. moment.js
is a sub-dependency of react-dates
on which our date picker components are based. There's an open issue to refresh the date picker components (https://github.com/sumup-oss/circuit-ui/issues/537#issue-557192595) with the following requirement:
- replace
react-dates
with a library that supports TypeScript, tree-shaking, and doesn't depend onmoment.js
moment.js
was made an optional peer dependency in v7 (https://github.com/sumup-oss/circuit-ui/pull/2094).
Describe the bug
When multiple moment.js instances are used in an application, Circuit UI components that rely on moment.js do not respect the current locale.
Steps to reproduce
Steps to reproduce the behavior:
moment.js
in an application that's also using Circuit UImoment.locale
Expected behavior
Circuit UI components should display date information formatted for the current locale set via
moment.locale
.Specifications
Additional context
✅ The issue can be resolved by pinning the moment.js version in the application to
2.29.0
to match the version that's included with Circuit UI.We should move moment.js to peer dependencies or replace it entirely. Both of these changes would be a breaking change.