
HMPL
Lightweight server-oriented template language for JavaScript
307 followers
Lightweight server-oriented template language for JavaScript
307 followers
HMPL.js provides the flexibility to build server-driven templates with minimal JavaScript. With its block-based syntax, customizable fetch requests, and built-in support for forms, events, and time-based syncing you can deliver dynamic user interfaces without relying on a heavy framework. HMPL integrates with JSON5 for expressive object syntax and DOMPurify for safe HTML rendering, all in just a few kilobytes.
This is the 2nd launch from HMPL. View more
HMPL
HMPL.js provides the flexibility to build server-driven templates with minimal JavaScript. With its block-based syntax, customizable fetch requests, and built-in support for forms, events, and time-based syncing you can deliver dynamic user interfaces without relying on a heavy framework. HMPL integrates with JSON5 for expressive object syntax and DOMPurify for safe HTML rendering, all in just a few kilobytes.



Free
Launch Team



HMPL
@alirazaengineer Thank you very much! Yes, we provide a happy medium, a balance between the approach of completely stripping down functionality like HTML and completely writing your own code like Alpine.js, where you have to write fetch, try catch, and other unnecessary code.
Congratulations on the launch @HMPL team!
And to Anthony, who's been working on HMPL.js for a loong time. 💖
HMPL
@srbhr Thanks!
HMPL
Hey Product Hunt! 👋
I, Anthony Max, am pleased to introduce a templating language that can reduce the size of your applications by a significant amount while maintaining the same interface.
I would also like to say a big thank you to @fmerian for the opportunity.
If you have ever worked with HTMX or Alpine.js, you may have noticed that these modules are quite limited. The idea behind them is brilliant, but the implementation is not extensible. With this template language, we tried to create something in between them and EJS or PUG.
👀 How this project can be useful for you
Create powerful HATEOAS applications with just one server integration module
A small application is not only a plus for less memory in GitHub or GitLab, but also a fast loading of the page by the customer of the build that weighs a couple of megabytes
Don't depend on the current DOM like in other modules, you can put the code in a separate file with the .hmpl extension and work there
⚙️ Features
Customizable: Send a custom request to the server when receiving the UI
Memory Preserving: Reduce file sizes on the client by several times
Generate thousands of DOM nodes from a single template: Work with large components not only on the server but also on the client
Protected from XSS attacks: Enable incoming server HTML sanitization with DOMPurify and work with it safely
📌 Examples of use:
Live demo
Repository with real projects
Sandbox
👀 Why is this launch important to us?
We implemented the functionality together for almost a year. We found the right syntax by trial and error. Today we see that this really has serious practical application, which is why people's feedback is so important to us ❤️.
What do you think about this template language? It will be interesting to know your opinion 🌱!
Thank you all!
Amazing product!