-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for payment 2023-11-22] [Feature request] Replace the moment library with some lightweight date utility library #19810
Comments
Triggered auto assignment to @anmurali ( |
No need to action here now Anu, Callstack will work on this |
Hey! It's Bartek from Callstack - expert contributor group - I'll be working on this one. |
Thanks, please, first post a plan of how to exectute this migration before you go ahead. |
@burczu would you be bale to share a plan for this project and some ETA, thanks! |
Hey @mountiny! Sorry for being silent in this issue - I'm 100% involved in the Secure Logins issue (migration to use accountID's instead of emails in personal details) right now and had no time for anything else. I'll do my best to share some plan for this issue today or on Monday. |
Ok, @mountiny my plan is simple actually:
In terms of ETA, it depends on how much tests I will need to add as it's the most time consuming task in this plan. I would say more once I check the current coverage. What do you think? |
@burczu thanks for the update, I like including the unit tests, the plan sounds great to me. |
Interested in seeing this one as well, as I am looking at the minute at performance issues with momentjs code (which I'd like to replace by date-fns). |
This will continue after the secure logins bugs are fixed |
I've been working on the first step of my plan today, and identified all the places where we use the Places where
Tomorrow, I think I'll start working on writing unit tests for places I've marked in bold ( |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
Nice, CalendarPicker will be refactored soon not sure if it would be important, but something to keep an eye on |
Not overdue: I made some progress in writing tests I've planned, but I had to switch to another issue for now. I think I'll be able to get back to this one next week. |
@burczu - do you have an update? |
@anmurali I'm sorry, I had no time for this issue last week - hopefully this week will look better |
Update: I've done some progress today, but I'll be OOO starting on Monday till July 25th - once I'll be back, I think I'll have the time to 100% focus on this issue because my other issues will be taken over by other Callstackers. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.95-9 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-11-13. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Almost there! |
Hopefully no regression will appear :) |
Thanks for continued work on this ❤️ |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.99-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-11-22. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@allroundexperts could you please summarize what needs to be paid here to you, it was couple of PRs. No Testrail cases are needed fo this, it was a migration of a package for performance reasons and no new behaviour has been added in this issue |
Hi @mountiny! It's been a long issue but I've tried to summarise the payment below. Please let me know if I missed something.
|
Sounds good to me, Could you please request $1625 on NewDot and note here, then we can close this issue. Thanks! |
All done @mountiny! |
Thanks, we should be all good here and we can close, thanks @waterim and @burczu and @allroundexperts for the effort here |
$1,625 payment approved based on this comment. |
### Problem
Coming from this Slack thread and Callstack proposal.
The
moment
library is a powerful library but has performance disadvantages that comes from its OOP design. This design makes it fail working with tree-shaking, so it’s bundle size it’s huge (especially with internalisation or timezone support enabled) - this impacts mostly the web version of Expensify app.Moreover, the
moment
library is now a “legacy project in maintenance mode” so it is not actively developed anymore.More about above here: https://momentjs.com/docs/#/-project-status/
Solution
There are some other powerful yet lightweight date libraries like
day.js
(the most lightweight) ordate-fns
(supports tree-shaking) that could successfully replace the moment library in our app. My personal preference isdate-fns
because of its support for tree-shaking and wider popularity among community, but usingday.js
may be easier from the Expensify codebase perspective because of its API that is quite similar to the moment one (e.g. parsing date strings using constructor or day/month/year getters etc. - please check the link I’ve posted below for more details).Context/Examples/Screenshots/Notes: More about the subject, containing the comparison of the most popular moment replacements can be found here: https://github.com/you-dont-need/You-Dont-Need-Momentjs/blob/master/README.md
The text was updated successfully, but these errors were encountered: