diff --git a/package-lock.json b/package-lock.json index dd5a9712..231fe2cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11509,7 +11509,6 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -12515,7 +12514,8 @@ "license": "BSD-3-Clause", "dependencies": { "@uwdata/vgplot": "^0.4.0", - "apache-arrow": "^13.0.0" + "apache-arrow": "^13.0.0", + "uuid": "^9.0.1" }, "devDependencies": { "anywidget": "^0.8.0" diff --git a/packages/widget/package.json b/packages/widget/package.json index 37c62cfe..5624dafa 100644 --- a/packages/widget/package.json +++ b/packages/widget/package.json @@ -17,7 +17,8 @@ }, "dependencies": { "@uwdata/vgplot": "^0.4.0", - "apache-arrow": "^13.0.0" + "apache-arrow": "^13.0.0", + "uuid": "^9.0.1" }, "devDependencies": { "anywidget": "^0.8.0" diff --git a/packages/widget/src/index.js b/packages/widget/src/index.js index db4cbd7f..62df1be0 100644 --- a/packages/widget/src/index.js +++ b/packages/widget/src/index.js @@ -3,6 +3,7 @@ import { coordinator, namedPlots, parseSpec } from '@uwdata/vgplot'; import * as arrow from 'apache-arrow'; import './style.css'; +import { v4 as uuidv4 } from 'uuid'; /** * @typedef Model @@ -30,7 +31,7 @@ export async function render(view) { * @param {(reason?: any) => void} reject the promise reject callback */ function send(query, resolve, reject) { - const uuid = globalThis.crypto.randomUUID(); + const uuid = uuidv4(); openQueries.set(uuid, { query, startTime: performance.now(), resolve, reject }); view.model.send({ ...query, uuid });