react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

Make moment an optional dependency

Open frw opened this issue 3 years ago • 1 comments

Description

This PR makes the moment package an optional dependency so as to decrease bundle size for those that do not use moment to format date/time.

Potentially breaking change: Projects that do not have moment as a direct dependency will find when upgrading that the supplied dateFormat/timeFormat would no longer have any effect on the displayed date/time, although there will be an error message logged to console to indicate that this is happening.

Tested by running the example app and ensured the dates/times are still rendered properly Screenshot_20220827-171143_R N U I L I B

Changelog

Make moment an optional dependency

frw avatar Aug 27 '22 10:08 frw

Internal note: look at unifying with #1805

M-i-k-e-l avatar Sep 05 '22 07:09 M-i-k-e-l

Why not replace with a better option like https://day.js.org/ or even https://date-fns.org/ if dayjs are no longer enough.

dougg0k avatar Jan 30 '23 21:01 dougg0k

@frw Thanks a lot for your contribution; apologies, but we will be merging this as part of our v7 (link), so unfortunately you'll not get the due credit, hope it's ok.

@dougg0k, I think this component will be replaced so I am not sure we want to invest in this further.

M-i-k-e-l avatar Feb 15 '23 14:02 M-i-k-e-l