Skip to content

Commit

Permalink
fix: use uuid package instead of crypto for remote http jupyters (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
frtennis1 authored Jan 21, 2024
1 parent 4114465 commit 12523a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion packages/widget/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 });
Expand Down

0 comments on commit 12523a0

Please sign in to comment.