htmx-router
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -13,3 +13,3 @@ import { Parameterized, Parameterizer, ParameterShaper } from "./util/parameters.js"; | ||
}; | ||
export declare function loader(ctx: RouteContext<typeof parameters>): Promise<(Response | BodyInit) | null>; | ||
export declare function loader(ctx: RouteContext<typeof parameters>): Promise<JSX.Element | null>; | ||
export declare const action: typeof loader; |
@@ -71,11 +71,6 @@ import { ServerOnlyWarning } from "./internal/util.js"; | ||
} | ||
ctx.headers.set("X-Partial", "true"); | ||
const forward = new RouteContext(ctx, prelude, entry.shape); | ||
const res = await endpoint(forward); | ||
if (res instanceof Response) | ||
return res; | ||
if (res === null) | ||
return null; | ||
ctx.headers.set("X-Partial", "true"); | ||
return ctx.render(res, ctx.headers); | ||
return await endpoint(forward); | ||
} | ||
export const action = loader; |
@@ -19,3 +19,3 @@ import type { RenderFunction, RouteContext } from "./index.js"; | ||
}; | ||
export declare function loader(ctx: RouteContext<typeof parameters>): Promise<(Response | BodyInit) | null>; | ||
export declare function loader(ctx: RouteContext<typeof parameters>): Promise<JSX.Element | null>; | ||
export declare const action: typeof loader; |
@@ -33,9 +33,4 @@ import { ServerOnlyWarning } from "./internal/util.js"; | ||
return null; | ||
const res = await endpoint.render(ctx); | ||
if (res === null) | ||
return null; | ||
if (res instanceof Response) | ||
return res; | ||
return ctx.render(res, ctx.headers); | ||
return await endpoint.render(ctx); | ||
} | ||
export const action = loader; |
{ | ||
"name": "htmx-router", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A lightweight SSR framework with server+client islands", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -167,3 +167,3 @@ import { ServerOnlyWarning } from "./internal/util.js"; | ||
throw res; | ||
let caught = await this.slug.error(ctx, res); | ||
const caught = await this.slug.error(ctx, res); | ||
if (caught instanceof Response) { | ||
@@ -170,0 +170,0 @@ caught.headers.set("X-Caught", "true"); |
81186
2341