No ticket: Drop uuid dependency in favor of native parse/stringify#3527
Closed
jimexist wants to merge 2 commits into
Closed
No ticket: Drop uuid dependency in favor of native parse/stringify#3527jimexist wants to merge 2 commits into
jimexist wants to merge 2 commits into
Conversation
Client: nodejs The uuid npm package was used only for parse() and stringify() in the binary and compact protocols. Replaced with a small in-tree helper so the runtime no longer pulls in an external dependency for two trivial hex conversions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Client: js,nodejs,ts,compiler Generated JS/TS code used to import the third-party 'uuid' package for v4() generation. With the runtime no longer depending on 'uuid', emit crypto.randomUUID by default and stop pulling the package into user projects. The new generator option js:native_uuid defaults to true. Pass -gen js:native_uuid=false to restore the legacy import for environments where crypto.randomUUID is unavailable (Node < 14.17, insecure-context browsers). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the
uuidnpm package with a tiny in-tree helper. The runtime was only usingparse()andstringify()from the library in two protocol files — trivial hex/UUID conversions that don't justify an external dependency.Changes
lib/nodejs/lib/thrift/uuid.js— nativeparse(validating UUID string → 16-byteUint8Array) andstringify(16 bytes → canonical lowercase UUID string). Both throwTypeErroron invalid input, matching the library's behavior at the call sites.binary_protocol.jsandcompact_protocol.jstorequire("./uuid").uuidfrompackage.jsondependencies and regeneratepackage-lock.json. (The transitiveuuid@3.4.0pulled in byistanbul-lib-processinforemains — it's a devDep we don't control.)lib/nodejs/test/package-lock.jsonis left untouched; it has been stale across recent uuid bumps and is out of scope here.Why
One fewer supply-chain surface for a built-in capability. Node has no native UUID parse/stringify, but the implementations are short enough to live in-tree.
Checklist
Client:tag included in commit message.Co-Authored-By:.🤖 Generated with Claude Code