fix(core): remove crypto randomuuid api (#10268)

This commit is contained in:
EYHN
2025-02-19 07:32:01 +00:00
parent e5315087cb
commit 60a9572c88
5 changed files with 9 additions and 3 deletions
+1
View File
@@ -22,6 +22,7 @@
"lodash-es": "^4.17.21",
"nanoid": "^5.0.9",
"rxjs": "^7.8.1",
"uuid": "^11.0.3",
"y-protocols": "^1.0.6",
"yjs": "^13.6.21"
},
+2 -1
View File
@@ -1,4 +1,5 @@
import { OpClient, transfer } from '@toeverything/infra/op';
import { v4 as uuid } from 'uuid';
import { DummyConnection } from '../connection';
import { AwarenessFrontend, BlobFrontend, DocFrontend } from '../frontend';
@@ -33,7 +34,7 @@ export class StoreManagerClient {
const { port1, port2 } = new MessageChannel();
const client = new OpClient<WorkerOps>(port1);
const closeKey = crypto.randomUUID();
const closeKey = uuid();
this.client
.call(
@@ -22,7 +22,8 @@
"next-themes": "^0.4.4",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router-dom": "^6.28.0"
"react-router-dom": "^6.28.0",
"uuid": "^11.0.3"
},
"devDependencies": {
"@affine-tools/utils": "workspace:*",
@@ -42,6 +42,7 @@ import { Framework, FrameworkRoot, getCurrentStore } from '@toeverything/infra';
import { OpClient } from '@toeverything/infra/op';
import { Suspense } from 'react';
import { RouterProvider } from 'react-router-dom';
import { v4 as uuid } from 'uuid';
import { DesktopThemeSync } from './theme-sync';
@@ -209,7 +210,7 @@ export function App() {
function createStoreManagerClient() {
const { port1: portForOpClient, port2: portForWorker } = new MessageChannel();
let portFromWorker: MessagePort | null = null;
let portId = crypto.randomUUID();
let portId = uuid();
const handleMessage = (ev: MessageEvent) => {
if (
+2
View File
@@ -496,6 +496,7 @@ __metadata:
react-dom: "npm:^19.0.0"
react-router-dom: "npm:^6.28.0"
typescript: "npm:^5.7.2"
uuid: "npm:^11.0.3"
languageName: unknown
linkType: soft
@@ -735,6 +736,7 @@ __metadata:
nanoid: "npm:^5.0.9"
rxjs: "npm:^7.8.1"
socket.io-client: "npm:^4.8.1"
uuid: "npm:^11.0.3"
vitest: "npm:3.0.6"
y-protocols: "npm:^1.0.6"
yjs: "npm:^13.6.21"