1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-06-14 06:45:12 +02:00

fix(backend): 初期読込時に必要なフロントエンドのアセットがすべて読み込まれていない問題を修正 (#17254)

* fix: バックエンドのCSS読み込みの方法が悪いのを修正

* fix: 使用されないpreloadを削除

* Update Changelog

* add comments
This commit is contained in:
かっこかり
2026-03-21 12:26:50 +09:00
committed by GitHub
parent 9e38288da5
commit b826a16231
6 changed files with 125 additions and 34 deletions

View File

@@ -24,6 +24,12 @@ export type MinimumCommonData = {
config: Config;
};
export type ViteFiles = {
entryJs: string | null;
css: string[];
modulePreloads: string[];
};
export type CommonData = MinimumCommonData & {
langs: string[];
instanceName: string;
@@ -36,8 +42,10 @@ export type CommonData = MinimumCommonData & {
instanceUrl: string;
now: number;
federationEnabled: boolean;
frontendViteFiles: ViteFiles | null;
frontendBootloaderJs: string | null;
frontendBootloaderCss: string | null;
frontendEmbedViteFiles: ViteFiles | null;
frontendEmbedBootloaderJs: string | null;
frontendEmbedBootloaderCss: string | null;
metaJson?: string;

View File

@@ -46,11 +46,11 @@ export function BaseEmbed(props: PropsWithChildren<CommonProps<{
<link rel="icon" href={props.icon ?? '/favicon.ico'} />
<link rel="apple-touch-icon" href={props.appleTouchIcon ?? '/apple-touch-icon.png'} />
{!props.config.frontendEmbedManifestExists ? <script type="module" src="/embed_vite/@vite/client"></script> : null}
{props.frontendEmbedViteFiles == null ? <script type="module" src="/embed_vite/@vite/client"></script> : null}
{props.config.frontendEmbedEntry.css != null ? props.config.frontendEmbedEntry.css.map((href) => (
{(props.frontendEmbedViteFiles?.css ?? []).map((href) => (
<link rel="stylesheet" href={`/embed_vite/${href}`} />
)) : null}
))}
{props.titleSlot ?? <title safe>{props.title || 'Misskey'}</title>}
@@ -62,7 +62,7 @@ export function BaseEmbed(props: PropsWithChildren<CommonProps<{
<script>
const VERSION = '{props.version}';
const CLIENT_ENTRY = {JSON.stringify(props.config.frontendEmbedEntry.file)};
const CLIENT_ENTRY = {JSON.stringify(props.frontendEmbedViteFiles?.entryJs ?? null)};
const LANGS = {JSON.stringify(props.langs)};
</script>

View File

@@ -53,11 +53,11 @@ export function Layout(props: PropsWithChildren<CommonProps<{
{props.infoImageUrl != null ? <link rel="prefetch" as="image" href={props.infoImageUrl} /> : null}
{props.notFoundImageUrl != null ? <link rel="prefetch" as="image" href={props.notFoundImageUrl} /> : null}
{!props.config.frontendManifestExists ? <script type="module" src="/vite/@vite/client"></script> : null}
{props.frontendViteFiles == null ? <script type="module" src="/vite/@vite/client"></script> : null}
{props.config.frontendEntry.css != null ? props.config.frontendEntry.css.map((href) => (
{(props.frontendViteFiles?.css ?? []).map((href) => (
<link rel="stylesheet" href={`/vite/${href}`} />
)) : null}
))}
{props.titleSlot ?? <title safe>{props.title || 'Misskey'}</title>}
@@ -80,7 +80,7 @@ export function Layout(props: PropsWithChildren<CommonProps<{
<script>
const VERSION = '{props.version}';
const CLIENT_ENTRY = {JSON.stringify(props.config.frontendEntry.file)};
const CLIENT_ENTRY = {JSON.stringify(props.frontendViteFiles?.entryJs ?? null)};
const LANGS = {JSON.stringify(props.langs)};
</script>