feat(rendering)!: Rewrite ssg pipeline#12
Merged
Merged
Conversation
BREAKING CHANGE: replaces empty-shell SSG with fully-rendered HTML pipeline.
All public routes now emit compiled Markdown + React component HTML at build
time instead of empty <div id="root"></div> shells.
Changes:
- New src/ssg/ module: RenderStrategy (interface), DefaultRenderStrategy,
RenderPipeline, RenderContext, RenderHooks, SsgOptions, TemplateOverrides
- RenderStrategy interface allows full pipeline replacement (DefaultRenderStrategy
renders React via renderToString with compiled Markdown props)
- Hook pipeline with five phases: beforeRender, transformMarkdown, transformHtml,
afterRender, onError — all typed, ordered, async, with error recovery
- Template system with built-in index.html.ejs + filesystem override convention
(flatwave-templates/ at project root)
- Markdown compiler (unified/remark/rehype) extracted to src/content/markdownCompiler.ts
with compileMarkdownToHtml(markdown, options?) for reuse
- Plugin option ssg: { enabled, strategy?, hooks?, template?, compileMarkdown? }
with sensible defaults
- Example app demonstrates transformMarkdown + transformHtml hooks
- Output HTML now contains: compiled Markdown inside <div id="root">, SEO tags,
analytics beacon injected via transformHtml hook
- Removed dead code: empty src/ssg/ dir, inline renderRouteHtml/renderSitemap/
renderRobotsTxt from index.ts, unused ContentMarkdownCompilerOptions alias,
unused RenderStrategy.ts file
- Fixed production bugs: nested <div id="root"> in error fallbacks, double
markdown compilation, transformHtml running on component output instead of
final document, component-not-found swallowing all content (now graceful
fallback to compiled markdown)
- Version bumped to 1.0.0 (was 0.1.0)
- All 82 OpenSpec tasks complete; npm run validate passes (format, lint,
type-check, build, 11 tests)
Contributor
|
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
BREAKING CHANGE: replaces empty-shell SSG with fully-rendered HTML pipeline. All public routes now emit compiled Markdown + React component HTML at build time instead of empty
shells.Changes: