Live data from Hacker News

Ludic: New framework for Python with seamless Htmx support

github.com

71–80 of 107 posts

Re: Ludic: New framework for Python with seamless Htmx support

#72

Earlier quoted context omitted.

I think those are all good points, but do cringe a little at the idea that "to add your own JavaScript you'll want React". Seems like a lot to bring in if you're really just wanting to add some JavaScript.

Ha, fair point. I don't mean so much that for any JS you'd want to bring in React, but more that something like that will likely be needed to manage a codebase of any scale. My context here is a mostly server-side application using HTMX, where I wanted to add a few small bits of additional client-side code. I tried to do it without any libraries but rapidly realised that Jquery would simplify things a lot, and manage…

Believe it is recommended to use Alpine.js rather than huge js frameworks. Not sure about its difference with jquery.

Re: Ludic: New framework for Python with seamless Htmx support

#74
post #4

I don't know, every time I see people sneaking html into Python feels weird and wrong to me...

Until you try it out and realize the benefits! - Type safe HTML: you get an exception instead of malformed HTML - Truly reusable components: any Python web framework, component packages are truly reusable in any other projects. I never seen this with template engines. - Huge productivity boost: not even close! No hunting for templates, no jumping between files, everything is in Python functions. - Composable elements…

Yes, I quite like the idea of being able to run pyflakes/flake8/black/pytest/mypy over my "html templates", and benefiting from all the power that entails.

Re: Ludic: New framework for Python with seamless Htmx support

#75

Nice release! This looks good, docs look really nice too. I'd use HTMX anywhere I can to improve a basic HTML site. One word of warning for people considering HTMX though – it's not a framework, it's an appliance. In my experience with it, I ran into problems integrating with HTMX very quickly. Drop it into your project, use the HTML attributes, and it'll be great. However if you need custom Javascript, HTMX provides…

True, I can recommend hotwire turbo as an alternate similar to htmx, it has a js framework called Stimulus that integrates nicely for those instances where you need some custom interactivity.

Re: Ludic: New framework for Python with seamless Htmx support

#76
post #58

Earlier quoted context omitted.

I think it is somewhat similar to React, for example, you can create a Link component like you can see in the README.md Now you can use it in f-strings, and well, other components. The idea from the beginning was to integrate it with htmx.org, so to me, it feels kind of similar when you are writing endpoints using these "components". But I understand why you are raising this question, I also didn't know how to name i…

FWIW, my reaction to the Link example was pretty much "Why do I have to build this, why isn't such a basic thing that any project would want not batteries-included?". Not the greatest first impression.

But `a` is included. You don't have to build a `Link` component. If you want to stylize your links in consistently across your page, you can build your own Link.

The example does nothing other than renaming `href` to `to` and adding a style.

How should the framework know which styles you want to apply to a link?

I think the example explains the component-driven design of the library well.

Re: Ludic: New framework for Python with seamless Htmx support

#78
post #58

Earlier quoted context omitted.

FWIW, my reaction to the Link example was pretty much "Why do I have to build this, why isn't such a basic thing that any project would want not batteries-included?". Not the greatest first impression.

But `a` is included. You don't have to build a `Link` component. If you want to stylize your links in consistently across your page, you can build your own Link. The example does nothing other than renaming `href` to `to` and adding a style. How should the framework know which styles you want to apply to a link? I think the example explains the component-driven design of the library well.

How would you feel if the first example in, say, a ruby tutorial, was how to redefine the ‘+’ operator to use a different symbol?

It’s somewhere between pointless and confusing to me, and isn’t illustrative of why one would want to use components, or what a competent even is.

Re: Ludic: New framework for Python with seamless Htmx support

#80
post #13

I wrote a library a little while ago which is intended to be the simplest possible expression of this idea: https://github.com/j4mie/hotmetal/ The core implementation is only 85 lines of Python, and has no imports at all, so works nicely on minimal/alternative Pythons like Micropython. I'm using it on a medium-sized side project and it's shockingly productive compared to string templates. I don't think anyone is usin…

[deleted]
Post reply on HN