Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=react&page=357&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=react

Returns an array of strings in format "username" or "username/projectName"

Found 4666 results for "react"(378ms)

OpenTowniesystem_prompt.txt9 matches

@jxnblk•Updated 1 month ago
107- **Storage Strategy:** Only use backend storage if explicitly required; prefer simple static client-side sites
108- For persistence, use Val Town SQLite or Blob storage with `import.meta.url` for keys/table names
109- **React Configuration:** When using React libraries, pin versions with `?deps=react@18.2.0,react-dom@18.2.0` and include the `@jsxImportSource` pragma
110- When facing client-side render issues, check if all React dependencies are pinned to the same version
111- **Styling:** Default to using TailwindCSS via `<script src="https://cdn.twind.style" crossorigin></script>` unless otherwise specified
112
220
221### Frontend Best Practices
222- Structure as a standard client-side React app
223- Use SVG for favicons (Val Town only supports text files)
224- Separate components into individual files
225- Access bootstrapped data from `window.__INITIAL_DATA__`
226- Use React 18.2.0 consistently in all imports and the `@jsxImportSource` pragma
227- Follow the React component pattern from the example project
228- Handle API calls properly with proper error catching
229
247 - Always run table creation before querying
248
2493. **React Configuration:**
250 - All React dependencies must be pinned to 18.2.0
251 - Always include `@jsxImportSource https://esm.sh/react@18.2.0` at the top of React files
252 - Rendering issues often come from mismatched React versions
253
2544. **File Handling:**

OpenTownieREADME.md1 match

@jxnblk•Updated 1 month ago
46
47OpenTownie is built with:
48- React frontend with TypeScript
49- Hono API server backend
50- Tailwind CSS for styling

OpenTownieProjects.tsx2 matches

@jxnblk•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React, { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
3
4// Component for the loading spinner

OpenTownieProjectFiles.tsx2 matches

@jxnblk•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
3import { DirectoryTree } from "./DirectoryTree.tsx";
4import { LoadingSpinner } from "./LoadingSpinner.tsx";

OpenTownieMessageTimer.tsx2 matches

@jxnblk•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { useEffect, useState } from "https://esm.sh/react@18.2.0?dev";
3
4// Utility to format milliseconds into a readable time string

OpenTownieMessagePart.tsx8 matches

@jxnblk•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { type Message } from "https://esm.sh/@ai-sdk/react?dev&deps=react@18.2.0&react-dom@18.2.0";
3import ReactMarkdown from "https://esm.sh/react-markdown?dev&deps=react@18.2.0&react-dom@18.2.0";
4import { ImagePreview } from "./ImageUpload.tsx";
5
48 // Use the triple backtick syntax for code blocks
49 const codeBlock = "```" + language + "\n" + content + "\n```";
50 return <ReactMarkdown>{codeBlock}</ReactMarkdown>;
51};
52
87
88export function MessagePart({ part }: { part: NonNullable<Message["parts"]>[number] }) {
89 if (part.type === "text") return <ReactMarkdown>{part.text}</ReactMarkdown>;
90 if (part.type === "reasoning")
91 return (
95 </summary>
96 <div>
97 <ReactMarkdown>{part.reasoning}</ReactMarkdown>
98 {part.details && part.details.map((detail, index) => (
99 <div key={index} className="mt-2">
100 <ReactMarkdown>{detail.text}</ReactMarkdown>
101 </div>
102 ))}
145 return (
146 <div className="think-content text-lg">
147 <ReactMarkdown>{args.thought}</ReactMarkdown>
148 </div>
149 );

OpenTownieMessageItem.tsx2 matches

@jxnblk•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
3import { MessagePart } from "./MessagePart.tsx";
4import { MessageTimer } from "./MessageTimer.tsx";

OpenTownieLogin.tsx2 matches

@jxnblk•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { useLocalStorage } from "https://esm.sh/react-use?dev&deps=react@18.2.0&react-dom@18.2.0";
3
4export function Login() {

OpenTownieLoadingSpinner.tsx2 matches

@jxnblk•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
3
4export const LoadingSpinner = () => (

OpenTownieindex.tsx2 matches

@jxnblk•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client?dev";
3import { App } from "./components/App.tsx";
4

react-router-starter-remix-13 file matches

@jxnblk•Updated 2 days ago

reactHonoStarter4 file matches

@stfnsr•Updated 3 days ago