Add more features. Customize HTML. Add server logic and other page module exports to __root

This commit is contained in:
2026-03-23 19:14:56 +01:00
parent 67ed8749e2
commit 6f1db7c01f
15 changed files with 389 additions and 232 deletions
+18 -5
View File
@@ -1,5 +1,12 @@
import type { MatchedRoute, Server, WebSocketHandler } from "bun";
import type { FC, JSX, PropsWithChildren, ReactNode } from "react";
import type {
DetailedHTMLProps,
FC,
HtmlHTMLAttributes,
JSX,
PropsWithChildren,
ReactNode,
} from "react";
export type ServerProps = {
params: Record<string, string>;
@@ -145,11 +152,10 @@ export type PageDistGenParams = {
export type LivePageDistGenParams = {
component: ReactNode;
head?: FC<BunextPageHeadFCProps>;
pageProps?: any;
module?: BunextPageModule;
root_module?: BunextRootModule;
bundledMap?: BundlerCTXMap;
meta?: BunextPageModuleMeta;
routeParams?: BunxRouteParams;
debug?: boolean;
};
@@ -165,8 +171,14 @@ export type BunextPageModule = {
meta?: BunextPageModuleMeta | BunextPageModuleMetaFn;
Head?: FC<BunextPageHeadFCProps>;
config?: BunextRouteConfig;
html_props?: BunextHTMLProps;
};
export type BunextHTMLProps = DetailedHTMLProps<
HtmlHTMLAttributes<HTMLHtmlElement>,
HTMLHtmlElement
>;
export type BunextPageModuleMetaFn = (params: {
ctx: BunxRouteParams;
serverRes?: BunextPageModuleServerReturn;
@@ -253,11 +265,12 @@ export type GrabPageComponentRes = {
routeParams?: BunxRouteParams;
bundledMap?: BundlerCTXMap;
module: BunextPageModule;
meta?: BunextPageModuleMeta;
head?: FC<BunextPageHeadFCProps>;
root_module?: BunextRootModule;
debug?: boolean;
};
export type BunextRootModule = BunextPageModule;
export type GrabPageReactBundledComponentRes = {
component: JSX.Element;
server_res?: BunextPageModuleServerReturn;