slickgrid-universal
slickgrid-universal copied to clipboard
feat!: migrate from Moment to Tempo
- after more Googling, I found Tempo and I can finally migrate away from MomentJS. Tempo is simple, is ESM, is small and has all necessary functions to replace Moment
- by removing Moment (finally), we also get a much smaller build (not surprisingly since it's ESM)
- Few notes about Tempo
- it uses the exact same format tokens as Moment
- it doesn't support multiple formats like Moment did for parsing with/without zero padding but that doesn't matter since the non-padding token works for both usage (e.g. 'M/D/YY' will work for both '4/7/24' and '04/07/24'). With that in mind, I will use 'M/D/YY' to parse but I will use 'MM/DD/YY' to format date output
TODOs
- [x] investigate why locally
atoken is showing locally asa.m.but in CI it's showing asam(I would prefer same result on both side asam). I might need to open an issue on Tempo. I found out that it's caused byIntl.DateTimeFormatdisplayinga.m.when using "en-CA" butamwhen using "en-US" and so I'll use "en-US" everywhere to avoid such inconsistenticies - [x] all unit tests should pass (except
a.m.format, they all do) - [x] all Cypress E2E tests should pass
- [ ] requires Migration Guide & other docs update
Build Size Comparison
| File | before | after | diff | % diff |
|---|---|---|---|---|
| SF Bundle Zip File | 549Kb (562,835) | 535Kb (548,088) | -14Kb | 2.62% smaller |
| GitHub Vite Demo Website | 5.16Mb (5,412,541) | 5.11Mb (5,364,919) | -0.05Mb | 0.88% smaller |
Run & review this pull request in StackBlitz Codeflow.
cc @zewa666
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.8%. Comparing base (
bf732bc) to head (9249c7b).
Additional details and impacted files
@@ Coverage Diff @@
## next #1507 +/- ##
=======================================
+ Coverage 99.8% 99.8% +0.1%
=======================================
Files 197 198 +1
Lines 21584 21616 +32
Branches 6911 7217 +306
=======================================
+ Hits 21520 21552 +32
+ Misses 64 58 -6
- Partials 0 6 +6
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.