volfpeter 15 hours ago

You're right, fetching all the data (that you may or may not need during rendering) in advance is of course doable and quite common. That's what you do for example with tools like Jinja. That may or may not work well for your use-case.

htmy does not force you to put data fetching or anything else into components (you can still have dumb components). It also doesn't force you to write async components. The most important thing it does is it gives you the option to build your application entirely in Python (no ugly custom templating language syntax with lack of static analysis or proper IDE support) and enables the use of modern async tools.

And admittedly, the lib was built with FastAPI and HTMX in mind, which kind of necessitates async support...

1
anentropic 3 hours ago

My comment was just thinking out loud really...

It seems like if you're not doing data fetching in the component then there's no need for it to be async.

And then I was wondering if maybe data fetching in components was a good pattern. It's quite different from what I'm used to doing.