Live data from Hacker News

Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

getludic.dev

11–20 of 39 posts

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#11

On a reasonably fast connection, I hit the increment button and it took almost two seconds for the counter to increment. Is it immediate for everyone?

Seems instant to me and when I checked in the Firefox debugger the network calls are taking between 30ms to 50ms to respond.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#12

On a reasonably fast connection, I hit the increment button and it took almost two seconds for the counter to increment. Is it immediate for everyone?

Same. I know this is unfair but it made me subconsciously write off the framework. OP, this is purely marketing feedback but try to make the button fast. Love the direction you're taking, good luck!

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#13

On a reasonably fast connection, I hit the increment button and it took almost two seconds for the counter to increment. Is it immediate for everyone?

Totally depends on your latency to the server and server response time. Please don’t throw away two decades of client side advancements and do this for state changes that should be entirely local, people with higher latency will hate your guts. Use alpine or something like that if you don’t want to go full react/vue/svelte/solid/etc. It’s utterly terrifying that I now see this pattern evangelized every day.

As an aside, I hate websites/apps sending HTML fragments like it’s 2005 because it’s much harder to pull data or automate things that way. But that’s usually considered an upside for developers who want to combat scraping. In practice it’s hardly a road bump for devoted scrapers, and actually increases server load for the same amount of data pulled, but it’s still considered a win by many.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#14
I love that someone is actively working on components in the python space. Coming back to python after years in the js ecosystem I've found templates really cumbersome to work with, especially not having type system support. I know there have been some attempts at JSX in python over the years but those projects all seem dead.

My advice to the OP, is to break out the component piece of the framework into a standalone lib that other frameworks can use. I think it'll be much easier to gain adoption that way.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#15
One thing I want to see eventually is Blazor for Python maybe with Django. I am using Blazor at a new job and it is impressive. If I change a type on the backend not only will other classes that rely on it squak if theres mismatches, but my frontend joins in on squaking at me as well! Really nice in all honesty.

The best part is you can use components like you would with React but you write all / most of your logic in C# in the case of something similar for Python I would expect the logic to all be Python even if it affects the DOM.

As an aside thats on topic, I was contenplating HTMX and Django for a project I was working on but I am still overengineering in my head. I have landed on maybe using Astro instead for all the frontend logic.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#16

On a reasonably fast connection, I hit the increment button and it took almost two seconds for the counter to increment. Is it immediate for everyone?

For me it takes around 200~300ms and occasionally ~800ms, not too long but enough to make it noticeable and feel weird.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#17

One thing I want to see eventually is Blazor for Python maybe with Django. I am using Blazor at a new job and it is impressive. If I change a type on the backend not only will other classes that rely on it squak if theres mismatches, but my frontend joins in on squaking at me as well! Really nice in all honesty. The best part is you can use components like you would with React but you write all / most of your logic i…

Wouldn't that be...the worst of both worlds? Django and Python are really slow. Blazor is not a paragon of performance, and this will make it worse by an order of magnitude.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#18
This looks fantastic! I love htmx, and I'ved used it with Lucid and Clay in Haskell to generate HTML apps entirely server side. I'd really like to use Ludic at some point as well.

The requirement of @override on the render method is a bit unwieldy, have you considered using pedantic's BaseModel instead of TypedDict? I think it would allow you to get rid of @override? Not sure it'd be worth it for the extra dep though.

Something I always look for in a web framework is the ability to run the app from the repl. Is this possible with Ludic? I remember in Clojure, the app was just a function of a hashmap request -> hashmap response, so testing was really easy, you just do something like (app my-request) and inspect the return value, 'my-request' can be a hashmap constructed by hand or generated with a tool like core.spec. Much more convenient than running uvicorn just for a quick test! I recommend adding this use case to Ludic if it's not already there.

Post reply on HN