From b858783c65285743590b9f02e31ac95f3d05c19f Mon Sep 17 00:00:00 2001 From: Kamil Stasiak Date: Thu, 13 Jun 2024 12:19:51 +0200 Subject: [PATCH] Update react-client types --- assets/package-lock.json | 12 ++++++------ assets/package.json | 2 +- .../features/streaming/StreamingErrorBoundary.tsx | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/assets/package-lock.json b/assets/package-lock.json index a87c33b..676c7a2 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "license": "Apache-2.0", "dependencies": { - "@fishjam-dev/react-client": "github:fishjam-dev/react-client-sdk", + "@fishjam-dev/react-client": "github:fishjam-dev/react-client-sdk#webrtc-errors", "@mediapipe/tasks-vision": "^0.10.12", "axios": "^1.6.8", "chartist": "^1.3.0", @@ -56,7 +56,7 @@ "extraneous": true, "license": "Apache-2.0", "dependencies": { - "@fishjam-dev/ts-client": "file:../ts-client-sdk", + "@fishjam-dev/ts-client": "github:fishjam-dev/ts-client-sdk", "events": "3.3.0", "lodash.isequal": "4.5.0" }, @@ -72,14 +72,14 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.6", - "prettier": "3.2.5", - "prettier-plugin-tailwindcss": "0.5.12", + "prettier": "3.3.2", + "prettier-plugin-tailwindcss": "0.6.4", "react": "^18.2.0", "testcontainers": "^10.7.2", "typed-emitter": "^2.1.0", "typedoc": "^0.25.12", "typedoc-plugin-mdn-links": "^3.1.18", - "typescript": "5.4.2" + "typescript": "5.4.5" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1035,7 +1035,7 @@ }, "node_modules/@fishjam-dev/react-client": { "version": "0.4.0", - "resolved": "git+ssh://git@github.com/fishjam-dev/react-client-sdk.git#b4ba0bb5d0ca2df15bde897a3ea6b94c8032ae20", + "resolved": "git+ssh://git@github.com/fishjam-dev/react-client-sdk.git#f0b9c516d58509bff74c3c6df226612dc0364aab", "dependencies": { "@fishjam-dev/ts-client": "github:fishjam-dev/ts-client-sdk", "events": "3.3.0", diff --git a/assets/package.json b/assets/package.json index 5e1ed84..211e66b 100644 --- a/assets/package.json +++ b/assets/package.json @@ -11,7 +11,7 @@ "preview": "vite preview" }, "dependencies": { - "@fishjam-dev/react-client": "github:fishjam-dev/react-client-sdk", + "@fishjam-dev/react-client": "github:fishjam-dev/react-client-sdk#webrtc-errors", "@mediapipe/tasks-vision": "^0.10.12", "axios": "^1.6.8", "chartist": "^1.3.0", diff --git a/assets/src/features/streaming/StreamingErrorBoundary.tsx b/assets/src/features/streaming/StreamingErrorBoundary.tsx index b0f53b0..630e9c7 100644 --- a/assets/src/features/streaming/StreamingErrorBoundary.tsx +++ b/assets/src/features/streaming/StreamingErrorBoundary.tsx @@ -3,7 +3,7 @@ import useToast from "../shared/hooks/useToast"; import { ErrorMessage, messageComparator } from "../../pages/room/errorMessage"; import { PeerMetadata, TrackMetadata, useClient } from "../../fishjam"; import useEffectOnChange from "../shared/hooks/useEffectOnChange"; -import { MessageEvents } from "@fishjam-dev/ts-client"; +import { ClientEvents } from "@fishjam-dev/react-client"; export const StreamingErrorBoundary: FC = ({ children }) => { const { addToast } = useToast(); @@ -24,26 +24,26 @@ export const StreamingErrorBoundary: FC = ({ children }) => { useEffect(() => { if (!client) return; - const onSocketError: MessageEvents["socketError"] = (error: Event) => { + const onSocketError: ClientEvents["socketError"] = (error: Event) => { console.warn(error); handleError(`Socket error occurred.`, "onSocketError"); }; - const onConnectionError: MessageEvents["connectionError"] = (error) => { + const onConnectionError: ClientEvents["connectionError"] = (error) => { console.warn(error); handleError(`Connection error occurred. ${error?.message ?? ""}`); }; - const onJoinError: MessageEvents["joinError"] = (event) => { + const onJoinError: ClientEvents["joinError"] = (event) => { console.log(event) handleError(`Failed to join the room`); }; - const onAuthError: MessageEvents["authError"] = (reason) => { + const onAuthError: ClientEvents["authError"] = (reason) => { console.warn(reason); handleError(`Socket error occurred.`, "onAuthError"); }; - const onSocketClose: MessageEvents["socketClose"] = (event) => { + const onSocketClose: ClientEvents["socketClose"] = (event) => { console.warn(event); handleError(`Signaling socket closed.`, "onSocketClose"); };