DEV Community

Cover image for I replaced the HTMX in the project to this modulešŸ”„

I replaced the HTMX in the project to this modulešŸ”„

Anthony Max on June 05, 2025

TL;DR I already wrote an article on how this module can be used to replace Next.js, but it was more of a light version in some cases. N...
Collapse
 
dotallio profile image
Dotallio

Love this deep dive into how much more flexibility HMPL offers on request customization compared to HTMX.

Curious if there are still any scenarios where you'd reach for HTMX over HMPL, or have you fully switched?

Collapse
 
anthonymax profile image
Anthony Max

When size is the only thing that matters, otherwise I choose HMPL

Collapse
 
nevodavid profile image
Nevo David

pretty cool seeing your breakdown, makes me rethink if i’m sticking with my stack out of laziness or actual need - you ever feel like it’s just habit that keeps you on one tool for ages?

Collapse
 
anthonymax profile image
Anthony Max

Yes

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
anthonymax profile image
Anthony Max

Well, I just wrote an article about this.

Collapse
 
parag_nandy_roy profile image
Parag Nandy Roy

Loved the alternative..

Collapse
 
hhvdblom profile image
hhvdblom

Like the styling from HTMX. Like the KISS convention from HTMX. Like the HTML approach from HTMX. So Hmpl is not for me.

Collapse
 
anthonymax profile image
Anthony Max

Well, here it depends on what someone needs in the task - yes. But, it does not cancel the fact that with HTMX you will not be able to customize the request normally.

Collapse
 
anthonymax profile image
Anthony Max

I think this is a great replacement.

Collapse
 
axrisi profile image
Nikoloz Turazashvili (@axrisi)
  • Overview: The discussion emphasizes HMPL as a viable replacement for HTMX in web development, providing similar functionalities while being more customizable.

  • Modules Comparison

    • Both HTMX and HMPL work with HTML from the server
    • Similar concept but different implementations
    • HTMX is minimalistic, while HMPL offers more customization
  • Simple Clicker Example

    • HTMX Implementation: A basic counter with limited settings
      • Uses XMLHTTPRequest for request handling
      • Limited customization options
    • HMPL Implementation: Compiles a similar clicker using JavaScript
      • Allows greater flexibility in request handling
  • Key Problems Identified

    • HTMX
      • Minimal JavaScript dependency makes customization difficult
      • Requests are sent using a 25-year-old XMLHTTPRequest standard
    • HMPL
      • Utilizes customizable fetch for modern JavaScript features
  • Complex Form Example

    • HTMX: Form submissions with basic functionality
      • Uses hx-include to include form data
    • HMPL: Replicates form behavior with enhanced request customization
      • Capable of modifying requests by extracting form data.
  • Size Comparison

    • HTMX leads in application size efficiency
      • Smaller application sizes when using minimal settings
    • HMPL shows decent dimensionality compared to alternatives.
  • Conclusion

    • Users can still opt for HTMX, but HMPL offers an alternative for those needing more functionality.
    • The choice depends on the complexity of the application and the specific needs of the developer.

made with love by axrisi
axrisi.com