官方不在维护 moment.js 了

2020-09-16 16:38:47 +08:00
 oliver34

今天上 moment 官网,发现官方决定不在维护 moment 了,而且推荐新项目不要选用 moment,改用其他库。 摘自官网:

The Moment team has discussed these issues at length. We recognize that many existing projects may continue to use Moment, but we would like to discourage Moment from being used in new projects going forward. Instead, we would like to recommend alternatives that are excellent choices for use in modern applications today. We would also like to promote the Temporal addition to the JavaScript language, which is looking for feedback and contributors.

链接: https://momentjs.com/docs/#/-project-status/

3321 次点击
所在节点    前端开发
8 条回复
lwq84510
2020-09-16 17:20:47 +08:00
day.js
ianva
2020-09-16 17:27:32 +08:00
https://date-fns.org/ 这个库要好的多
FP, Immutable, TypeScript
sugars
2020-09-16 17:29:34 +08:00
敬礼
iamkun
2020-09-16 17:34:57 +08:00
试试 Day.js 呀 😘
oliver34
2020-09-16 17:58:52 +08:00
@lwq84510 官方也推荐了这个
jorkingwire
2020-09-16 18:18:48 +08:00
敬礼,过去两年日期的好助手
gongpeione
2020-09-16 20:11:06 +08:00
@iamkun 昆哥🐂🍺!
dream4ever
2020-09-28 09:48:07 +08:00
“We now generally consider Moment to be a legacy project in maintenance mode. It is not dead, but it is indeed done.”

看文章要看仔细啊,不是不再维护了,而是进入维护阶段,不再进行大的变更了。

We will not be adding new features or capabilities. → 不增加新功能了。
We will not be changing Moment's API to be immutable. → 不会将 API 改为 immutable 。
We will not be addressing tree shaking or bundle size issues. → 不会再去解决 tree shaking 或者打包文件体积之类的问题。
We will not be making any major changes (no version 3). → 不会再有大的变更。
We may choose to not fix bugs or behavioral quirks, especially if they are long-standing known issues. → 有可能不会修复 bug,尤其是那些长期存在的。

但是考虑到还有数百万的项目还在用这个库,官方团队还是会做下面这两件事:

We will address critical security concerns as they arise. → 会解决关键的安全性问题。
We will release data updates for Moment-Timezone following IANA time zone database releases. → 这条没太看懂。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/707615

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX