Skip to content

Comments

Rendering APIs with HTMX guide + doc improvements + FastHX upgrade#3

Merged
volfpeter merged 6 commits intomainfrom
feat/example-rendering-api-with-htmx
Sep 26, 2025
Merged

Rendering APIs with HTMX guide + doc improvements + FastHX upgrade#3
volfpeter merged 6 commits intomainfrom
feat/example-rendering-api-with-htmx

Conversation

@volfpeter
Copy link
Owner

@volfpeter volfpeter commented Sep 26, 2025

Summary by CodeRabbit

  • New Features
    • Updated feature list to highlight JSX-like syntax, async UI, and HTMX support.
  • Documentation
    • Added “Rendering APIs with HTMX” guide.
    • Reorganized navigation into a Guides section.
    • Clarified Quick Start and index content; removed the “no APIRouter prefix” guideline.
  • Examples
    • Added a full HTMX rendering example (layout, pages, API) with README.
  • Chores
    • Bumped package version to 0.2.0.
    • Updated dependency to fasthx >= 3.0.0.
    • Adjusted typing configuration exclusions.

@coderabbitai
Copy link

coderabbitai bot commented Sep 26, 2025

Walkthrough

Introduces 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

Cohort / File(s) Change Summary
Docs — Features, Guides, Navigation
README.md, docs/index.md, docs/quick-start-guide.md, docs/application-components.md, docs/rendering-apis-with-htmx.md, mkdocs.yml
Added JSX-like/async/HTMX notes; reworked Examples to reference a new “Rendering APIs with HTMX” guide; added the new guide; removed the “no prefix on APIRouter” guideline; minor copy tweaks; reorganized MkDocs nav into a Guides group.
Examples — Rendering APIs with HTMX
examples/rendering-apis-with-htmx/README.md, examples/rendering-apis-with-htmx/main.py, examples/rendering-apis-with-htmx/layout.py, examples/rendering-apis-with-htmx/page.py, examples/rendering-apis-with-htmx/about/page.py, examples/rendering-apis-with-htmx/api.py
New example app demonstrating HTMX integration: app bootstrap, layout with PicoCSS and HTMX, home/about pages using htmy components and hx_ attributes, and an APIRouter-based rendering API endpoint /welcome-message.
Versioning & Tooling
holm/__init__.py, pyproject.toml
Bumped package version to 0.2.0; upgraded dependency fasthx to >=3.0.0; added mypy excludes for examples/minimal and examples/quick-start-guide.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I thump my paws—release 0.2’s here,
With HTMX sparks and pages crisp and clear.
A welcome blip that swaps with gentle grace,
Boosted links hop fast from place to place.
Docs realign, the guides now brightly glow—
I nibble carrots, watch the features grow. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly summarizes the key changes by highlighting the new HTMX rendering guide, accompanying documentation improvements, and the FastHX dependency upgrade, which directly correspond to the main content of the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/example-rendering-api-with-htmx

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
�[1mCause:�[0m Failed to load configuration /ruff.toml
�[1mCause:�[0m Failed to parse /ruff.toml
�[1mCause:�[0m TOML parse error at line 26, column 3
|
26 | "RSE100", # Use of assert detected
| ^^^^^^^^
Unknown rule selector: RSE100

examples/rendering-apis-with-htmx/api.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to load configuration /ruff.toml
�[1mCause:�[0m Failed to parse /ruff.toml
�[1mCause:�[0m TOML parse error at line 26, column 3
|
26 | "RSE100", # Use of assert detected
| ^^^^^^^^
Unknown rule selector: RSE100

examples/rendering-apis-with-htmx/layout.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to load configuration /ruff.toml
�[1mCause:�[0m Failed to parse /ruff.toml
�[1mCause:�[0m TOML parse error at line 26, column 3
|
26 | "RSE100", # Use of assert detected
| ^^^^^^^^
Unknown rule selector: RSE100

  • 3 others

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 61c3bd5 and 9b9abf6.

📒 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.get wraps @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-message route 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 scope

The 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 good

Instantiating App() at module scope follows the documented discovery rules, so this entry point will behave as expected. 👍

pyproject.toml (2)

33-33: Targeted mypy exclusions

Limiting 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 check

and confirm everything passes under fasthx>=3.0.0.

mkdocs.yml (1)

47-49: Guides regrouping improves navigation

Moving 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 well

The new bullets accurately highlight the HTMX and async capabilities added in this release. 👍


75-78: Example guidance now covers HTMX rendering

Pointing 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 source

Linking directly to the repository example makes it easier for readers to follow along. Nice touch.


153-160: Run instructions clarify both entry points

The tweaked phrasing for uvicorn vs. FastAPI CLI keeps the guidance concise and precise. 👍

docs/index.md (2)

9-12: Accurate emphasis on async & HTMX features

Highlighting 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 guide

The additional HTMX guide reference complements the quick start and helps readers find the right material. ✅

@volfpeter volfpeter merged commit a3db636 into main Sep 26, 2025
3 checks passed
@volfpeter volfpeter deleted the feat/example-rendering-api-with-htmx branch September 26, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant