-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
38 lines (32 loc) · 1022 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Copyright (C) 2024 Delusoire
* SPDX-License-Identifier: GPL-3.0-or-later
*/
// @deno-types="./mixins.ts"
import mixin, { applyTransforms } from "./mixins.js";
// @deno-types="./module.ts"
import {
enableAllLoadable,
enableAllLoadableMixins,
INTERNAL_MIXIN_LOADER,
INTERNAL_TRANSFORMER,
loadLocalModules,
loadRemoteModules,
} from "./module.js";
// @deno-types="./util.ts"
import { registerReactDevtoolsHook } from "./util.js";
registerReactDevtoolsHook();
await Promise.all([mixin(INTERNAL_TRANSFORMER), loadLocalModules()]);
console.time("onSpotifyPreInit");
await enableAllLoadableMixins();
console.timeEnd("onSpotifyPreInit");
console.time("onSpotifyInit");
await Promise.all(
["/vendor~xpui.js", "/xpui.js"].map(applyTransforms).map(async (p) => import(await p)),
);
console.timeEnd("onSpotifyInit");
console.time("onSpotifyPostInit");
await Promise.all(INTERNAL_MIXIN_LOADER.awaitedMixins);
await enableAllLoadable();
console.timeEnd("onSpotifyPostInit");
requestIdleCallback(loadRemoteModules);