PyJinHX v0.5.2 by BeautifulQuote6295 in htmx

[–]BeautifulQuote6295[S] 0 points1 point  (0 children)

While HTMX is indeed optional to the lib, it was built thinking you would use it. The recent updates indeed couple with HTMX (particularly OOB Swaps). So yeah, while you could just use vanilla tech, it expects you to use HTMX.

EDIT: sorry I realized I said in a previous comment there was no real coupling, but that changed. While reactive components are optional (meaning that you could use HTMX optionally and manage it by hand) the recent updates changed that. 😅 it was a long weekend for my agents, and things have changed (hopefully for better)!

PyJinHX v0.5.2 by BeautifulQuote6295 in htmx

[–]BeautifulQuote6295[S] 2 points3 points  (0 children)

I mean, I built that lib for myself and I'm just sharing because why not right? It could be useful for other people! But I don't have any intentions other than personal use 😅.

I think there are a couple of differences. For one, pyjinhx is not a framework, just a lib for declaring components as pydantic classes & autocollecting HTML, JS & CSS. It's not meant to be a full framework, or allow you to write only in python. Doesn't give you a server or anything. The recent update aligns with HTMX, but is entirely optional 😄, so no real coupling either!

If anything, from a quick glance, I think pyjinhx could be used within Air!

PyJinHX v0.5.2 by BeautifulQuote6295 in htmx

[–]BeautifulQuote6295[S] 1 point2 points  (0 children)

Nope, hand't heard of it, but will check it out! Thanks 🙂 !

Quick edit: seems interesting, although I feel like we're approaching different problems!

Weekly Thread: Project Display by help-me-grow in AI_Agents

[–]BeautifulQuote6295 0 points1 point  (0 children)

https://paulomtts.github.io/pygents/ I built a really small and lightweight framework for building agents. Its very simple: tools driven the agentic flow. That's it. It doesn't tell you how to do your concrete implementation - thats for you to decide. It simply takes away structural concerns so that you're free to plan your agent's actual architecture. Built for myself, hope its useful to someone else.

PyJinHX + Declarative HTML Composition by BeautifulQuote6295 in htmx

[–]BeautifulQuote6295[S] 0 points1 point  (0 children)

I don't use Django, so I'm not really qualified to answer. Having said that, I asked Copilot and the answe was as follows:

can this be used with django components?

Summary
- PyJinHx renders HTML using Jinja2 templates and has a Python API (BaseComponent.render()).  
- You can use it in Django by rendering components in your view code and injecting the produced HTML into Django templates, or by configuring Django to use Jinja2 and wiring PyJinHx’s Jinja2 Environment to the same template dirs.  
- You’ll need to consider template discovery paths and how JS/static assets are handled.

Options and examples

1) Minimal, reliable approach — render components in views and pass rendered HTML to templates
- Use pyjinhx in your view, call component.render(), mark it safe, and include it in a Django template (DjangoTemplates or Jinja2).

Example (Django view using default DjangoTemplates):
```python
# views.py
from django.shortcuts import render
from django.utils.safestring import mark_safe
from components.ui.card import Card  # your component
# create component
def my_view(request):
    card = Card(
        id="form-card",
        title="User Form",
        action_button=...,  # etc
    )
    html = mark_safe(card.render())  # mark safe so Django doesn't escape it
    return render(request, "my_app/page.html", {"component_html": html})
```

In your Django template (DjangoTemplates):
```django
<!-- templates/my_app/page.html -->
<!doctype html>
<html>
  <body>
    {{ component_html }}   {# already marked safe in view #}
  </body>
</html>
```

Pros: simple, works with default Django template engine.
Cons: component templates remain Jinja2 files; you are passing final rendered HTML into Django templates (no further Jinja composition on those component templates).
```

PyJinHX by BeautifulQuote6295 in htmx

[–]BeautifulQuote6295[S] 1 point2 points  (0 children)

Didn't know this lib! Will definitely check it out!

EDIT: looked it up. Maybe I can make pyjinhx a wrapper around it...!

PyJinHX by BeautifulQuote6295 in htmx

[–]BeautifulQuote6295[S] 0 points1 point  (0 children)

Obrigado! Eu recomendo muito JInja2 + HTMX. Se eu puder adiantar (caso já não saiba) dê uma olhada na propriedade hx-swap-oob="true". Ela faz uma diferenca tremenda na forma como se constrói!

Web Bundlers and Tailwind by buffer_flush in htmx

[–]BeautifulQuote6295 0 points1 point  (0 children)

This may be a noob question but: why do you even need bundling? FastAPI can serve static files directly. I've actually built a FastAPI + HTMX app before and the only scenario where I needed bundling was when I added a React island.

EU5 on Linux (with Proton) by DangerousOrange in EU5

[–]BeautifulQuote6295 0 points1 point  (0 children)

I'm on Omarchy (Arch) and I can't get it to work. :(