-
-
Notifications
You must be signed in to change notification settings - Fork 896
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
Proposal: Separate submodules for different UUID versions #154
Comments
👍 from me. No maintenance burden on our end to split the code out into the separate files. Eventually this won't even be needed with the various "tree shaking" and optimization features going into rollup and webpack bundlers. They will be able to remove functions from the bundle which are not used. |
I just ran a yarn install with uuid 3.0 and am using the code from the readme:
Seeing this in terminal: Any idea why this would be happening? |
Hmm, looks like yarn is still pulling the version that has uuid.js in the code hence why this isn't working. Any way you can publish a new version to npm to fix this? |
@defunctzombie - based on your comments on #159, I'll let you publish this. |
Released in v3.0.1 |
@defunctzombie Does it mean that the uuid library is tree-shakeable? Do you need to declare anything within the |
I expect it's rare for someone using this library to want both v1() and v4() support. 99% of the time they'll only care about one flavor. Thus, I think it would make sense to separate the code for the different versions into separate submodules. So, for example ...
One immediate benefit is that if you don't use v1(), you don't need to deploy the v1() code, which is ~75% of the code in this module.
Another benefit is that it becomes straight-forward to add support for v3() and v5() UUIDs, which has occasionally been requested, but that I resisted in the original
node-uuid
library because it required shipping JS code to do MD5 / SHA hashes. But now thatuuid
puts the burden for packaging on the user, it'd be straight-forward to implement those versions as well (and provide the requisite md5.js/md5-browser.js or sha.js/sha-browser.js modules as needed for node/browser support).Thoughts? Is this a reasonable direction to take this library?
The text was updated successfully, but these errors were encountered: