From 1b9112b876c050a9c6ef6f741470592134c6017f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 6 Apr 2020 12:24:56 +0100 Subject: [PATCH] Revert "Combine two async imports into one by way of skin.ts" This reverts commit e788433c Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/init.ts | 15 +++++++++++---- src/vector/skin.ts | 22 ---------------------- 2 files changed, 11 insertions(+), 26 deletions(-) delete mode 100644 src/vector/skin.ts diff --git a/src/vector/init.ts b/src/vector/init.ts index c43f48e3db..8b8a62bb3c 100644 --- a/src/vector/init.ts +++ b/src/vector/init.ts @@ -123,10 +123,17 @@ export async function loadSkin() { // the SDK until we have to in imports. console.log("Loading skin..."); // load these async so that its code is not executed immediately and we can catch any exceptions - const {sdk, skin} = await import( - /* webpackChunkName: "skin" */ - /* webpackPreload: true */ - "./skin"); + const [sdk, skin] = await Promise.all([ + import( + /* webpackChunkName: "matrix-react-sdk" */ + /* webpackPreload: true */ + "matrix-react-sdk"), + import( + /* webpackChunkName: "riot-web-component-index" */ + /* webpackPreload: true */ + // @ts-ignore - this module is generated so may fail lint + "../component-index"), + ]); sdk.loadSkin(skin); console.log("Skin loaded!"); } diff --git a/src/vector/skin.ts b/src/vector/skin.ts deleted file mode 100644 index c0c527fdb7..0000000000 --- a/src/vector/skin.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2020 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import * as sdk from "matrix-react-sdk"; -// @ts-ignore - this module is generated so may fail lint -import * as skin from "../component-index"; - -// we re-export here so that we can async-load this one file and webpack will bundle them together. -export {sdk, skin};