mirror of
https://github.com/MisskeyIO/misskey
synced 2025-01-22 17:53:41 +09:00
perf: dynamically load audio visualizer (MisskeyIO#912)
audio visualizer weights 475 kB by itself, and audio files are relatively rare on timelines, so it makes sense to load it only when it's necessary
This commit is contained in:
parent
d423d9bb44
commit
15414e4ce5
@ -79,7 +79,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { shallowRef, watch, computed, ref, onDeactivated, onActivated, onMounted } from 'vue';
|
||||
import { shallowRef, watch, computed, ref, onDeactivated, onActivated, onMounted, defineAsyncComponent } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import type { MenuItem } from '@/types/menu.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
@ -87,11 +87,11 @@ import { i18n } from '@/i18n.js';
|
||||
import * as os from '@/os.js';
|
||||
import bytes from '@/filters/bytes.js';
|
||||
import { hms } from '@/filters/hms.js';
|
||||
import MkAudioVisualizer from '@/components/MkAudioVisualizer.vue';
|
||||
import MkMediaRange from '@/components/MkMediaRange.vue';
|
||||
import { pleaseLogin } from '@/scripts/please-login.js';
|
||||
import { $i, iAmModerator } from '@/account.js';
|
||||
|
||||
const MkAudioVisualizer = defineAsyncComponent(() => import('@/components/MkAudioVisualizer.vue'));
|
||||
const props = defineProps<{
|
||||
audio: Misskey.entities.DriveFile;
|
||||
user?: Misskey.entities.UserLite;
|
||||
|
Loading…
Reference in New Issue
Block a user