From 929e8f4037acf4dccddcd9d7cc0d5cdf193cda0a Mon Sep 17 00:00:00 2001 From: Jannik Streek Date: Tue, 2 Jan 2024 14:31:21 +0100 Subject: [PATCH] deactivate typescript strict mode as socketio-client has problems building on github --- excalidraw-app/collab/Portal.tsx | 5 ++--- excalidraw-app/data/firebase.ts | 9 ++++----- excalidraw-app/data/httpStorage.ts | 5 ++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/excalidraw-app/collab/Portal.tsx b/excalidraw-app/collab/Portal.tsx index 65b856783cd0..82ccc8ff1b52 100644 --- a/excalidraw-app/collab/Portal.tsx +++ b/excalidraw-app/collab/Portal.tsx @@ -19,11 +19,10 @@ import { newElementWith } from "../../packages/excalidraw/element/mutateElement" import { BroadcastedExcalidrawElement } from "./reconciliation"; import { encryptData } from "../../packages/excalidraw/data/encryption"; import { PRECEDING_ELEMENT_KEY } from "../../packages/excalidraw/constants"; -import { Socket } from "socket.io-client"; class Portal { collab: TCollabClass; - socket: typeof Socket | null = null; + socket: any | null = null; socketInitialized: boolean = false; // we don't want the socket to emit any updates until it is fully initialized roomId: string | null = null; roomKey: string | null = null; @@ -33,7 +32,7 @@ class Portal { this.collab = collab; } - open(socket: typeof Socket, id: string, key: string) { + open(socket: any, id: string, key: string) { this.socket = socket; this.roomId = id; this.roomKey = key; diff --git a/excalidraw-app/data/firebase.ts b/excalidraw-app/data/firebase.ts index ab13c2674c9f..4187a92e6474 100644 --- a/excalidraw-app/data/firebase.ts +++ b/excalidraw-app/data/firebase.ts @@ -21,7 +21,6 @@ import { MIME_TYPES } from "../../packages/excalidraw/constants"; import { reconcileElements } from "../collab/reconciliation"; import { getSyncableElements, SyncableExcalidrawElement } from "."; import { ResolutionType } from "../../packages/excalidraw/utility-types"; -import { Socket } from "socket.io-client"; // private // ----------------------------------------------------------------------------- @@ -141,12 +140,12 @@ const decryptElements = async ( }; class FirebaseSceneVersionCache { - private static cache = new WeakMap(); - static get = (socket: typeof Socket) => { + private static cache = new WeakMap(); + static get = (socket: any) => { return FirebaseSceneVersionCache.cache.get(socket); }; static set = ( - socket: typeof Socket, + socket: any, elements: readonly SyncableExcalidrawElement[], ) => { FirebaseSceneVersionCache.cache.set(socket, getSceneVersion(elements)); @@ -288,7 +287,7 @@ export const saveToFirebase = async ( export const loadFromFirebase = async ( roomId: string, roomKey: string, - socket: typeof Socket | null, + socket: any | null, ): Promise => { const firebase = await loadFirestore(); const db = firebase.firestore(); diff --git a/excalidraw-app/data/httpStorage.ts b/excalidraw-app/data/httpStorage.ts index 2b389efd581d..1bc26a4fc447 100644 --- a/excalidraw-app/data/httpStorage.ts +++ b/excalidraw-app/data/httpStorage.ts @@ -1,7 +1,6 @@ // Inspired and partly copied from https://gitlab.com/kiliandeca/excalidraw-fork // MIT, Kilian Decaderincourt -import { Socket } from "socket.io-client"; import { getSyncableElements, SyncableExcalidrawElement } from "."; import { MIME_TYPES } from "../../packages/excalidraw/constants"; import { decompressData } from "../../packages/excalidraw/data/encode"; @@ -43,7 +42,7 @@ const SCENE_VERSION_LENGTH_BYTES = 4 // to prevent modifying upstream files and ease futur maintenance of this fork const httpStorageSceneVersionCache = new WeakMap< - typeof Socket, + any, number >(); @@ -124,7 +123,7 @@ export const saveToHttpStorage = async ( export const loadFromHttpStorage = async ( roomId: string, roomKey: string, - socket: typeof Socket | null, + socket: any | null, ): Promise => { const getResponse = await fetch( `${httpStorageBackendUrl}/rooms/${roomId}`,