-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
chore(deps): use cuid2
instead of cuid
#147
chore(deps): use cuid2
instead of cuid
#147
Conversation
Hmm... We have to fix |
I can't reproduce TS2362 & TS2322 errors locally... |
Blocked by: #148 |
e675601
to
d55c08d
Compare
Ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cuid
is indeed deprecated, but I don't see any reason to upgrade to cuid2
. warehouse
doesn't rely on cryptographic safety
Yes. We can suspend migrating from Thanks |
Also ideally, we should consider migrating to a more performant id generation (instead of sticking with the Let's run a benchmark on cuid, cuid2, https://www.npmjs.com/package/uid, and https://www.npmjs.com/package/nanoid, so we can find out the fastest one. |
a simple benchmark with https://github.com/ai/nanoid/blob/main/test/benchmark.js
|
Considering their performance and maintenance (update frequency), I think nanoid is a good alternative option. I will attempt to migrate to it. Superseded by #244 |
Why
https://github.com/paralleldrive/cuid has been deprecated and we have to use https://github.com/paralleldrive/cuid2 instead.
Breaking change?
I assume
warehouse
usescuid
to generate post id. So, all of the post ids indb.json
will be changed if we merge this PR. I think the posts ids are not on the premise that permanently stored (If hexo has to store ids permanently, should use RDB). But this change may be a breaking change for some users if they are using any plugin and it depends on that premise.Closes: #146