From ecc37411e4ac91065b8a690e3fc20f95301443fb Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 20 Oct 2026 05:23:12 +0000 Subject: [PATCH 1/5] feat: store prerendered calls as the live answer, so server components prerender The integration now replays each captured call's GET address through the crawl (new PrerenderContext.fetch) and stores the endpoint's response, headers included, instead of encoding the returned value itself. The client keeps the runtime's own reference and answers the send from the artifact through a transport fetch (staticFetch), so hydration adoption, server-component interception and decoding stay the runtime's. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01NkjGmX4hAoiU9VhXNt7j3E --- .changeset/static-wire-answers.md | 14 ++ examples/ssg/package.json | 10 +- examples/ssg/src/data.ts | 2 +- packages/crawler/README.md | 3 + packages/crawler/src/crawl.ts | 10 +- packages/crawler/src/types.ts | 10 ++ packages/crawler/test/crawl.test.ts | 29 ++++ packages/solid/README.md | 29 +++- packages/solid/package.json | 8 +- packages/solid/src/client.ts | 157 +++++++++-------- packages/solid/src/integration.ts | 73 +++----- packages/solid/src/server.ts | 24 ++- packages/solid/src/shared.ts | 199 +++++++++++++++++++-- packages/solid/test/prerendered.test.ts | 80 +++++++-- packages/solid/test/shared.test.ts | 82 ++++++++- pnpm-lock.yaml | 218 ++++++++++++------------ 16 files changed, 669 insertions(+), 279 deletions(-) create mode 100644 .changeset/static-wire-answers.md diff --git a/.changeset/static-wire-answers.md b/.changeset/static-wire-answers.md new file mode 100644 index 0000000..09ff634 --- /dev/null +++ b/.changeset/static-wire-answers.md @@ -0,0 +1,14 @@ +--- +"@solidjs/prerender": minor +"prerender-crawler": minor +--- + +Prerendered calls now store the live answer, so server components can be prerendered. + +**`@solidjs/prerender`.** An artifact is now the response the app's own server-function endpoint gives for the call's GET address (status, headers and body), captured by replaying each call through the crawl after the pages render. Before, the integration encoded the returned value itself, which bypassed the server's result policies: a server component (`return props => `) was stored as an error, and client navigation to it crashed in both static and hybrid builds. + +On the client, `prerendered()` now returns the runtime's own GET reference and serves artifacts through a transport `fetch` (`staticFetch`, installed automatically in a prerendered build). Hydration adopts server-rendered reads and server components without a request, where it used to refetch them, and responses decode through the runtime's own pipeline. Artifacts are recognized by a marker line instead of status, so a host answering a missing artifact with a 200 page now falls back to the live server in hybrid mode instead of failing to parse. + +Breaking: artifacts are `_static/