-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: remove uuid
dependency in favor of crypto.randomUUID()
#1608
Conversation
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.
It seems crypto.randomUUID()
is only supportable by Node 19.
So if we are going to make this change, we need to require Node >= 19 on the main package.json
.
.changeset/new-rats-return.md
Outdated
--- | ||
--- |
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.
I believe the changeset should not be empty since we are adding a new exportable helper on the crypto
package and made changes on the wallet
package.
Therefore we want to bump versions on these 2 packages.
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.
I put crypto
into the changeset because of the new export, but didn't put wallet
because this is an internal change that doesn't change its functionality at all.
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.
These packages are published independently.
We can't consider things as "internal" in this way.
The usual is to bump everything that will get a new published version.
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.
After I integrated They also mentioned on the MDN:
|
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.
This looks great! Could you please add some tests?
This crypto
package is unique in providing two different builds for node
and browser
, so the tests are a bit different and may be slightly off, potentially depending on things from:
Just want to say that this package caused problems in the past and needs special attention. I know it directly relates to #1431 and indirectly to #1610.
You can reach out to @Torres-ssf and @danielbate if you need insights.
@Torres-ssf @danielbate @nedsalk Guys, the final aim is to have the crypto
package completely unit-tested in the 💯s when testing in both node
and browser
envs.
I had to put every test into a separate file because putting them into one file caused them to share the same environment and stubbing |
Coverage Report:
Changed Files:
|
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.
@nedsalk Having each test on a separate file is a problem. Allowing this to happen in this PR would open the doors for other PRs to do the same. We should invest more time getting to the bottom so this pattern is never introduced in the codebase.
Also, if the gain in terms of bundle size will be marginal, we could drop this PR altogether. |
Pull request was closed
@nedsalk Alright. Please remember to remove this PR's mention from: |
This is a quick win that follows what the
uuid
library suggests: