ssr-web-app-development
Use when editing a server-rendered web UI.
- License 许可
- MIT
- 最近更新
- 2026-10-20
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ssr-web-app-development
- author
- Masia
- license
- MIT
- version
- 1.0.0
- metadata
- { "hermes": { "tags": [ "frontend", "ssr", "testing" ], "related_skills": [ "browser-qa" ] } }
- description
- Use when editing a server-rendered web UI.
02 资源文件 2
- 参考文档references/msw-jsdom-multipart.md996 B
- 参考文档references/share-link-formats.md3.5 KB
03 SKILL.md 正文
SSR Web App Development
Server-rendered React fails quietly. A render-time exception is often caught by the page handler and replaced with a client-only shell, so the browser looks correct while SSR is gone. Treat SSR output as a separate deliverable and verify it every time a rendered component changes.
When to Use
- A server-rendered component starts reading a new config or environment field.
- A page looks correct in a browser but the server HTML is only an empty shell.
- Adding a page, route, or interactive panel to a React SSR app.
- A share or file-upload panel must emit direct, HTML, and Markdown links.
- Adding SSR HTML regression coverage after a UI change.
Workflow
-
Map the render path before editing.
- Find the SSR entry (for example
worker/pages/index.ts,server/render.tsx, a Next server component, or a framework route). - Read the exact props or config object passed into the component tree.
- Find any
try/catcharoundrenderToString; that catch is where failures become an invisible CSR fallback.
- Find the SSR entry (for example
-
Add every render-time config read to the SSR config object.
- If a component starts reading
config.FIELD, addFIELDto the server-side config literal. Adding it only towrangler.toml,.env, or the client bundle is not enough. - Search the frontend for
config\.[A-Z_]+after adding a field. - A missing field usually throws inside
.trim(),Number(), or destructuring, not at the type checker. - Keep SSR and client values identical. A dev server that injects
localhostwhile the client bundle was built with a public URL produces wrong links and API calls after hydration.
- If a component starts reading
-
Prove SSR with a browser-like request.
curl -s -H 'User-Agent: Mozilla/5.0' http://localhost:PORT/ | grep -F '<new heading>'- Many apps serve markdown or JSON to curl; a browser UA is required for the HTML path.
- A screenshot is not proof: CSR fallback renders the same UI.
- Add a regression test asserting the HTML contains
<div id="root">and a stable component marker. - React inserts
<!-- -->between adjacent JSX text nodes. Assert a substring such as256 MB, not the joined sentence256 MB per upload.
-
Build in dependency order.
- Build the client bundle before worker or SSR tests that read an SSR manifest.
- Run typecheck, lint, tests, client build, and server/deploy dry-run as separate gates. A passing client build does not prove the SSR render runs.
-
Verify the client-only path separately.
- SSR proof does not exercise upload, form, or API interactions.
- For a local app tested through a Docker-hosted browser, load the
browser-qaskill and itslocal-dev-containerized-browserreference. - For MSW + jsdom multipart XHR hangs, see
references/msw-jsdom-multipart.md.
References
references/msw-jsdom-multipart.md- forcing the fetch path when MSW XHR multipart responses never dispatchload.references/share-link-formats.md- content-kind detection and the direct/HTML/Markdown embed matrix.browser-qaskill,local-dev-containerized-browserreference - page and API access plus file-upload simulation through a Docker-hosted browser.
Pitfalls
- Silent CSR fallback: the handler catches the SSR error and returns a valid 200 shell. Only an HTML assertion detects it.
- Narrow SSR config: SSR entries often pass a hand-built subset of the runtime env. Every new UI field must be added there.
- Build-time client config: client values are baked at build time, server values are read at request time. Rebuild after changing a deploy URL or
define. - Exact SSR text assertions: React comments split interpolated text. Use
toContainon a stable fragment. - Test timeout masking: keep
waitForbelow the test timeout so failures name the missing element instead of timing out the test.
Verification checklist
- [ ] Every new
config.*read exists in the SSR config object - [ ] Browser-UA curl shows the new marker in server HTML
- [ ] SSR regression test passes
- [ ] Client bundle built before SSR/worker tests
- [ ] Real browser exercised the client-only interaction
04 同仓库更多 Skills
web-retrieval-resilience
Web tools fail or search rules break: repair or fall back.
blocked-page-recovery
Use when a fetch fails: 403/429, paywall, WAF, bot wall.
verification-loop
Run a six-phase verification of a Claude Code session's work — build, type check, lint, tests with coverage, security grep, and diff review — then produce a PASS/FAIL verification report. Use when verifying work after completing a feature or refactor, before creating a PR, or when quality gates must pass.
unreal-world-builder
开放世界与环境专家——精通 UE5 World Partition、Landscape、程序化植被、HLOD 和大规模关卡流式加载,打造无缝开放世界体验
unreal-technical-artist
Unreal Engine 视觉管线专家——精通材质编辑器、Niagara 特效、程序化内容生成和 UE5 项目的美术到引擎管线
unreal-systems-engineer
性能与混合架构专家——精通 C++/Blueprint 边界、Nanite 几何体、Lumen GI 和 Gameplay Ability System,面向 AAA 级 Unreal Engine 项目