-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[pickers] Request to Remove Moment.js Dependency from @mui/x-date-pickers
#16292
Comments
@mui/x-date-pickers
@mui/x-date-pickers
Hey @MattCGao ... the reasoning seems very valid to me. |
Hello @MattCGao, thank you for creating this issue. 🙏 Yes. Usage of Given the above arguments, I don't see a clear reason for removing the suggested library/adapter. |
We don't enforce the usage of I fully agree that I would not recommend anyone to start a new application today using At some point, we could discuss adding a note on the doc reminding that |
That's false.
It's already the case
People don't have to install / bundle
It's subjective but I think we do, and at least Not answering all fo the statements, but unfortunately most of them are incorrect. |
The issue has been inactive for 7 days and has been automatically closed. |
Summary
The
moment
library, which is currently a dependency of@mui/x-date-pickers
, is deprecated and no longer maintained. Moreover,moment
has known drawbacks, including large bundle size and lack of tree-shakability, which can impact application performance and modern development practices. I request the MUI-X team to consider removing themoment
dependency and transitioning to more lightweight and modern alternatives likedate-fns
,dayjs
, or providing hooks for custom date libraries.Examples
dayjs
anddate-fns
provide similar functionality with much smaller bundle sizes and better tree-shaking support.react-datepicker
, have already deprecated or removedmoment
in favor of more modern solutions.moment
, developers can avoid the need to include multiple date libraries in their projects, especially since many projects are already migrating away frommoment
.Motivation
Performance:
moment
significantly increases the bundle size due to its monolithic architecture.date-fns
ordayjs
improve performance and reduce build size.Deprecation:
moment
is officially deprecated, and its use is discouraged in favor of modern alternatives.@mui/x-date-pickers
package.Flexibility:
date-fns
ordayjs
and prefer not to bundle unused dependencies likemoment
.Modern Development:
Search keywords: moment.js, @mui/x-date-pickers, remove moment, date libraries, bundle size, performance
The text was updated successfully, but these errors were encountered: