Repository navigation
feat(html): pages/SSG/ISR slice — page() shell + IsrPage (issue #14) - #91
Merged
Merged
Conversation
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…scades to SC2013 on @chttp/router
Deploying chttpjs with
|
| Latest commit: |
b299475
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9b110c6d.chttpjs.pages.dev |
| Branch Preview URL: | https://devin-issue14-ssr-slice.chttpjs.pages.dev |
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.
Summary
Reviewable slice of #14 (M3: component framework server side — pages, SSG, ISR), on top of
@chttp/htmlinside the scriptc subset.Rendering surface (
packages/html/src/index.ts):page(head, body)— full-document shell:<!doctype html>+<html><head>+<body>. Args are markup (same contract ash()children).IsrPage(render, revalidateSeconds)— TTL-cached document.html()serves the cached string and re-renders lazily on the first read after the window (Date.now());freshUntil()exposes the expiry. Revalidation is synchronous (Next.js blocking-fallback semantics) — there is no background refresh inside the subset.Example
examples/pages(workspace member): a tiny blog —/is rendered once at startup (SSG),/post/:slugkeeps oneIsrPageper slug, unknown slugs get a 404 document. node:test e2e over real HTTP covers all three routes plus the revalidate boundary.Tests/gates:
test/page.test.js(6 cases);bench/apps/chttp-html.tsexercises both new exports —bash scripts/scriptc-gate.shstays 100% on all 10 gates;pnpm --filter @chttp/html test24/24,pnpm --filter chttp-example-pages test3/3, oxlint + oxfmt clean.Docs:
docs/html.mdgains a "Pages, SSG and ISR" section with the honest limits; plan file at.agents/plans/2026-10-19-issue14-pages.md.Remaining surface (not in this PR)
Per-request data loading (
loadfns), nested layouts, streaming SSR, islands/hydration, build-time prerender handing off to@chttp/static, SWR-style background revalidate, a metadata/HEAD model beyond a raw head string, and the planned unplugin JSX→h/htmllowering. Still upstream-gated for real framework adapters (fetch globals remainnot-implementedin scriptc — see #15).Link to Devin session: https://app.devin.ai/sessions/adf384ec8d3949c083b34bd738357082
Open in Devin Desktop: https://app.devin.ai/desktop/session/adf384ec8d3949c083b34bd738357082?variant=devin
Requested by: @espetro