fix(landing): prerender with workerd#264
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
onequery-landing | 0955ffe | Commit Preview URL Branch Preview URL |
May 31 2026, 05:43 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One-Line Summary
Landing now prerenders under Cloudflare workerd without losing generated Markdown sidecars used for SEO and GEO.
User-Facing Changes
prerenderEnvironment: "workerd".index.mdsidecars for static HTML pages instead of dropping most docs pages during workerd builds.Accept: text/markdownnegotiation working for collection index pages like/blog/.Why This Changed
The landing build previously relied on Node prerendering because the workerd prerender path hit Node builtin imports from the docs rendering stack. Enabling Cloudflare
nodejs_compatmakes that prerender path viable, but the workerd build exposed a separate integration issue: Astro build assets did not include every emitted HTML page, so the agent Markdown exporter only generated a small subset of sidecars.The local Markdown middleware also treated
/blog/as a blog content entry with an empty id, which causedgetEntry()to throw instead of falling back to HTML-derived Markdown.How It Changed
prerenderEnvironment: "workerd".nodejs_compatto the Wrangler compatibility flags so workerd can handle supported Node APIs used during prerendering.@onequery/astro-agent-markdownscan the emitted client directory for HTML files in addition to the Astro assets map.Bug Fixes
/blog/could return a Vite error overlay because the content middleware calledgetEntry()with an empty id; this now returns Markdown for the rendered index page.Extra Context / Decisions (Optional)
nodejs_compatis required because the prerender dependency graph includes supported Node builtin modules. The Markdown exporter now treats the final client output directory as the source of truth, which is more robust across Astro adapter runtime differences.Verification
rtk bunx turbo test --filter=@onequery/astro-agent-markdown --jsonrtk bun run buildrtk find dist/client -name "index.md" -type frtk bunx turbo typecheck --filter=@onequery/landing --filter=@onequery/astro-agent-markdown --jsonrtk bunx turbo typecheck --filter=@onequery/astro-agent-markdown --jsonrtk curl -H 'Accept: text/markdown' http://127.0.0.1:4546/blog/ -vrtk curl -s -D - -o /tmp/blog-markdown-response.md -H 'Accept: text/markdown' http://127.0.0.1:4546/blog/rtk bun run dev -- --port 4555plus direct/_image/fetch returned200 image/webprtk bun run formatlint-fullpassed with 0 warnings and 0 errorsVideo / Screenshot (Optional)