@rangojs/router 0.0.0-experimental.31 → 0.0.0-experimental.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vite/index.js
CHANGED
|
@@ -1745,7 +1745,7 @@ import { resolve } from "node:path";
|
|
|
1745
1745
|
// package.json
|
|
1746
1746
|
var package_default = {
|
|
1747
1747
|
name: "@rangojs/router",
|
|
1748
|
-
version: "0.0.0-experimental.
|
|
1748
|
+
version: "0.0.0-experimental.32",
|
|
1749
1749
|
description: "Django-inspired RSC router with composable URL patterns",
|
|
1750
1750
|
keywords: [
|
|
1751
1751
|
"react",
|
package/package.json
CHANGED
package/src/router/match-api.ts
CHANGED
|
@@ -117,6 +117,7 @@ export async function matchForPrerender<TEnv = any>(
|
|
|
117
117
|
deleteCookie: () => {},
|
|
118
118
|
header: () => {},
|
|
119
119
|
setStatus: () => {},
|
|
120
|
+
_setStatus: () => {},
|
|
120
121
|
use: (() => {
|
|
121
122
|
throw new Error("use() not available during pre-rendering");
|
|
122
123
|
}) as any,
|
|
@@ -346,6 +347,7 @@ export async function renderStaticSegment<TEnv = any>(
|
|
|
346
347
|
deleteCookie: () => {},
|
|
347
348
|
header: () => {},
|
|
348
349
|
setStatus: () => {},
|
|
350
|
+
_setStatus: () => {},
|
|
349
351
|
use: (() => {
|
|
350
352
|
throw new Error("use() not available during static pre-rendering");
|
|
351
353
|
}) as any,
|
|
@@ -95,6 +95,8 @@ export interface RequestContext<
|
|
|
95
95
|
header(name: string, value: string): void;
|
|
96
96
|
/** Set the response status code */
|
|
97
97
|
setStatus(status: number): void;
|
|
98
|
+
/** @internal Set status bypassing cache-exec guard (for framework error handling) */
|
|
99
|
+
_setStatus(status: number): void;
|
|
98
100
|
|
|
99
101
|
/**
|
|
100
102
|
* Access loader data or push handle data.
|
|
@@ -301,6 +303,7 @@ export type PublicRequestContext<
|
|
|
301
303
|
| "_reportBackgroundError"
|
|
302
304
|
| "_debugPerformance"
|
|
303
305
|
| "_metricsStore"
|
|
306
|
+
| "_setStatus"
|
|
304
307
|
| "res"
|
|
305
308
|
>;
|
|
306
309
|
|
|
@@ -629,8 +632,13 @@ export function createRequestContext<TEnv>(
|
|
|
629
632
|
|
|
630
633
|
setStatus(status: number): void {
|
|
631
634
|
assertNotInsideCacheExec(ctx, "setStatus");
|
|
632
|
-
|
|
633
|
-
|
|
635
|
+
stubResponse = new Response(null, {
|
|
636
|
+
status,
|
|
637
|
+
headers: stubResponse.headers,
|
|
638
|
+
});
|
|
639
|
+
},
|
|
640
|
+
|
|
641
|
+
_setStatus(status: number): void {
|
|
634
642
|
stubResponse = new Response(null, {
|
|
635
643
|
status,
|
|
636
644
|
headers: stubResponse.headers,
|