docs(ssr): compatible SSR engines reference#143
Conversation
Documents the ssr.render stdin/stdout contract and lists compatible engines (golit recommended, lit-ssr-wasm as alternative). Includes comparison table, trade-offs, and guide for adding new engines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
zeroedin
left a comment
There was a problem hiding this comment.
Review: PR #143 — docs(ssr): compatible SSR engines reference
Scope: New file plans/SSR_ENGINES.md — 132 lines
What this is
Reference doc capturing the ssr.render stdin/stdout contract and listing two compatible engines (golit, lit-ssr-wasm) with config examples, trade-offs, and a guide for third-party engine authors.
Analysis
-
Contract section is clear and correct: stdin fragment in, DSD stdout out, exit 0/non-zero. Matches the per-instance model established in PR #135. The "Adding a new engine" section with expected input/output example is exactly what a third-party author needs.
-
Engine descriptions are honest about trade-offs:
- golit: recommended, fast cold start, but "own rendering implementation — not the official @lit-labs/ssr"
- lit-ssr-wasm: official Lit SSR fidelity, but ~350ms cold start per invocation, needs warm process mode
-
Comparison table is fair: Doesn't hide golit's conformance gap or lit-ssr-wasm's cold start cost.
-
Config examples match the spec: All YAML blocks use
ssr.render(not the oldssr.build), consistent with PR #135's spec rewrite. Theservesub-config with both HTTP and stdio protocol options matches PLAN.md. -
The ~35 second estimate is useful: 100 unique instances x 350ms cold start = 35s in one-shot mode. Makes a strong case for the
ssr.servewarm-process optimization without being preachy about it.
One note
The doc references zeroedin/golit#22 for competitive analysis. If that issue is public, great. If it's in a private repo, external contributors won't be able to follow the link. Not a blocker either way — the comparison table in this doc is self-contained.
Verdict
LGTM — useful reference doc that captures engine-agnostic design knowledge. Correctly reflects the current spec, doesn't duplicate PLAN.md content, and provides practical config examples.
|
Closing — the SSR spec was simplified in #150 from per-instance stdin/stdout to per-page CLI invocation. The stdin/stdout contract, If we add lit-ssr-wasm support in the future, we can write a new reference doc that matches the actual contract at that time. |
Summary
plans/SSR_ENGINES.mddocumenting thessr.renderstdin/stdout contractContext
Came out of evaluating lit-ssr-wasm (Benny Powers) alongside golit. Alloy's per-instance render model is engine-agnostic by design — this doc captures that flexibility so the knowledge isn't lost.
🤖 Generated with Claude Code