Show HN: Web Development with Htmx, Type-Guided Components, Pure Python (getludic.dev)
I'm looking for feedback for the documentation I was building:
This documentation showcases the range of features the framework offers, providing a comprehensive overview of its capabilities.
I would also appreciate if you checked the layouts section and tell me what you think:
* https://getludic.dev/catalog/layouts
Additionally, I've developed a convenient cookiecutter template:
* https://github.com/paveldedik/ludic-template
I eagerly await your feedback and insights as you explore these resources.
I believe Ludic can be expecialy good for personal blogs, project websites, in-browser slides, while using htmx.org properties to add interactivity.
Since my last update on Ludic, I've concentrated on the following areas:
* Building comprehensive documentation with Ludic to showcase its capabilities * Enhancing the UI components catalog * Crafting Layout Components inspired by the Every Layout Book * Introducing support for Themes
Future plans for Ludic include:
* Enhancing HTMX support with compatibility for HTMX 2.0 * Implementing speed improvements through caching * Expanding the features in the catalog * Improving typing support * Exploring the creation of a cookiecutter template for generating Ludic-powered slides
38 comments
[ 33.6 ms ] story [ 1199 ms ] threadThe initial button example might be a good one to build on. You could show how to persist the counter value in SQLite.
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.
What you see as a "terrifying" disregard for "two decades of advancements", others see as a liberating departure from two decades of unnecessary bloat. It's healthy to have more than one strategy available for building web applications.
Is moving the bloat to a blackbox in the backend really a better approach? Why not just not create a bloated frontend?
And I have a strong suspicion for many the beloved hammer is big complex client-side JS framework.
https://htmx.org/essays/hypermedia-friendly-scripting/
https://hypermedia.systems/client-side-scripting/
Additionally, while not htmx, in the adjacent land of LiveView, client side scripting is a bitch. I built a complex application in LiveView two years ago and later regretted it. Hard to resolve client side state and server side state diverging with complex but local state changes, and complex local changes are made more difficult than good old imperative jQuery thanks to a managed DOM. It’s extremely tempting to render local state changes with an HTML patch from the server to avoid all the pain, but like I said, high latency users will hate my guts for it.
This is just one more layer on top, and one more possible point of failure/frustration, as illustrated by this parent comment.
Which doesn't matter for trivial counter examples but the same technique is something I've used (not with ludic, but with HTMX) to trigger actions in physical space.
Worse though, it starts dropping repeated clicks. Triple click increments counter by 2. Unfortunately, this is unusable.
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.
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.
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.
Of course, we often need something dynamic, so we can't just use HTML. But why not something a lot like HTML so those additional pieces are as small and simple as possible... you know... like a template engine.
It's more robust to go the other way: start with the full-powered programming language, and emit the static HTML data after doing the complex logic stuff.