From c516207199dd6e4d2430b38b670ab1c9efb612d4 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 23 Aug 2023 10:12:09 +0100 Subject: [PATCH] Remove matrix-widget-api as a dep & remove livekit stuff from widget init We'll always have matrix-widget-api as a dep through js-sdk so also specifyin it ourselves just means we'll end up using a different version when the js-sdk upgrade their copy and get wierd errors. We could add a peerDependency if we really felt the need? --- package.json | 1 - src/widget.ts | 16 ---------------- yarn.lock | 8 -------- 3 files changed, 25 deletions(-) diff --git a/package.json b/package.json index 77d10cfa..f592e9ee 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "livekit-client": "1.12.3", "lodash": "^4.17.21", "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#0d46aeb5a4d44685885adc502f46688a4bed65b6", - "matrix-widget-api": "^1.3.1", "mermaid": "^8.13.8", "normalize.css": "^8.0.1", "pako": "^2.0.4", diff --git a/src/widget.ts b/src/widget.ts index de03d78e..324dbe4a 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -157,15 +157,6 @@ export const widget: WidgetHelpers | null = (() => { timelineSupport: true, useE2eForGroupCall: e2eEnabled, fallbackICEServerAllowed: allowIceFallback, - // XXX: The client expects the list of foci in its constructor, but we don't - // know this until we fetch the config file. However, we can't wait to construct - // the client object or we'll miss the 'capabilities' request from the host app. - // As of writing this, I have made the embedded widget client send the 'contentLoaded' - // message so that we can use the widget API in less racy mode, but we need to change - // element-web to use waitForIFrameLoad=false. Once that change has rolled out, - // we can just start the client after we've fetched the config. - livekitServiceURL: undefined, - useLivekitForGroupCalls: true, } ); @@ -174,13 +165,6 @@ export const widget: WidgetHelpers | null = (() => { // wait for the config file to be ready (we load very early on so it might not // be otherwise) await Config.init(); - const livekit = Config.get().livekit; - const focus = livekit?.livekit_service_url; - // Now we've fetched the config, be evil and use the getter to inject the focus - // into the client (see above XXX). - if (focus) { - client.setLivekitServiceURL(livekit.livekit_service_url); - } await client.startClient(); resolve(client); })(); diff --git a/yarn.lock b/yarn.lock index 4c2c0dac..2e336c79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10962,14 +10962,6 @@ matrix-events-sdk@0.0.1: unhomoglyph "^1.0.6" uuid "9" -matrix-widget-api@^1.3.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-1.4.0.tgz#e426ec16a013897f3a4a9c2bff423f54ab0ba745" - integrity sha512-dw0dRylGQzDUoiaY/g5xx1tBbS7aoov31PRtFMAvG58/4uerYllV9Gfou7w+I1aglwB6hihTREzKltVjARWV6A== - dependencies: - "@types/events" "^3.0.0" - events "^3.2.0" - matrix-widget-api@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-1.5.0.tgz#4ae3e46a7f2854f944ddaf8a5af63d72fba76c45"