Add internals architecture documentation page - #194
Merged
berendkleinhaneveld merged 1 commit intoJul 13, 2026
Conversation
Add an Internals > Architecture page modelled after observ's architecture docs, explaining how the SFC compiler, Fragments, Renderers and observ cooperate. Focuses on the Fragment/element relationship, the template vs render tree distinction, mounting/anchors, reactive updates and the fragment lifecycle, with Mermaid diagrams as visual representations. Enable Mermaid rendering via a pymdownx.superfences custom fence and add the Internals section to the nav. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UttpCd1K8B8kpbqqMtUMVE
berendkleinhaneveld
deleted the
claude/collagraph-architecture-docs-iv22tu
branch
July 13, 2026 07:23
Merged
berendkleinhaneveld
added a commit
that referenced
this pull request
Jul 21, 2026
Features: - Add pure-Python view API as alternative to cgx templates (#193) - Support text elements for PySide widgets that display text (#191) Fixes & internals: - Fragment parenting overhaul (#162) - Fix PyInstaller hook for CGX files inside packages (#184) - Write compiled AST to temp file when CGX_DEBUG is set (#175) Performance: - Speed up mount path: cheap arity check, reuse first(), leaner emit (#186) - Cache Fragment._component_parent() lookups (#187) - Avoid redundant anchor lookups in Fragment.anchor() and unkeyed v-for (#188) Documentation: - Add MkDocs documentation with GitHub Pages deployment (#176) - Add internals architecture documentation page (#194) - Add docs badge and links to README (#192) Tooling & CI: - Add benchmark suite and per-PR benchmark CI workflow (#185) - Make benchmark CI guard robust against run-to-run noise (#196) - Update GitHub actions from Node 20 to Node 24 (#190) - Migrate from pre-commit to prek (#195) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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
Adds an Internals → Architecture page to the docs, modelled after observ's architecture page. It explains how Collagraph's internals fit together and — as specifically requested — gives a visual representation of how elements and fragments relate to each other.
The page centres on the Fragment/element relationship and covers:
Fragment,ControlFlowFragment,ListFragment,ComponentFragment,SlotFragment,DynamicFragment)template_children/render_children()/iter_all_children())render()output for a counter and av-forlistfirst()create/mount/unmount(destroy=…))The prose is grounded in the actual source — the compiled snippets and the directive/fragment tables were produced by compiling real
.cgxexamples, so they match what the compiler emits.Visuals
Nine Mermaid diagrams serve as the visual representation, including the big-picture flow, a fragments-vs-elements diagram, the fragment class hierarchy, template-vs-render tree, the template→fragment mapping, the mount sequence, the reactive update flow, and a lifecycle state diagram.
Changes
docs/internals/architecture.md— new pagemkdocs.yml— add apymdownx.superfencescustom fence so Material renders Mermaid diagrams, and add theInternals: Architecturenav sectionVerification
mkdocs build --strictpassesclass="mermaid"in the built HTML and the nav link appears🤖 Generated with Claude Code
Generated by Claude Code