From 384903361d5ff3c608fedecf2105100201c00ca8 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 2 Mar 2022 16:39:14 -0700 Subject: [PATCH] Step 4: Disable/remove bulk of skinner code --- src/vector/index.ts | 5 +---- src/vector/init.tsx | 21 --------------------- test/skin-sdk.js | 2 +- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/vector/index.ts b/src/vector/index.ts index 87388799c3..e27129d9aa 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -110,7 +110,6 @@ async function start() { preparePlatform, loadOlm, loadConfig, - loadSkin, loadLanguage, loadTheme, loadApp, @@ -160,10 +159,9 @@ async function start() { const loadLanguagePromise = loadLanguage(); // as quickly as we possibly can, set a default theme... const loadThemePromise = loadTheme(); - const loadSkinPromise = loadSkin(); // await things settling so that any errors we have to render have features like i18n running - await settled(loadSkinPromise, loadThemePromise, loadLanguagePromise); + await settled(loadThemePromise, loadLanguagePromise); let acceptBrowser = supportedBrowser; if (!acceptBrowser && window.localStorage) { @@ -211,7 +209,6 @@ async function start() { // assert things started successfully // ################################## await loadOlmPromise; - await loadSkinPromise; await loadThemePromise; await loadLanguagePromise; diff --git a/src/vector/init.tsx b/src/vector/init.tsx index e810d6c826..0e43700ae9 100644 --- a/src/vector/init.tsx +++ b/src/vector/init.tsx @@ -127,27 +127,6 @@ export async function loadLanguage() { } } -export async function loadSkin() { - // Ensure the skin is the very first thing to load for the react-sdk. We don't even want to reference - // the SDK until we have to in imports. - logger.log("Loading skin..."); - // load these async so that its code is not executed immediately and we can catch any exceptions - const [sdk, skin] = await Promise.all([ - import( - /* webpackChunkName: "matrix-react-sdk" */ - /* webpackPreload: true */ - "matrix-react-sdk"), - import( - /* webpackChunkName: "element-web-component-index" */ - /* webpackPreload: true */ - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - this module is generated so may fail lint - "../component-index"), - ]); - sdk.loadSkin(skin); - logger.log("Skin loaded!"); -} - export async function loadTheme() { setTheme(); } diff --git a/test/skin-sdk.js b/test/skin-sdk.js index eaeff52043..3a3067ea64 100644 --- a/test/skin-sdk.js +++ b/test/skin-sdk.js @@ -6,4 +6,4 @@ import * as sdk from "matrix-react-sdk"; import * as skin from "../src/component-index"; -sdk.loadSkin(skin); +// sdk.loadSkin(skin);