Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
},
"imports": {
"react": "npm:react@^19.2.4",
"@types/react": "npm:@types/react@^19.2.9"
"@types/react": "npm:@types/react@^19.2.13"
},
"compilerOptions": {
"lib": [
Expand Down
133 changes: 89 additions & 44 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions example/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@
"@udibo/juniper": "jsr:@udibo/juniper@^0.3.2",
"@udibo/esbuild-plugin-postcss": "jsr:@udibo/esbuild-plugin-postcss@^0.3.0",
"@std/testing": "jsr:@std/testing@^1.0.17",
"@std/assert": "jsr:@std/assert@^1.0.17",
"@std/async": "jsr:@std/async@^1.1.0",
"@std/collections": "jsr:@std/collections@^1.1.4",
"@std/assert": "jsr:@std/assert@^1.0.18",
"@std/async": "jsr:@std/async@^1.1.1",
"@std/collections": "jsr:@std/collections@^1.1.5",
"@std/encoding": "jsr:@std/encoding@^1.0.10",
"@std/path": "jsr:@std/path@^1.1.4",
"@std/streams": "jsr:@std/streams@^1.0.17",
"@std/uuid": "jsr:@std/uuid@^1.1.0",
"@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
"playwright": "npm:playwright@^1.58.0",
"playwright": "npm:playwright@^1.58.2",
"react": "npm:react@^19.2.4",
"@types/react": "npm:@types/react@^19.2.9",
"@types/react": "npm:@types/react@^19.2.13",
"react-router": "npm:react-router@^7.13.0",
"hono": "npm:hono@^4.11.6",
"hono": "npm:hono@^4.11.9",
"tailwindcss": "npm:tailwindcss@^4.1.18",
"@tailwindcss/postcss": "npm:@tailwindcss/postcss@^4.1.18",
"zod": "npm:zod@^4.3.6",
Expand Down
16 changes: 15 additions & 1 deletion src/_server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { parseArgs } from "@std/cli/parse-args";
import { HttpError } from "./mod.ts";
import { SpanStatusCode } from "@opentelemetry/api";
import { Hono } from "hono";
import type { Context, Env, Schema } from "hono";
import type { Context, Env, MiddlewareHandler, Schema } from "hono";
import { createFactory } from "hono/factory";
import { serveStatic } from "hono/deno";
import { stream } from "hono/streaming";
Expand Down Expand Up @@ -1047,6 +1047,20 @@ export function buildApp<
app.route("*", catchallApp);
}

// Catch data requests that didn't match any route handler at this level.
// This happens when the client navigates to a non-existent URL and React Router
// needs to re-fetch parent route data (e.g., GET /identity/applications with
// X-Juniper-Route-Id: "/" to refresh the root loader).
if (isClientRoute && errorHandler) {
const handleDataRequest = reactHandlers[reactHandlers.length - 1];
app.use("*", (c, next) => {
if (c.req.header("X-Juniper-Route-Id")) {
return (handleDataRequest as unknown as MiddlewareHandler)(c, next);
}
return next();
});
}

app.use("*", notFound);
return app;
}
Loading