Primate 0.40: Route pages, store enums, async schemas and eventsToday we're announcing the availability of the Primate 0.40 preview release. If you're new to Primate, we recommend reading the quickstart page to get started. Collocated route pages Primate 0.40 supports collocated route pages. Instead of importing a component from views and passing it to response.view, a route can render the frontend file next to it with response.page. TypeScriptroutes/post/[id].ts import response from "primate/response"; import route from "primate/route"; export default route({ get(request) { return response.page({ id: request.path.get("id") }); }, });The frontend file has the same basename as the route, only a different extension. React Angular Vue Svelte Solid Markoroutes/post/[id].tsxroutes/post/[id].component.tsroutes/post/[id].vueroutes/post/[id].svelteroutes/post/[id].tsxroutes/post/[id].marko import type route from "./[id]"; export default function Post(props: typeof route.get.Page) { return <h1>Post {props.id}</h1>; } import type route from "./[id]"; import { Component, input } from "@angular/core"; type Props = typeof route.get.Page; @Component({ template: `<h1>Post {{ id() }}</h1>`, }) export default class Post { id = input.required<Props["id"]>(); } <script setup lang="ts"> import type route from "./[id]"; type Props = typeof route.get.Page; const props = defineProps<{ id: Props["id"] }>(); </script> <template> <h1>Post {{ props.id }}</h1> </template> <script lang="ts"> import type route from "./[id]"; const props: typeof route.get.Page = $props(); </script> <h1>Post {props.id}</h1> import type route from "./[id]"; export default function Post(props: typeof route.get.Page) { return <h1>Post {props.id}</h1>; } import type route from "./[id]"; export interface Input { id: typeof route.get.Page["id"]; } <h1>Post ${input.id}</h1>The route handles data loading, validation, redirects and status codes; the page handles rendering. Typed props without declarations The component exa...
First seen: 2026-07-20 15:11
Last seen: 2026-07-20 16:12