24 lines
1017 B
TypeScript
24 lines
1017 B
TypeScript
import type { LoaderFunctionArgs } from "react-router";
|
|
import { createHotSwapDrillPage } from "@toolctrl/ui-mock";
|
|
import { HotSwapPageRenderer } from "~/components/ui/hot-swap/HotSwapPageRenderer";
|
|
|
|
/**
|
|
* Hot-swap activation reference route.
|
|
*
|
|
* Renders one page through the @toolctrl/ui-app registry shell instead of a
|
|
* hand-rolled component tree. The descriptor comes from @toolctrl/ui-mock so
|
|
* the path is fixture-driven and verifiable without a Subframe (or other
|
|
* design-source) binding yet. Hidden outside development to keep production
|
|
* surface area unchanged — see docs/ui-inventory/hot-swap-status.md.
|
|
*/
|
|
export async function loader(_args: LoaderFunctionArgs) {
|
|
if (process.env.NODE_ENV === "production") {
|
|
throw new Response(null, { status: 404 });
|
|
}
|
|
return { descriptor: createHotSwapDrillPage() };
|
|
}
|
|
|
|
export default function HotSwapDemo({ loaderData }: { loaderData: Awaited<ReturnType<typeof loader>> }) {
|
|
return <HotSwapPageRenderer descriptor={loaderData.descriptor} />;
|
|
}
|