Skip to content

Commit 247201c

Browse files
committed
Clean up and upgrade gremlin-js dependencies CTR
- Replace uuid with globalThis.crypto.randomUUID() (Node 22+/browsers); remove uuid and @types/uuid from package.json - Upgrade chai ~4.5.0 → ^6.2.2 and chai-string ~1.5.0 → ^2.0.0; add deep-eql as explicit devDependency; fix default import in element-comparison-test.js to use named exports - Upgrade globals 15 → 17, prettier 3.8.1 → 3.8.3, typedoc 0.28.18 → 0.28.19 - Upgrade @smithy/hash-node 4.2.12 → 4.2.14, @smithy/signature-v4 5.3.12 → 5.3.14 - Remove unused js-yaml devDependency - Resolve brace-expansion CVE-2024-4068 via lockfile refresh - Switch gremlin-mcp moduleResolution from "node" to "bundler" to fix type-check failure with @modelcontextprotocol/sdk 1.23+ zod/v3 subpath exports
1 parent 485f3a6 commit 247201c

9 files changed

Lines changed: 1628 additions & 1836 deletions

File tree

CHANGELOG.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
2626
=== TinkerPop 4.0.0 (Release Date: NOT OFFICIALLY RELEASED YET)
2727
2828
* Added Gremlator, a single page web application, that translates Gremlin into various programming languages like Javascript and Python.
29+
* Removed `uuid` dependency from `gremlin-javascript` in favor of the built-in `globalThis.crypto.randomUUID()`.
2930
3031
[[release-4-0-0-beta-2]]
3132
=== TinkerPop 4.0.0-beta.2 (April 1, 2026)

docs/src/upgrade/release-4.x.x.asciidoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ anonymized form. The original gremlator.com was a prototype built by TinkerPop c
4141
previous implementation required Java and a running Gremlin Server, whereas the new version runs entirely in the
4242
browser with no server infrastructure needed.
4343
44+
==== Removed `uuid` Dependency in gremlin-javascript
45+
46+
The `uuid` npm package has been removed from `gremlin-javascript`. UUID generation now uses the built-in
47+
`globalThis.crypto.randomUUID()` API, which is available in Node.js 19+ and all modern browsers.
48+
49+
This change has no impact on how UUID values are sent to or received from the server — UUID serialization and
50+
deserialization in GraphBinary is unchanged. Applications that depend on the `uuid` package solely because
51+
`gremlin-javascript` brought it in as a transitive dependency should add it directly to their own `package.json`
52+
if they still need it.
53+
4454
== TinkerPop 4.0.0-beta.2
4555
4656
*Release Date: April 1, 2026*

gremlin-js/gremlin-javascript/lib/utils.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
* @author Jorge Bay Gondra
2323
*/
2424

25-
import * as uuid from 'uuid';
26-
2725
const gremlinVersion = '4.0.0-SNAPSHOT'; // DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
2826

2927
export function toLong(value: number | string) {
@@ -39,8 +37,7 @@ export class Long {
3937
}
4038

4139
export function getUuid() {
42-
// TODO: replace with `globalThis.crypto.randomUUID` once supported Node version is bump to >=19
43-
return uuid.v4();
40+
return globalThis.crypto.randomUUID();
4441
}
4542

4643
export const emptyArray = Object.freeze([]) as any as any[];

gremlin-js/gremlin-javascript/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
},
3434
"typesVersions": {
3535
"*": {
36-
"language": ["./build/esm/language/index.d.ts"]
36+
"language": [
37+
"./build/esm/language/index.d.ts"
38+
]
3739
}
3840
},
3941
"files": [
@@ -43,8 +45,7 @@
4345
"antlr4ng": "3.0.16",
4446
"buffer": "^6.0.3",
4547
"eventemitter3": "^5.0.1",
46-
"readable-stream": "^4.5.2",
47-
"uuid": "^9.0.1"
48+
"readable-stream": "^4.5.2"
4849
},
4950
"optionalDependencies": {
5051
"@aws-sdk/credential-providers": "^3.967.0",
@@ -57,17 +58,16 @@
5758
"@knighted/duel": "^4.0.2",
5859
"@tsconfig/node18": "^18.2.2",
5960
"@types/readable-stream": "^4.0.10",
60-
"@types/uuid": "^9.0.8",
6161
"antlr-ng": "^1.0.10",
62-
"chai": "~4.5.0",
63-
"chai-string": "~1.5.0",
62+
"chai": "^6.2.2",
63+
"chai-string": "^2.0.0",
6464
"colors": "1.4.0",
6565
"cross-env": "^10.1.0",
66+
"deep-eql": "^5.0.2",
6667
"eslint": "^9.36.0",
6768
"eslint-config-prettier": "^10.0.1",
6869
"eslint-plugin-prettier": "^5.0.0",
69-
"globals": "^15.14.0",
70-
"js-yaml": "^3.14.2",
70+
"globals": "^17.5.0",
7171
"mocha": "^11.7.5",
7272
"prettier": "^3.0.0",
7373
"ts-node": "^10.9.2",

gremlin-js/gremlin-javascript/scripts/groovy/generate.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ radishGremlinFile.withWriter('UTF-8') { Writer writer ->
5656
writer.writeLine(
5757
'import * as graphTraversalModule from \'../../lib/process/graph-traversal.js\';\n' +
5858
'import * as traversalModule from \'../../lib/process/traversal.js\';\n' +
59-
'import * as uuid from \'uuid\';\n' +
6059
'import { TraversalStrategies, VertexProgramStrategy, OptionsStrategy, PartitionStrategy, \n' +
6160
' ReadOnlyStrategy, GraphFilterStrategy, SeedStrategy, SubgraphStrategy, ProductiveByStrategy, \n' +
6261
' LambdaRestrictionStrategy, StandardVerificationStrategy, VertexProgramRestrictionStrategy, \n' +

gremlin-js/gremlin-javascript/test/cucumber/gremlin.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gremlin-js/gremlin-javascript/test/unit/element-comparison-test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
* under the License.
1818
*/
1919

20-
import chai from 'chai';
21-
import { expect } from 'chai';
20+
import { expect, use, Assertion } from 'chai';
2221
import { VertexProperty, Property, Vertex, Edge, Path } from '../../lib/structure/graph.js';
2322
import { deepMembersById, opt } from '../cucumber/element-comparison.js';
2423
import deepEqual from 'deep-eql';
2524

26-
chai.use(function (chai, chaiUtils) {
27-
chai.Assertion.overwriteMethod('members', function (_super) {
25+
use(function (_chai, chaiUtils) {
26+
Assertion.overwriteMethod('members', function (_super) {
2827
return deepMembersById;
2928
});
3029
});

gremlin-js/gremlin-mcp/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"target": "ES2022",
44
"module": "ESNext",
5-
"moduleResolution": "node",
5+
"moduleResolution": "bundler",
66
"baseUrl": ".",
77
"paths": {
88
"gremlin": [

0 commit comments

Comments
 (0)