docs(plan): lazy import lands with first reader wiring (noUnusedLocals)

This commit is contained in:
2026-09-07 15:49:44 +08:00
parent 97f6d2d3b6
commit 052b94bb6a
@@ -1619,7 +1619,7 @@ export function useProgressSaver(bookId: number): ProgressSaver {
```tsx
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { lazy, Suspense, type ComponentType, type LazyExoticComponent } from "react";
import { Suspense, type ComponentType, type LazyExoticComponent } from "react"; // lazy 自 Task 7 起随首个 READERS 条目补进本行(noUnusedLocals)
import { Link, useNavigate, useParams } from "react-router-dom";
import { api } from "../api/client";
import type { Format } from "../api/types";
@@ -2041,7 +2041,7 @@ export default function CbzReader({ book, initialLocator }: ReaderProps) {
- [ ] **Step 5: `src/pages/Reader.tsx` 接线 cbz**
`READERS` 整块替换为(lazy 动态导入,不新增顶部静态 import,保持 code-splitting):
先把 react import 行还原为含 `lazy`(见 Task 6 注释),再整块替换 READERS:
```tsx
const READERS: Partial<Record<Format, LazyExoticComponent<ComponentType<ReaderProps>>>> = {