-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Replace uuid
package with built-in crypto.randomUUID()
#1140
Conversation
This is not mergable, |
According to https://nodejs.org/api/crypto.html#cryptorandomuuidoptions, it's available since v14.17.0... :-/ |
Please use reviews for comments both ways 🙏 I have 7 notifications already within minutes here. |
CI fails because |
690cf82
to
fd8968f
Compare
I've fixed all the concerns.
|
- Add `node:` prefix to all built-in Node imports (replaces PR #1142). - Replace `uuid` package with built-in `crypto.randomUUID()`(replaces PR #1140). - Cosmetic changes in TS files: - Avoid unnecessary `const { createWorker } = mediasoup` in almost all tests. - Move all FBS related imports to the bottom. - Some formating fixes that bypassed our ESLint rules.
Replacing this PR with #1193 which targets |
- Add `node:` prefix to all built-in Node imports (replaces PR #1142). - Replace `uuid` package with built-in `crypto.randomUUID()`(replaces PR #1140). - Cosmetic changes in TS files: - Avoid unnecessary `const { createWorker } = mediasoup` in almost all tests. - Move all FBS related imports to the bottom. - Some formating fixes that bypassed our ESLint rules.
This PR replace
uuid
package with Node.js built-incrypto.randomUUID()
function. Also, it fixes a couple of typos where the random UUID would be generated if an empty string would be provided asid
, now only it's being generated ifundefined
is provided (note, we should validate the providedid
is an UUID instead of a random string, though).OTOH, I've found that the
id
field ofDataProducerOptions
is not documented. Not fully sure if it makes sense to provide it all, since bandwidth and CPU are low, or it's just there only to mimicProducer
API...