Skip to content

Links to htmx components relevant stuff

Hanne Moa edited this page May 8, 2024 · 13 revisions

Fragment handlers

Only handles templates

  • django-template-partials
    • No javascript
    • Does not add syntax
    • Good thing: Two tags, "partial" and "partialdef", does not pollute templatetag namespace further
    • Partials can be reused by include
    • A partial can be repeated
    • Defined inline and at the start
  • django-render-block
    • No javascript
    • Does not add syntax
    • Need to update every view because using new function to render
    • A block can not be repeated
    • Defined inline
  • Slippers
    • No javascript
    • Adds syntax
    • Adds dynamic templatetags
    • Bad thing: pollutes namespace, can clash with existing tags
    • Bad thing: configured via yaml
  • django-web-components
    • No javascript
    • Adds syntax
    • Adds dynamic templatetags
    • Template in separate file by default, can be incorporated directly via render-method
    • Bad thing: pollutes namespace, can clash with existing tags

Component frameworks

Bundles staticfiles with an actual component

  • django-components

    • No javascript
    • Does not live inside apps
    • Puts every component thing into the same folder
    • Bad thing: Needs its own staticfiles-finder in order to not treat templates as static files
    • Good thing: One tag "component", does not pollute templatetag namespace
    • Can have everything in a single file, in Python
    • Needs updates to STATICFILES_DIRS

    Possibly incompatible with theming since staticfiles/templates cannot be overridden

  • Tetra

    • Javascript
    • Puts every component thing into a python class. While it is possible to also import from files this is not the documented, preferred way.
    • Deeply dependent on alpine.js
    • Rewrites DOM
    • Slow

Examples, patterns, tips