🛠 Build optimizations (chunking and lazy-loading)

This commit is contained in:
2026-03-06 12:37:45 -05:00
parent 46e683859e
commit 7818c6f290
4 changed files with 58 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
import React, { ReactElement, useState } from "react";
import React, { ReactElement, Suspense, useState } from "react";
import { isNil } from "lodash";
export const TabControls = (props): ReactElement => {
@@ -47,9 +47,11 @@ export const TabControls = (props): ReactElement => {
</nav>
</div>
</div>
{filteredTabs.map(({ id, content }) => {
return currentActive === id ? content : null;
})}
<Suspense>
{filteredTabs.map(({ id, content }) => {
return currentActive === id ? content : null;
})}
</Suspense>
</>
);
};

View File

@@ -1,11 +1,12 @@
import React from "react";
import React, { lazy } from "react";
import { isNil, isEmpty } from "lodash";
import { VolumeInformation } from "./Tabs/VolumeInformation";
import { ComicInfoXML } from "./Tabs/ComicInfoXML";
import { ArchiveOperations } from "./Tabs/ArchiveOperations";
import AcquisitionPanel from "./AcquisitionPanel";
import TorrentSearchPanel from "./TorrentSearchPanel";
import DownloadsPanel from "./DownloadsPanel";
const VolumeInformation = lazy(() => import("./Tabs/VolumeInformation").then(m => ({ default: m.VolumeInformation })));
const ComicInfoXML = lazy(() => import("./Tabs/ComicInfoXML").then(m => ({ default: m.ComicInfoXML })));
const ArchiveOperations = lazy(() => import("./Tabs/ArchiveOperations").then(m => ({ default: m.ArchiveOperations })));
const AcquisitionPanel = lazy(() => import("./AcquisitionPanel"));
const TorrentSearchPanel = lazy(() => import("./TorrentSearchPanel"));
const DownloadsPanel = lazy(() => import("./DownloadsPanel"));
interface TabConfig {
id: number;