Skip to content

Fix duplicate HTMX component parameters#909

Open
erikgaas wants to merge 1 commit into
mainfrom
agent/duplicate-hx-attrs
Open

Fix duplicate HTMX component parameters#909
erikgaas wants to merge 1 commit into
mainfrom
agent/duplicate-hx-attrs

Conversation

@erikgaas

@erikgaas erikgaas commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove duplicate indicator and replace_url entries from hx_attrs.
  • Add a notebook test requiring the exported attribute list to contain unique names.
  • Regenerate components.pyi without duplicate parameters.

Why

tools/mk_pyi.py expands hx_attrs directly into every component signature. Duplicate list entries therefore generate duplicate hx_indicator and hx_replace_url parameters, which makes the stub invalid for mypy.

Runtime component signatures already deduplicate these names, so this change does not alter rendered HTML or supported arguments.

Fixes #908.
Fixes #529.

Checks

  • nbdev-test --path nbs/api/01_components.ipynb
  • Parsed fasthtml/components.pyi with ast.parse
  • Confirmed no generated signature repeats hx_indicator or hx_replace_url
  • Confirmed a fresh interpreter still renders both attributes correctly

@erikgaas
erikgaas marked this pull request as ready for review July 20, 2026 23:50
@erikgaas erikgaas added the bug Something isn't working label Jul 20, 2026
@erikgaas
erikgaas requested a review from jph00 July 20, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Duplicate parameter "hx_indicator" in function definition in fasthtml/components.pyi [BUG] Duplicated attributes in components.pyi

1 participant