feat: implement multiple entries support for multi-page SSG#54
Merged
Conversation
Add the `entries` option to `FunstackStaticOptions`, allowing a single project to produce multiple HTML pages at build time. Internally, both single-entry (`root`+`app`) and multi-entry (`entries`) configurations are unified into the same codepath via a synthesized `virtual:funstack/entries` module. Key changes: - New `EntryDefinition` type exported from `@funstack/static/entries` with flexible `root` (sync/async module) and `app` (module or ReactNode) fields, plus `AsyncIterable` support for streaming entry generation. - RSC entry rewritten to iterate over entries for both build and dev serving, with URL-path-to-filename matching for the dev server. - Build pipeline processes all entries sequentially, validates paths, detects duplicates, and shares the defer registry across entries. - Preview server updated to serve the correct HTML file by trying filename candidates on disk. - Unit tests for path validation and URL-to-filename mapping. - E2E fixture and tests for multi-entry builds. https://claude.ai/code/session_01JFnP2BbX1Bpw6ZLougzt9R
The build output tests were checking for page content in raw HTML, but with ssr: false (default) the app content renders client-side only. Changed assertions to verify HTML structure (markers, RSC payload links) instead, matching the pattern used by single-entry build tests. https://claude.ai/code/session_01JFnP2BbX1Bpw6ZLougzt9R
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.
Add the
entriesoption toFunstackStaticOptions, allowing a singleproject to produce multiple HTML pages at build time. Internally, both
single-entry (
root+app) and multi-entry (entries) configurationsare unified into the same codepath via a synthesized
virtual:funstack/entriesmodule.Key changes:
EntryDefinitiontype exported from@funstack/static/entrieswith flexible
root(sync/async module) andapp(module orReactNode) fields, plus
AsyncIterablesupport for streaming entrygeneration.
serving, with URL-path-to-filename matching for the dev server.
detects duplicates, and shares the defer registry across entries.
filename candidates on disk.
https://claude.ai/code/session_01JFnP2BbX1Bpw6ZLougzt9R