I don't know, every time I see people sneaking html into Python feels weird and wrong to me...
Ludic: New framework for Python with seamless Htmx support
71–80 of 107 posts
Re: Ludic: New framework for Python with seamless Htmx support
#72Earlier 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…
Re: Ludic: New framework for Python with seamless Htmx support
#73Whats wrong with just writing HTML f-strings and using flask tho?
Re: Ludic: New framework for Python with seamless Htmx support
#74I 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…
Re: Ludic: New framework for Python with seamless Htmx support
#75Nice 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…
Re: Ludic: New framework for Python with seamless Htmx support
#76Earlier 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.
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
#77Can it be used to make static html?
Re: Ludic: New framework for Python with seamless Htmx support
#78Earlier 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.
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
#79At work, we have been exploring alternatives to templates in our Django project and just released it as a lib to help with this:
Re: Ludic: New framework for Python with seamless Htmx support
#80I 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…