-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Drop external uuid dependency in favor of native functionality #4929
Comments
What happens when the app is deployed with an adapter to an environment that doesn't have the Node runtime available? |
Also luke's uuid package isn't exactly slow: |
Nanoid is even smaller and faster, if I recall correctly. |
ive been looking at a few issues, and i think this change should definitely be done after #4934 is merged, since it seems to include the web |
Thanks. I tried a Pages build after I saw your comment and your intuition was right. The build fails with a reference error as |
this is an issue i currently face on my own site, but i have this hack in my svelte config import { webcrypto } from 'crypto';
global.crypto = webcrypto; (this works because the config is run only in node environments, and during dev and build its all sharing that global scope) we obviously shouldn't throw this in the demo, but it's fine as a temp fix for other projects. |
Describe the problem
The default demo currently uses a dev dependency for generating random v4 UUIDs inside the hooks file which has been available natively in Node and the Web Crypto API for some time now. In Node
crypto.randomUUID()
it has been available since v14.17.0. The Web Cryptography API, which appears to support web workers as well, uses the same method name.Describe the proposed solution
Dropping this dependency now that support for Node 14 has ended seems like a good time to cut the baggage.
Alternatives considered
Leave the dependency in place. It's slower than native methods but probably not noticeable in the demo.
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: