[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6MN94DASV1K7ST8075QMWPJ":3,"skill-same:01M6MN94DASV1K7ST8075QMWPJ":91},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":67,"commitSha":68,"skillDirectory":69,"forksCount":70,"repositoryHtmlUrl":71,"repositoryHomepageUrl":72,"ownerHtmlUrl":73,"ownerBlogUrl":74,"ownerDescription":75,"updatedAt":76,"install":77,"resources":90},"01M6MN94DASV1K7ST8075QMWPJ","client-side-js",null,"Use when a val needs to ship JavaScript that runs in the browser — React apps, vanilla DOM scripts, canvas\u002Fgames, htmx\u002FAlpine, or any client-side module beyond a single inline snippet. Explains how Val Town serves transpiled .ts\u002F.tsx\u002F.jsx modules with no build step, how the browser resolves their imports, and how to load third-party deps.","hashgraph-online\u002Fawesome-codex-plugins","hashgraph-online","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160371962?v=4","01M6CNB6NRJVNNGN14TR01Q6D3","HOL (Hashgraph Online)","01M6JT1HSKKG9V68KQAQGBA7XP",1575,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fval-town\u002Fplugins\u002Fskills\u002Fclient-side-js\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"client side","client side js","js","client","hydrate","when","imports","jsx","inline","val town","how to","scripts","frontend","apps","tsx","modules","deps","how","ship","browser","react","canvas","2026-11-10 10:12:30",false,"---\nname: client-side-js\ndescription: Use when a val needs to ship JavaScript that runs in the browser — React apps, vanilla DOM scripts, canvas\u002Fgames, htmx\u002FAlpine, or any client-side module beyond a single inline snippet. Explains how Val Town serves transpiled .ts\u002F.tsx\u002F.jsx modules with no build step, how the browser resolves their imports, and how to load third-party deps.\ntriggers: [client, browser, frontend, script, module, esm, bundle, build, hydrate, react-dom, mount, interactive, canvas, alpine, htmx, serveFile, type=module]\n---\n\n# Client-side JavaScript\n\nVal Town has **no build step and no bundler**. A client-side module is just a file\nin your val that you serve over HTTP; Val Town transpiles it per request. You point\na `\u003Cscript type=\"module\">` at a route that returns the file, and the browser runs\nit. There is nothing to configure (no webpack\u002Fvite\u002Fesbuild).\n\n## Serving a module\n\n`serveFile` from `std\u002Futils` reads a file and serves it with the correct\n`Content-Type`. For `.ts`, `.tsx`, and `.jsx` it **transpiles to JavaScript** —\nstrips types, compiles JSX — and serves `text\u002Fjavascript`. You serve the source\nfile; the browser receives runnable JS.\n\n```ts\nimport { serveFile } from \"https:\u002F\u002Fesm.town\u002Fv\u002Fstd\u002Futils\u002Findex.ts\";\n\n\u002F\u002F in any HTTP handler — serve a client module at some URL path\napp.get(\"\u002Fapp.tsx\", (c) => serveFile(\"\u002Fapp.tsx\"));\n```\n\nThen load it from your HTML:\n\n```html\n\u003Cscript type=\"module\" src=\"\u002Fapp.tsx\">\u003C\u002Fscript>\n```\n\nThe path you serve at and the file's location are up to you. A common shortcut is a\nwildcard that serves a whole directory of modules and assets:\n\n```ts\napp.get(\"\u002Fclient\u002F**\u002F*\", (c) => serveFile(c.req.path));\n```\n\n`serveFile` defaults to the current val. If you call it from a non-entrypoint file\nand paths don't resolve, pass `import.meta.url` as the second argument.\n\n## Default: versioned, immutably cached modules\n\n`serveImmutableFile` makes your val's frontend faster by letting browsers cache\nfiles immutably; publishing bumps the val's version, which invalidates\nautomatically. Measured: repeat visits **665ms → 157ms with zero asset requests**.\n\n```ts\nimport { immutableFileUrl, serveImmutableFile } from \"https:\u002F\u002Fesm.town\u002Fv\u002Fstd\u002Futils\u002Findex.ts\";\n\napp.get(\"\u002F__immutable\u002F*\", (c) => serveImmutableFile(c.req.path));\n```\n\nIn the never-cached HTML shell, stamp the entry module:\n`immutableFileUrl(\"\u002Ffrontend\u002Findex.tsx\")` → `\u002F__immutable\u002F42\u002Ffrontend\u002Findex.tsx`\n(42 = the val's current version). Relative imports resolve under the same prefix,\nso only the entry needs stamping — one route and one stamped URL cover the whole\nclient graph.\n\n- Old-version URLs 404 after a publish (like Next.js build assets); a reload\n  picks up the new version.\n- Retrofitting an existing val without touching its shell? Also point its old\n  file route at `serveImmutableFile` — bare paths then 302 into versioned space,\n  at one redirect per page view.\n\n### Alternative: serve directly from esm.town\n\nEvery val file already has a public esm.town URL that transpiles on demand, so you\ncan skip `serveFile` and point a script straight at it:\n\n```html\n\u003Cscript type=\"module\" src=\"https:\u002F\u002Fesm.town\u002Fv\u002Fyouruser\u002Fyourval\u002Fapp.tsx\">\u003C\u002Fscript>\n```\n\n`serveFile` is usually preferred because the module is served same-origin from a\npath you control, and you don't have to hardcode your own val URL.\n\n## How imports resolve in the browser\n\nThe transpiler does not bundle or rewrite imports — it only strips types and JSX.\nSo every import in a client module must be something the **browser** can fetch as a\nURL:\n\n- **Local imports need explicit extensions.** `import { x } from \".\u002Futil.ts\"`\n  resolves to `\u002Futil.ts` (or relative to the served path) and must be served too —\n  by the same route or a wildcard. Omitting the extension (`.\u002Futil`) 404s.\n- **Third-party deps need full ESM URLs.** Bare specifiers like `import React from\n  \"react\"` don't resolve in the browser. Import from a CDN such as esm.sh, with\n  versions pinned:\n\n  ```ts\n  import { createRoot } from \"https:\u002F\u002Fesm.sh\u002Freact-dom@18.2.0\u002Fclient\";\n  ```\n\n  An [import map](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FHTML\u002FElement\u002Fscript\u002Ftype\u002Fimportmap)\n  in the HTML is an option if you want bare specifiers in client code.\n\nThe same model works for any client code — React, vanilla DOM scripts, a canvas\ngame loop, Alpine, htmx. Only the imports differ; for a plain `.ts` module with no\ndependencies there's nothing to load from a CDN at all.\n\n## React specifics\n\nPin all React-family imports to the same version (18.2.0) and pass\n`?deps=react@18.2.0,react-dom@18.2.0` on libraries that depend on React. Mismatched\ncopies cause `Cannot read properties of null (reading 'useState')`. See the\n`react-ui` skill for JSX and styling conventions.\n\n## What not to do\n\n- **No app logic in inline `\u003Cscript>` blobs or template-string HTML.** Put client\n  code in real `.ts`\u002F`.tsx` files so it's typed, linted, and reviewable. A few lines\n  of inline bootstrap are fine; the app is not.\n- **No bundler \u002F build command.** There is no build step to add.\n- **`serveStatic` from Hono does not work** on Val Town — use `serveFile`.\n\n## Verifying changes\n\nFetch the module's URL (e.g. `\u002Fapp.tsx`) and confirm it returns `text\u002Fjavascript`,\nnot HTML or an error. Add `https:\u002F\u002Fesm.town\u002Fv\u002Fstd\u002Fcatch` to the HTML shell to pipe\nbrowser errors into `get_logs`, then load the page and check the logs. Don't report\nthe change as done without both.\n","# Client-side JavaScript\n\nVal Town has **no build step and no bundler**. A client-side module is just a file\nin your val that you serve over HTTP; Val Town transpiles it per request. You point\na `\u003Cscript type=\"module\">` at a route that returns the file, and the browser runs\nit. There is nothing to configure (no webpack\u002Fvite\u002Fesbuild).\n\n## Serving a module\n\n`serveFile` from `std\u002Futils` reads a file and serves it with the correct\n`Content-Type`. For `.ts`, `.tsx`, and `.jsx` it **transpiles to JavaScript** —\nstrips types, compiles JSX — and serves `text\u002Fjavascript`. You serve the source\nfile; the browser receives runnable JS.\n\n```ts\nimport { serveFile } from \"https:\u002F\u002Fesm.town\u002Fv\u002Fstd\u002Futils\u002Findex.ts\";\n\n\u002F\u002F in any HTTP handler — serve a client module at some URL path\napp.get(\"\u002Fapp.tsx\", (c) => serveFile(\"\u002Fapp.tsx\"));\n```\n\nThen load it from your HTML:\n\n```html\n\u003Cscript type=\"module\" src=\"\u002Fapp.tsx\">\u003C\u002Fscript>\n```\n\nThe path you serve at and the file's location are up to you. A common shortcut is a\nwildcard that serves a whole directory of modules and assets:\n\n```ts\napp.get(\"\u002Fclient\u002F**\u002F*\", (c) => serveFile(c.req.path));\n```\n\n`serveFile` defaults to the current val. If you call it from a non-entrypoint file\nand paths don't resolve, pass `import.meta.url` as the second argument.\n\n## Default: versioned, immutably cached modules\n\n`serveImmutableFile` makes your val's frontend faster by letting browsers cache\nfiles immutably; publishing bumps the val's version, which invalidates\nautomatically. Measured: repeat visits **665ms → 157ms with zero asset requests**.\n\n```ts\nimport { immutableFileUrl, serveImmutableFile } from \"https:\u002F\u002Fesm.town\u002Fv\u002Fstd\u002Futils\u002Findex.ts\";\n\napp.get(\"\u002F__immutable\u002F*\", (c) => serveImmutableFile(c.req.path));\n```\n\nIn the never-cached HTML shell, stamp the entry module:\n`immutableFileUrl(\"\u002Ffrontend\u002Findex.tsx\")` → `\u002F__immutable\u002F42\u002Ffrontend\u002Findex.tsx`\n(42 = the val's current version). Relative imports resolve under the same prefix,\nso only the entry needs stamping — one route and one stamped URL cover the whole\nclient graph.\n\n- Old-version URLs 404 after a publish (like Next.js build assets); a reload\n  picks up the new version.\n- Retrofitting an existing val without touching its shell? Also point its old\n  file route at `serveImmutableFile` — bare paths then 302 into versioned space,\n  at one redirect per page view.\n\n### Alternative: serve directly from esm.town\n\nEvery val file already has a public esm.town URL that transpiles on demand, so you\ncan skip `serveFile` and point a script straight at it:\n\n```html\n\u003Cscript type=\"module\" src=\"https:\u002F\u002Fesm.town\u002Fv\u002Fyouruser\u002Fyourval\u002Fapp.tsx\">\u003C\u002Fscript>\n```\n\n`serveFile` is usually preferred because the module is served same-origin from a\npath you control, and you don't have to hardcode your own val URL.\n\n## How imports resolve in the browser\n\nThe transpiler does not bundle or rewrite imports — it only strips types and JSX.\nSo every import in a client module must be something the **browser** can fetch as a\nURL:\n\n- **Local imports need explicit extensions.** `import { x } from \".\u002Futil.ts\"`\n  resolves to `\u002Futil.ts` (or relative to the served path) and must be served too —\n  by the same route or a wildcard. Omitting the extension (`.\u002Futil`) 404s.\n- **Third-party deps need full ESM URLs.** Bare specifiers like `import React from\n  \"react\"` don't resolve in the browser. Import from a CDN such as esm.sh, with\n  versions pinned:\n\n  ```ts\n  import { createRoot } from \"https:\u002F\u002Fesm.sh\u002Freact-dom@18.2.0\u002Fclient\";\n  ```\n\n  An [import map](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FHTML\u002FElement\u002Fscript\u002Ftype\u002Fimportmap)\n  in the HTML is an option if you want bare specifiers in client code.\n\nThe same model works for any client code — React, vanilla DOM scripts, a canvas\ngame loop, Alpine, htmx. Only the imports differ; for a plain `.ts` module with no\ndependencies there's nothing to load from a CDN at all.\n\n## React specifics\n\nPin all React-family imports to the same version (18.2.0) and pass\n`?deps=react@18.2.0,react-dom@18.2.0` on libraries that depend on React. Mismatched\ncopies cause `Cannot read properties of null (reading 'useState')`. See the\n`react-ui` skill for JSX and styling conventions.\n\n## What not to do\n\n- **No app logic in inline `\u003Cscript>` blobs or template-string HTML.** Put client\n  code in real `.ts`\u002F`.tsx` files so it's typed, linted, and reviewable. A few lines\n  of inline bootstrap are fine; the app is not.\n- **No bundler \u002F build command.** There is no build step to add.\n- **`serveStatic` from Hono does not work** on Val Town — use `serveFile`.\n\n## Verifying changes\n\nFetch the module's URL (e.g. `\u002Fapp.tsx`) and confirm it returns `text\u002Fjavascript`,\nnot HTML or an error. Add `https:\u002F\u002Fesm.town\u002Fv\u002Fstd\u002Fcatch` to the HTML shell to pipe\nbrowser errors into `get_logs`, then load the page and check the logs. Don't report\nthe change as done without both.\n",{"name":5,"triggers":54,"description":7},[30,46,39,55,56,57,58,59,31,60,61,62,48,63,64,65,66],"script","module","esm","bundle","build","react-dom","mount","interactive","alpine","htmx","serveFile","type=module","main","2b63f856ce19c2a797929cacabd9e0fc936812fa","plugins\u002Fval-town\u002Fplugins\u002Fskills\u002Fclient-side-js",491,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins","https:\u002F\u002Fhol.org\u002Fplugins\u002Fbest-codex-plugins","https:\u002F\u002Fgithub.com\u002Fhashgraph-online","https:\u002F\u002Fhol.org","Open-source standards and developer tools for interoperable AI agents: discovery, identity, communication, payments, privacy and security.","2026-11-14 14:06:13",{"source":8,"skillName":5,"commands":78,"prompt":88,"zipAvailable":89},[79,82,85],{"tool":80,"command":81},"npx","npx skills add hashgraph-online\u002Fawesome-codex-plugins --skill client-side-js",{"tool":83,"command":84},"bunx","bunx skills add hashgraph-online\u002Fawesome-codex-plugins --skill client-side-js",{"tool":86,"command":87},"pnpm","pnpm dlx skills add hashgraph-online\u002Fawesome-codex-plugins --skill client-side-js","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fval-town\u002Fplugins\u002Fskills\u002Fclient-side-js\u002FSKILL.md",true,[],[92,102,110,118,126,134],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":97,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":101},"01M7DV332YQMGD8WTRJ9DZQXTB","worktable-review-with-annotations","Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.","MIT","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":106,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":101},"01M7DV2YGHCZVBEB1AHYB6CGHE","worktable-find-and-synthesize-context","Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":114,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":101},"01M7DV2TQN1H11ME2SAF9MXN7V","worktable-create-or-update-docs","Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":122,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":101},"01M7DV2NE452NEA8TXATKSNAJH","worktable-create-or-manage-records","Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FSKILL.md",[],[],{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":130,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":101},"01M7DV2HENRBR2KSCVM064WH0Y","worktable-create-or-manage-interactive-html","Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":138,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":101},"01M7DV2CADR5R7RQFFYPNAGR9Y","worktable-collaborate-threads","Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FSKILL.md",[],[]]