Skip to content
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

Remove uuid package and replace with crypto.randomUUID() #99

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

sionicion
Copy link
Contributor

In my NextJS projects I get the following warning from npm:

npm WARN deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

I tracked it down to this package, and I found the instances where uuid() was used and replaced it with crypto.randomUUID(), then I removed the package and its types. Crypto's function is actually supposed to be much faster than using the uuid package.

Copy link

@hamirmahal hamirmahal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#102 does this in a slightly different way. I guess the maintainers can go with whichever approach they prefer.

@TooTallNate TooTallNate merged commit 6f59a70 into vercel:main Mar 12, 2024
1 check passed
TooTallNate added a commit that referenced this pull request Mar 12, 2024
@sionicion sionicion deleted the remove-uuid branch March 13, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants