Rendering APIs with HTMX guide + doc improvements + FastHX upgrade#3
Rendering APIs with HTMX guide + doc improvements + FastHX upgrade#3
Conversation
application examples in the repo
WalkthroughIntroduces a new “Rendering APIs with HTMX” guide and example app, updates feature lists and examples in docs, removes a router-prefix guideline, reorganizes docs navigation, bumps fasthx to >=3.0.0, updates package version to 0.2.0, and adjusts mypy excludes. No exported/public API changes besides version. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User (Browser)
participant H as HTMX (client)
participant W as Web App (FastAPI + holm)
participant R as Router (/welcome-message)
participant C as htmy Component
U->>W: GET / (initial page)
W-->>U: HTML (layout, hx_boost nav, hx_get H1)
Note over U,H: HTMX enhances links (hx_boost) and elements
rect rgba(200,230,255,0.25)
Note right of H: Periodic update
H->>R: GET /welcome-message (hx_get, hx_trigger every 2s)
R->>C: Render welcome message component
C-->>R: HTML fragment
R-->>H: 200 OK (fragment)
H-->>U: Swap content in H1
end
opt Navigation
U->>H: Click nav link
H->>W: GET /about (boosted)
W-->>H: HTML fragment/page
H-->>U: Update main content
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Ruff (0.13.1)examples/rendering-apis-with-htmx/about/page.py�[1;31mruff failed�[0m examples/rendering-apis-with-htmx/api.py�[1;31mruff failed�[0m examples/rendering-apis-with-htmx/layout.py�[1;31mruff failed�[0m
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 10
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (14)
README.md(2 hunks)docs/application-components.md(0 hunks)docs/index.md(2 hunks)docs/quick-start-guide.md(2 hunks)docs/rendering-apis-with-htmx.md(1 hunks)examples/rendering-apis-with-htmx/README.md(1 hunks)examples/rendering-apis-with-htmx/about/page.py(1 hunks)examples/rendering-apis-with-htmx/api.py(1 hunks)examples/rendering-apis-with-htmx/layout.py(1 hunks)examples/rendering-apis-with-htmx/main.py(1 hunks)examples/rendering-apis-with-htmx/page.py(1 hunks)holm/__init__.py(1 hunks)mkdocs.yml(1 hunks)pyproject.toml(2 hunks)
💤 Files with no reviewable changes (1)
- docs/application-components.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/rendering-apis-with-htmx.md
75-75: Link text should be descriptive
(MD059, descriptive-link-text)
🔇 Additional comments (14)
examples/rendering-apis-with-htmx/api.py (1)
16-25: HTMX rendering route and decorator ordering look correct.Decorator stacking is right (
@api.getwraps@htmy.hx()), and the endpoint is minimal and clear.examples/rendering-apis-with-htmx/page.py (1)
7-26: Home page composition is clean and wires HTMX correctly.Attributes target the
/welcome-messageroute properly, and content structure is clear.examples/rendering-apis-with-htmx/about/page.py (1)
4-12: Dynamic metadata reads well and returns a precise type.No issues.
holm/__init__.py (1)
1-1: Version bump aligned with release scopeThe 0.2.0 bump matches the feature and documentation additions in this PR. LGTM.
examples/rendering-apis-with-htmx/main.py (1)
1-3: Example app bootstrap looks goodInstantiating
App()at module scope follows the documented discovery rules, so this entry point will behave as expected. 👍pyproject.toml (2)
33-33: Targeted mypy exclusionsLimiting the excludes to the example directories keeps the main package under strict typing. Looks solid.
9-9: Double-check fasthx 3.x compatibility before merging
Upgrading to a new major release can introduce breaking changes. Rerun the standard checks and tests with:poe checkand confirm everything passes under
fasthx>=3.0.0.mkdocs.yml (1)
47-49: Guides regrouping improves navigationMoving the quick-start and new HTMX guide under a dedicated “Guides” section makes the docs hierarchy clearer. Nice cleanup.
README.md (2)
18-22: Feature summary updates read wellThe new bullets accurately highlight the HTMX and async capabilities added in this release. 👍
75-78: Example guidance now covers HTMX renderingPointing readers to both the quick start and the new HTMX guide improves the onboarding flow. Looks great.
docs/quick-start-guide.md (2)
13-13: Helpful pointer to the example sourceLinking directly to the repository example makes it easier for readers to follow along. Nice touch.
153-160: Run instructions clarify both entry pointsThe tweaked phrasing for
uvicornvs. FastAPI CLI keeps the guidance concise and precise. 👍docs/index.md (2)
9-12: Accurate emphasis on async & HTMX featuresHighlighting async components, FastHX, and mixed JSON/HTML support aligns the landing page with the current capabilities. Looks good.
66-68: Examples section now reflects the new guideThe additional HTMX guide reference complements the quick start and helps readers find the right material. ✅
Summary by CodeRabbit