-
-
Notifications
You must be signed in to change notification settings - Fork 903
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: v8 support #759
feat: v8 support #759
Conversation
For some reason running npm install in subdirs (e.g. inside `npm run bundlewatch`) is causing `husky install` to run in the subdir, which breaks because it can't find the .git directory. Upgrading to husky@latest fixes the issue, though, so... 🤷
@broofa I was thinking it might be helpful to provide an API for generating a uuid8, such as |
Let's hold off on this until we see demand for it. I suspect v8 UUIDs will generally be a pretty niche use case compared to other versions, and experience has taught me to be cautious about expanding the API surface. It's 10x harder to remove an API than it is to add it. |
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.
Great refactor of the tests, thank you!
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [uuid](https://github.com/uuidjs/uuid) | dependencies | major | [`^9.0.0` -> `^10.0.0`](https://renovatebot.com/diffs/npm/uuid/9.0.1/10.0.0) | --- ### Release Notes <details> <summary>uuidjs/uuid (uuid)</summary> ### [`v10.0.0`](https://github.com/uuidjs/uuid/blob/HEAD/CHANGELOG.md#1000-2024-06-07) [Compare Source](uuidjs/uuid@v9.0.1...v10.0.0) ##### ⚠ BREAKING CHANGES - update node support (drop node@12, node@14, add node@20) ([#​750](uuidjs/uuid#750)) ##### Features - support support rfc9562 MAX uuid (new in RFC9562) ([#​714](uuidjs/uuid#714)) ([0385cd3](uuidjs/uuid@0385cd3)) - support rfc9562 v6 uuids ([#​754](uuidjs/uuid#754)) ([c4ed13e](uuidjs/uuid@c4ed13e)) - support rfc9562 v7 uuids ([#​681](uuidjs/uuid#681)) ([db76a12](uuidjs/uuid@db76a12)) - update node support matrix (only support node 16-20) ([#​750](uuidjs/uuid#750)) ([883b163](uuidjs/uuid@883b163)) - support rfc9562 v8 uuids ([#​759](uuidjs/uuid#759)) ([35a5342](uuidjs/uuid@35a5342)) ##### Bug Fixes - revert "perf: remove superfluous call to toLowerCase ([#​677](uuidjs/uuid#677))" ([#​738](uuidjs/uuid#738)) ([e267b90](uuidjs/uuid@e267b90)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or rename PR to start with "rebase!". 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
[Stacking this on top of #754, which I expect will go in shortly]
We actually snuck in the change to allow version 8 in the validation regex as part of #651, which is really all that's required to support v8 UUIDs. There's no formal algorithm for v8 ("experiment or vendor-specific") ids, so the only impact on this library is that such ids must properly
validate()
andversion()
.This PR adds tests for those cases. I've also taken the opportunity to refactor the
validate
andversion
tests to be "table-driven" from a common set of test cases, which I've fleshed out to include the original cases we had, plus a few additional ones.