1null
2
3Migrated from folder: _LEAVE_AS_IS/badge_LEAVE_AS_IS/valTownLogotypeReact
1/** @jsxImportSource npm:preact **/
2import codeOnValTown from "https://esm.town/v/andreterron/codeOnValTown?v=50";
3import { render } from "npm:preact-render-to-string";
4
5const githubQuery = (query: string) => encodeURIComponent(`${query} repo:pomdtr/val-town-mirror path:vals/`);
1/** @jsxImportSource https://esm.sh/preact */
2import { render } from "npm:preact-render-to-string";
3
4export default async function(req: Request) {
1/** @jsxImportSource https://esm.sh/react */
2import { modifyFetchHandler as codeOnValTown } from "https://esm.town/v/andreterron/codeOnValTown?v=45";
3import { modifyResponse } from "https://esm.town/v/andreterron/codeOnVT_modifyResponse?v=9";
5import { Chess, Move, Square } from "npm:chess.js";
6import minify from "npm:css-simple-minifier";
7import { renderToString } from "npm:react-dom/server";
8
9class StaticChess {
1/** @jsxImportSource https://esm.sh/react */
2import { Chess, Move, Square } from "npm:chess.js";
3import minify from "npm:css-simple-minifier";
4import { renderToString } from "npm:react-dom/server";
5
6class StaticChess {
1/** @jsxImportSource https://esm.sh/react */
2import { Chess, Move, Square } from "npm:chess.js";
3import minify from "npm:css-simple-minifier";
4import { renderToString } from "npm:react-dom/server";
5
6class StaticChess {
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import cronstrue from "https://esm.sh/cronstrue";
3import React, { useState } from "https://esm.sh/react@18.2.0";
4import { chat } from "https://esm.town/v/stevekrouse/openai?v=19";
5import react_http from "https://esm.town/v/stevekrouse/react_http?v=6";
6
7export default function(req: Request) {
8 const url = new URL(req.url);
9 if (req.method === "GET" && url.pathname === "/") {
10 return react_http({
11 component: App,
12 sourceURL: import.meta.url,
26 const [loading, setLoading] = useState(false);
27 const [cron, setCron] = useState("0 16 * * 1-5");
28 const onSubmit: React.FormEventHandler<HTMLFormElement> = async function(e) {
29 e.preventDefault();
30 setLoading(true);
6 <script type="module">
7 import { ${component.name} } from "${sourceURL}";
8 import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
9 import { jsx } from "https://esm.sh/react@18.2.0/jsx-runtime";
10 createRoot(document.body).render(jsx(${component.name}, {}));
11 </script>
12## TODO
13
14- [ ] simplify by removing HTMX (try doing the form as a GET request, manual JS script, or client side react)
15- [ ] make the timezone picker better (fewer options, searchable)
16- [ ] add a copy button?
17
18Migrated from folder: Archive/cron_client_react_fork
Starter template with client-side React & Hono server
A web-based dice roller using React on Val Town
Write business logic with ease
Meet the new standard for modern TypeScript development.
Type-safe, reactive, framework-agnostic library to manage your business logic.
Follow me if you learn more about JavaScript | TypeScript | React.js | Next.js | Linux | NixOS | Frontend Developer | https://linktr.ee/officialrajdeepsingh