Repository navigation
refactor: share Next.js rendering for fragments and websites - #717
Merged
Merged
Conversation
abernier
force-pushed
the
codex/next-fragment-rendering
branch
from
October 13, 2026 15:39
4391731 to
188a92f
Compare
abernier
added this pull request to stack #719
October 13, 2026 16:09
abernier
marked this pull request as ready for review
October 13, 2026 16:17
Merged
This branch was successfully deployed
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
HTML fragments currently render through a separate React renderer bundled into the CLI, with esbuild handling consumer configuration, CSS, and images. Build fragments and websites through the same Next.js static-export pipeline, then extract document HTML for fragment output.
Preserve stdin/file/folder inputs, HTML-only stdout, titles, static Mermaid and Sandpack representations, referenced assets, and consumer configuration with scope values and server/client components. Next logs go to stderr, and each build uses a temporary application directory removed on completion. Relative references remain anchored to the original fragment source. esbuild is now a development dependency used only to package the CLI.
Rendering even one fragment now incurs a full Next build. Includes documentation and a patch changeset. Folder fragments reuse the compiled corpus within each export worker; website search retains the complete document index.
This branch is ported directly onto current
main, preserving current configuration loading, version options, Markdown exports, and favicon handling. It has no dependency onfeat/cli-dev.Validation
pnpm run LGTMonca7f14b9: typecheck, lint/format, registry validation, 664 passing unit/integration tests (4 skipped), and all 118 Playwright tests passed.VersionSwitcher.tsxremains; no lint errors.Pre-merge review
Fixed responsive imported images (
img[srcset]andsource[srcset]) so every candidate remains usable after temporary Next assets are removed. Preserve descriptors and external/data URLs. Reuse folder compilation per export worker, avoiding quadratic metadata/MDX collection across pages while preserving rich Entries and CodeSandbox data. Both fixes include regressions demonstrated failing before the changes.