1import { ActionFunctionArgs, LoaderFunctionArgs } from "npm:react-router";
2import aboutLoader from "./about.loader.ts";
3import About from "./about.tsx";
15 // imports the correct one to avoid putting the server code in client
16 // bundles
17 async loader(args: LoaderFunctionArgs) {
18 let mod = await (isServer
19 ? import("./layout.server.ts")
23 // same with the action, you'll probably want to abstract this kind of stuff
24 // in a createRoute() kind of thing
25 async action(args: ActionFunctionArgs) {
26 let mod = await (isServer
27 ? import("./layout.server.ts")
1/** @jsxImportSource npm:react */
2
3export default function Home() {
4 return <h1>Home</h1>;
5}
7let { query, dataRoutes } = createStaticHandler(routes);
8
9export async function handler(request: Request) {
10 // 1. run actions/loaders to get the routing context with `query`
11 let context = await query(request);
1import { data } from "npm:react-router";
2
3export default async function load() {
4 await new Promise(resolve => setTimeout(resolve, 200));
5
18];
19
20function App() {
21 const [noClicks, setNoClicks] = useState(0);
22 const [isValentine, setIsValentine] = useState(false);
113}
114
115function client() {
116 createRoot(document.getElementById("root")).render(<App />);
117}
118if (typeof document !== "undefined") { client(); }
119
120export default async function server(request: Request): Promise<Response> {
121 return new Response(
122 `
20];
21
22function App() {
23 const [noClicks, setNoClicks] = useState(0);
24 const [isValentine, setIsValentine] = useState(false);
139}
140
141function client() {
142 createRoot(document.getElementById("root")).render(<App />);
143}
147}
148
149export default async function server(request: Request): Promise<Response> {
150 return new Response(
151 `
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 return new Response(
107 `
13];
14
15function preloadImage(src: string): Promise<HTMLImageElement> {
16 return new Promise((resolve, reject) => {
17 const img = new Image();
22}
23
24function App() {
25 const [noClicks, setNoClicks] = useState(0);
26 const [isValentine, setIsValentine] = useState(false);
420}
421
422function client() {
423 createRoot(document.getElementById("root")).render(<App />);
424}
425if (typeof document !== "undefined") { client(); }
426
427export default async function server(request: Request): Promise<Response> {
428 return new Response(
429 `
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 return new Response(
107 `
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
124}
125
126function client() {
127 createRoot(document.getElementById("root")).render(<App />);
128}
132}
133
134export default async function server(request: Request): Promise<Response> {
135 return new Response(
136 `
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",