diff --git a/apps/web/package.json b/apps/web/package.json index 11b4713d83..e6e2e30891 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -104,7 +104,6 @@ "sanitize-html": "2.17.3", "tar-js": "^0.3.0", "ua-parser-js": "1.0.40", - "uuid": "^13.0.0", "what-input": "^5.2.10" }, "devDependencies": { diff --git a/apps/web/src/components/views/dialogs/devtools/StickyEventState.tsx b/apps/web/src/components/views/dialogs/devtools/StickyEventState.tsx index 159fbc113b..96bebd5953 100644 --- a/apps/web/src/components/views/dialogs/devtools/StickyEventState.tsx +++ b/apps/web/src/components/views/dialogs/devtools/StickyEventState.tsx @@ -9,7 +9,6 @@ import React, { type ChangeEvent, useContext, useEffect, useMemo, useState } fro import { Pill } from "@element-hq/web-shared-components"; import { MatrixEvent, type IContent, RoomStickyEventsEvent } from "matrix-js-sdk/src/matrix"; import { Alert, Form, SettingsToggleInput } from "@vector-im/compound-web"; -import { v4 as uuidv4 } from "uuid"; import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./BaseTool.tsx"; import { _t, _td, UserFriendlyError } from "../../../../languageHandler.tsx"; @@ -330,7 +329,7 @@ export const StickyEventEditor: React.FC = ({ mxEvent, onBack }) = const defaultContent = mxEvent ? stringify(mxEvent.getContent()) : stringify({ - msc4354_sticky_key: uuidv4(), + msc4354_sticky_key: window.crypto.randomUUID(), }); return ; }; diff --git a/apps/web/src/stores/room-list-v3/section.ts b/apps/web/src/stores/room-list-v3/section.ts index f11a028693..45258956fa 100644 --- a/apps/web/src/stores/room-list-v3/section.ts +++ b/apps/web/src/stores/room-list-v3/section.ts @@ -5,8 +5,6 @@ * Please see LICENSE files in the repository root for full details. */ -import { v4 as uuidv4 } from "uuid"; - import { SettingLevel } from "../../settings/SettingLevel"; import SettingsStore from "../../settings/SettingsStore"; import Modal from "../../Modal"; @@ -43,7 +41,7 @@ export async function createSection(): Promise { const [shouldCreateSection, sectionName] = await modal.finished; if (!shouldCreateSection || !sectionName) return false; - const tag = `element.io.section.${uuidv4()}`; + const tag = `element.io.section.${window.crypto.randomUUID()}`; const newSection: CustomSection = { tag, name: sectionName }; // Save the new section data diff --git a/apps/web/src/utils/SessionLock.ts b/apps/web/src/utils/SessionLock.ts index c93097aba1..afa18c2644 100644 --- a/apps/web/src/utils/SessionLock.ts +++ b/apps/web/src/utils/SessionLock.ts @@ -7,7 +7,6 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { v4 as uuidv4 } from "uuid"; /* * Functionality for checking that only one instance is running at once @@ -107,7 +106,7 @@ export function checkSessionLockFree(): boolean { */ export async function getSessionLock(onNewInstance: () => Promise): Promise { /** unique ID for this session */ - const sessionIdentifier = uuidv4(); + const sessionIdentifier = window.crypto.randomUUID(); const prefixedLogger = logger.getChild(`getSessionLock[${sessionIdentifier}]`); diff --git a/apps/web/test/unit-tests/utils/SessionLock-test.ts b/apps/web/test/unit-tests/utils/SessionLock-test.ts index 67202c7193..b0125debc5 100644 --- a/apps/web/test/unit-tests/utils/SessionLock-test.ts +++ b/apps/web/test/unit-tests/utils/SessionLock-test.ts @@ -253,8 +253,6 @@ describe("SessionLock", () => { // import the dependencies of getSessionLock into the new context // eslint-disable-next-line @typescript-eslint/no-require-imports - window2._uuid = require("uuid"); - // eslint-disable-next-line @typescript-eslint/no-require-imports window2._logger = require("matrix-js-sdk/src/logger"); window2.SESSION_LOCK_CONSTANTS = SESSION_LOCK_CONSTANTS; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f7c7cb59b1..87fe5912db 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -509,9 +509,6 @@ importers: ua-parser-js: specifier: 1.0.40 version: 1.0.40 - uuid: - specifier: ^13.0.0 - version: 13.0.0 what-input: specifier: ^5.2.10 version: 5.2.12