feat: speed up admin clone import and enable Cache Components
- Clone import: defer FurnitureData.json writes and append all entries in a single batched write instead of one read-modify-write per item, removing the main serialization bottleneck for large batches. - Clone import: raise SSE batch concurrency cap from 5 to 10 and bump the clone client/route default from 2 to 6. - Add a flush hook to runSseBatch so callers can batch deferred work before batch_complete is emitted, and surface flush errors as an error event. - Enable Next.js Cache Components (instant: false opt-out) and silence the related build warnings in next.config.ts. - Switch isomorphic-dompurify to dompurify and refresh dependencies.
This commit is contained in:
1 parent
ac9b3e3cb5
commit
dc8fb8a6ed
254 files changed
+910
-551
No files matched your search
@@ -10,6 +10,10 @@ import { Button } from "@/components/ui/button";
|
||||
import { db, RadioApiKeys } from "@/lib/db";
|
||||
import { formatDate } from "@/lib/format-date";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
export const metadata = { title: "Radio API Keys" };
|
||||
|
||||
type ApiKey = {
|
||||
|
||||
@@ -11,6 +11,10 @@ import { Button } from "@/components/ui/button";
|
||||
import { db, RadioAutoDjPlaylist } from "@/lib/db";
|
||||
import { formatDate } from "@/lib/format-date";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
export const metadata = { title: "Radio AutoDJ" };
|
||||
|
||||
type Track = {
|
||||
|
||||
@@ -11,6 +11,10 @@ import { Button } from "@/components/ui/button";
|
||||
import { db, RadioBanners } from "@/lib/db";
|
||||
import { formatDate } from "@/lib/format-date";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
type Banner = {
|
||||
id: bigint;
|
||||
userId: bigint;
|
||||
|
||||
@@ -6,6 +6,10 @@ import { resolveHotelName } from "@/lib/hotel-name";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
import { EmbedSnippet } from "./embed-snippet";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
export const metadata = { title: "Radio Embed" };
|
||||
|
||||
export default async function AdminRadioEmbedPage() {
|
||||
|
||||
@@ -4,6 +4,10 @@ import { StatusCard } from "@/components/admin/dashboard";
|
||||
import { db, RadioHistory, User } from "@/lib/db";
|
||||
import { formatDate } from "@/lib/format-date";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
type History = {
|
||||
id: bigint;
|
||||
userId: bigint;
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
export default async function RadioAdminLayout({
|
||||
children,
|
||||
}: {
|
||||
|
||||
@@ -6,6 +6,10 @@ import { Button } from "@/components/ui/button";
|
||||
import { db, RadioShouts } from "@/lib/db";
|
||||
import { formatDate } from "@/lib/format-date";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
type Shout = {
|
||||
id: bigint;
|
||||
userId: bigint;
|
||||
|
||||
@@ -2,6 +2,10 @@ import { getTranslations } from "next-intl/server";
|
||||
import { DiagnosticRow, StatusCard } from "@/components/admin/dashboard";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
export const metadata = { title: "Radio Monitoring" };
|
||||
|
||||
const FETCH_TIMEOUT_MS = 4000;
|
||||
|
||||
@@ -6,6 +6,10 @@ import { Button } from "@/components/ui/button";
|
||||
import { db, RadioApplications, RadioSchedules, RadioShouts } from "@/lib/db";
|
||||
import { formatDate } from "@/lib/format-date";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
type Shout = {
|
||||
id: bigint;
|
||||
userId: bigint;
|
||||
|
||||
@@ -4,6 +4,10 @@ import { StatusCard } from "@/components/admin/dashboard";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
export const metadata = { title: "Radio Points" };
|
||||
|
||||
const DEFAULTS = {
|
||||
|
||||
@@ -9,6 +9,10 @@ import { StatusCard } from "@/components/admin/dashboard";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { db, RadioRanks } from "@/lib/db";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
type Rank = {
|
||||
id: bigint;
|
||||
name: string;
|
||||
|
||||
@@ -7,6 +7,10 @@ import { StatusCard } from "@/components/admin/dashboard";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { db, WebsiteSetting } from "@/lib/db";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
type Field = { key: string; comment: string };
|
||||
type Group = { title: string; fields: Field[] };
|
||||
|
||||
|
||||
Reference in new issue
Block a user