RFC: Making templUI Framework-Agnostic - Decoupling from HTMX/Datastar #251
Replies: 4 comments 5 replies
-
TLDR; i don't care about the opinion piece
The opinion pieceThe reason I use TemplUI is because I don't want to write JS or spend time thinking about "frontend interactivity" or "component reactivity" unless I absolutely have to because quite frankly that's not the business i'm in and it's not the business I want to be in. I just want to write my endpoints in go, have the client call them and show HTML on the screen, as expected, in the way i expect it and have a dropdown just work. I don't know what vision you have for this project, although i can imagine it being more than what it currently is considering the development of TemplUI Pro, but with that being said... One can argue that TemplUI being focused on HTMX is not necessarily a bad thing considering HTMX is the most popular tool. You probably have a better idea of this then me so I could be totally just be wrong, but why rethink a model because of a couple of people who aren't using the currently accepted standard? If i was the maintainer, unless I had multiple issues on a regular basis asking for specific support on "XYZ" framework, I would consider it a non priority. And this is not what I have seen skimming through issues and pull requests, where the majority of people seem to be concerned primarily with HTMX. Like how the saying goes "premature optimization is bad" The same sentiment can be said about future proofing to a certain extent. |
Beta Was this translation helpful? Give feedback.
-
My startup is developing an admin panel pattern application using TemplUI. For my very particular use case, I would support this change, as long as HTMX is a “first among equals”. We are heavily invested in HTMX, and have no real interest in other hypermedia frameworks. Documentation and guidance for adapting and migrating to this new pattern would be appreciated. I do see the merit of having a generic |
Beta Was this translation helpful? Give feedback.
-
I am currently rewriting a new version of my SaaS and am using HTMX. I don't think I will change to another hypermedia-first library, but I understand why it would make sense for templUI to be agnostic about it. That said, as long as it's relatively easy to integrate with HTMX, I don't really care. OTOH, if these changes were to be made, I believe it would also have an impact on other parts of the components library. The JS integration is one thing, but what about the props of the components? Let's take a look at the props of the button: type Props struct {
ID string
Class string
Attributes templ.Attributes
Variant Variant
Size Size
FullWidth bool
Href string
Target string
Disabled bool
Type Type
HxGet string
HxPost string
HxPut string
HxDelete string
HxTrigger string
HxTarget string
HxSwap string
HxReplaceUrl string
} If HTMX is not the default/standard for this component library, does it really make sense to have all of the HTMX-related props? Would we keep them and just add all the ones necessary for other libraries? Would we remove them? Would we have some kind of modular components where the only one presents are the one you select ( And I have to say, while it's not a huge deal to not have these HTMX-related props, it does make it very nice to use. It would be a shame if they were to go... In any case, I'm glad to have access to this library and have good looking components in templ. If there was a need for some work that you wish to be done, don't hesitate to contact me |
Beta Was this translation helpful? Give feedback.
-
Thanks again to everyone who contributed ideas, feedback, and pushback – it really helped shape this! ✅ The refactor is now live in templUI v0.80.2 Full release notes & migration details here: This is a big step toward making templUI fully framework-agnostic while keeping HTMX and others easy to use via We’re still pre-1.0 – so yeah, things might break. If something doesn’t work as expected, let me know and I’ll fix it quickly. Let’s build clean, portable UIs for Go & templ – together 🚀 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey templUI community! 👋
I'm considering a major architectural change that would make templUI completely framework-agnostic and I'd love your thoughts.
🤔 Current Problem
Right now, templUI components have hardcoded event listeners for HTMX:
This creates several issues:
🚀 Proposed Solution: Clean Global API
Instead, expose clean initialization functions:
🔧 Framework Integration (User's Choice)
HTMX Users:
Datastar Users:
Alpine.js Users:
Vanilla JS Users:
✅ Benefits
🤝 Migration Strategy
🏗️ Implementation Details
Current Modal Component Structure:
New Modal Component Structure:
📖 Documentation Examples
Quick Start (Any Framework)
Integration Helper (Optional)
💭 Questions for the Community
templUI.integration.htmx()
that sets up common patterns?🔄 Migration Path for Users
Before (Current):
After (New):
🎯 Success Metrics
This change would be successful if:
This change would make templUI truly universal while keeping the same great DX. What do you think?
Beta Was this translation helpful? Give feedback.
All reactions