Software:HTMX
HTMX is an open-source.[1] JavaScript library for modern web development that allows developers to build interactive, dynamic, and seamless web applications while adhering to the original model of the web. Created by Carson Gross, HTMX provides a simplistic approach by leveraging HTML and hypermedia concepts rather than relying heavily on JavaScript code[2][3].
History
HTMX has its roots in intercooler.js, an alternative frontend library created by Carson Gross in 2013. The library aimed to address the complexity associated with AJAX (Asynchronous JavaScript and XML) by introducing a simplified approach using HTML attributes. With the tagline "AJAX With Attributes: There is no need to be complex," intercooler.js gained popularity among web developers looking for a more straightforward way to incorporate dynamic functionality into their applications[4].
The intent was to create a framework that was aligned with Roy Fielding's original intent for REST (REpresentational State Transfer) - and specifically HATEOAS (Hypermedia As The Engine Of Application State). The problem is described in Fielding's blog post "REST APIs must be hypertext-driven" from Oct 2008[5].
Gross continued to refine and improve intercooler.js, and in recent years, it evolved into HTMX. The transition to HTMX marked a significant update and expansion of the library's capabilities, allowing developers to leverage AJAX, CSS transitions, WebSockets, and Server-Sent Events directly in HTML using attributes.
Design and Functionality
HTMX builds upon the foundation laid by intercooler.js, offering a range of attributes that developers can use to enhance HTML elements and create interactive web applications.
The library's design philosophy revolves around simplicity and the power of hypertext. By leveraging HTML attributes, HTMX enables developers to define dynamic behavior directly within their markup, reducing the need for extensive JavaScript code. This approach offers a more accessible and intuitive way to build modern user interfaces while avoiding the complexities often associated with traditional JavaScript frameworks.
HTMX enables partial page updates, meaning that only specific portions of a webpage are updated dynamically when triggered by user interactions. This approach eliminates the need to reload the entire page, resulting in a smoother user experience and improved performance.
Key Differentiators from JavaScript Frameworks
In comparison to JavaScript frameworks like React and Vue.js, which create single-page applications (SPAs) by making server requests using JavaScript and processing data using the JSON (JavaScript Object Notation) data format, HTMX takes a different approach. HTMX allows developers to issue AJAX requests directly from the HTML itself, utilizing a variety of events to trigger these requests. This eliminates the need for developers to write extensive JavaScript code to handle data processing and UI updates.
The four basic issues HTMX aims to address with traditional HTML are:[6]
- Limited elements for HTTP requests: HTMX removes the constraints that limit HTTP requests to
<a>
and<form>
elements, allowing developers to trigger requests from any HTML element. - Limited event triggers: HTMX expands the range of events that can trigger HTTP requests beyond just click and submit events.
- Limited HTTP methods: HTMX provides support for a wide range of HTTP methods beyond just GET and POST.
- Limited page replacement: HTMX allows developers to update specific parts of a page dynamically instead of requiring the entire page to be replaced.
By removing these constraints, HTMX enables developers to leverage HTML as a complete hypertext, creating modern user experiences with minimal HTML and styling.
Integration and Compatibility
HTMX is designed to be lightweight and easy to integrate into existing projects. Developers can incrementally add HTMX to enhance specific parts of their applications without requiring a complete overhaul. It is compatible with all modern web browsers and works seamlessly with various back-end frameworks and languages.[7]
The library's simplicity and versatility make it suitable for a wide range of projects, from small applications to large-scale web applications. HTMX can be used alongside other tools and libraries, such as CSS frameworks and JavaScript utilities, to create powerful and responsive web interfaces.[8]
Community and Adoption
Since its inception as intercooler.js and its subsequent evolution into HTMX, the library has gained a significant following within the web development community. With its focus on simplicity and accessibility, HTMX has attracted developers looking for a more intuitive approach to building dynamic web applications[9][10][11][12][13]
The project's GitHub repository serves as a hub for the HTMX community, allowing developers to explore the source code, report issues, and contribute to its ongoing development. The library's growing adoption and active community demonstrate its value as an alternative solution for creating modern user interfaces.
Recognition
In June 2023, HTMX was accepted into the GitHub Accelerator Program[14]. GitHub Accelerator is a selective program (20 out of 1,000 applications were included). "GitHub Accelerator is a 10-week program where open source maintainers receive an initial sponsorship of $20K to work on their project, paired with guidance and workshops from open source leaders, with an end goal of building durable streams of funding for their work"[15].
HTMX came in second in 2023 JavaScript Rising Stars for Front End frameworks[16]. The website says:
At two htmx is a library that takes a different approach to provide interactivity to HTML pages: rather than writing several lines of JavaScript code, developers enhance HTML with specific attributes to enable real-time interactivity and dynamic updates.
It was lauded for its small file size and seamless integration with existing server-side frameworks, as it's part of the trend "send HTML over the wire": ask the server to send partial blocks of HTML instead of handling JSON in the client.
JavaScript Rising Stars use the number of stars added on GitHub over the last 12 months to determine which technology is gaining momentum[17]
Tech Media Coverage
As a technology, HTMX is primarily covered in the tech media. Here are some noteworthy mentions:
- "Unlocking Interactivity with HTMX: A Deeper Dive into Modern Web Development" by Asvindra Rajpoot on Talentica.com[18].
- "Why you should choose HTMX for your next project" on DEV Community[19].
- "A First Look at HTMX and How it Compares to React" by Yoav Ganbar on Builder.io[20].
- "Simplifying Web Development with HTMX: Dynamic Applications Using HTML Attributes" on Yon.fun[21].
- "Getting Started With HTMX: A Comprehensive Guide for Beginners" on 7.dev[22].
- "htmx and HTML Driven Development" on DEV Community[23].
- "Htmx: HTML Approach to Interactivity in a JavaScript World" by Mike Melanson on The New Stack[24].
- HTMX on Thoughtworks' Technology Radar[25].
- "Dynamic Web Apps without JavaScript - HTMX Showcase at DjangoCon and Devoxx" on InfoQ[26].
- "Pros and Cons for a htmx beginner" on labcodes.com[27].
- "What is HTMX? Why it Matters? and How to use it" on DEV Community[28].
Social Media Presence
Several influential software developers on YouTube have embraced HTMX and the shift it represents in building reactive web applications. Here are some of the most viewed videos:
- htmx in 100 seconds by Fireship[29] has received more than 1 million views as of January 28, 2024. Some of the quotes from the video include: "HTMX is more capable than you think", "It is so easy", "It can handle the requirements of modern UI", "You just put the Hyper back in Hyper Text", " and "... if you want to write your own clientside JavaScript, the hx-on attribute allows you to bind a JavaScript function to any element" [30]
- From React To HTMX by ThePrimeTime[31] has received more than 247,000 views (Jan 28, 2024). The video covers a presentation from DjangoCon for Django (web framework) developers in 2022 called "From React to htmx on a real-world SaaS product. We did it! (and it was awesome)". Some quotes from the video "Beautiful animation", "It is just text", "Is it client-side application state management? Not it isn't", and "... that was awesome! That was awesome. That was so cool". It shows that Django + htmx is two to three times faster than Django + React on First load, while almost halving the memory usage. The team went from four to three engineers, with all engineers becoming full-stack developers. The size of the code base was reduced to about 1/3, and the compile time went from 41 to 5 seconds.[32]
- The Truth About HTMX by Theo - t3.gg[33] has received 145,000 views (Jan 28, 2023). Some quotes from the video "In case you have not heard yet, HTMX is the new trend", and "they work with JavaScript, so you don't have to".[34].
- DjangoCon 2022 | From React to htmx on a real-world SaaS product: we did it, and it's awesome! by DjangoConEurope[35] has 65,000 views (Jan 28, 2023). A quote from the video description "We took the plunge and replaced the 2-year-of-work React UI of our SaaS product with simple Django templates and htmx in a couple of months. We’d like to share our experience with you, with concrete indicators on various aspects, and convince your CTO!"[36]
References
- ↑ "Bigskysoftware/HTMX". https://github.com/bigskysoftware/htmx.
- ↑ "Intro to HTMX: Dynamic HTML without JavaScript". 20 September 2023. https://www.infoworld.com/article/3706951/htmx-dynamic-html-without-the-javascript.html.
- ↑ "Introduction to HTMX | refine". 26 October 2023. https://refine.dev/blog/what-is-htmx/.
- ↑ https://htmx.org/
- ↑ "REST APIs must be hypertext-driven » Untangled". https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven.
- ↑ https://htmx.org/
- ↑ "What is HTMX? Why is Tech Twitter So Hyped up About It?". 30 May 2023. https://shaxadd.medium.com/what-is-htmx-why-is-tech-twitter-so-hyped-up-about-it-681ef1736770.
- ↑ "Revolutionizing Web Development with HTMX: A Paradigm Shift". https://www.linkedin.com/pulse/revolutionizing-web-development-htmx-paradigm-shift-muduli/.
- ↑ https://twitter.com/htmx_org
- ↑ "What is so great about HTMX?". 13 January 2023. https://www.reddit.com/r/django/comments/10b0uxs/what_is_so_great_about_htmx/.
- ↑ "DjangoCon 2022 | from React to HTMX on a real-world SaaS product: We did it, and it's awesome!". https://www.youtube.com/watch?v=3GObi93tjZI.
- ↑ "HTMX, the "Framework Stupid" Gets Dialed up to Eleven!". 18 January 2024. https://medium.com/codex/htmx-the-framework-stupid-gets-dialed-up-to-eleven-2e18f7f2152a.
- ↑ "2024 is the year of HTMX". January 2024. https://medium.com/@hhartleyjs/2024-is-the-year-of-htmx-74ccd82083cf.
- ↑ https://accelerator.github.com/
- ↑ "GitHub Accelerator: Our first cohort and what's next". 12 April 2023. https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/.
- ↑ "2023 JavaScript Rising Stars". https://risingstars.js.org/2023/en#section-framework.
- ↑ "2023 JavaScript Rising Stars". https://risingstars.js.org/2023/en.
- ↑ "Unlocking Interactivity with HTMX: A Deeper Dive into Modern Web Development". 3 October 2023. https://www.talentica.com/blogs/unlocking-interactivity-with-htmx-a-deeper-dive-into-modern-web-development/.
- ↑ "Why you should choose HTMX for your next project". 19 October 2023. https://dev.to/turculaurentiu91/why-you-should-choose-htmx-for-your-next-project-o7j.
- ↑ "A First Look at HTMX and How it Compares to React". https://www.builder.io/blog/htmx-vs-react.
- ↑ "Explore HTMX: The Game-Changer for Modern Web Development". 16 August 2023. https://yon.fun/htmx/.
- ↑ "Getting Started with HTMX: A Comprehensive Guide for Beginners – 7.dev". https://7.dev/getting-started-with-htmx/.
- ↑ "HTMX and HTML Driven Development". 11 April 2021. https://dev.to/rajasegar/htmx-and-html-driven-development-3800.
- ↑ "HTMX: HTML Approach to Interactivity in a JavaScript World". 19 January 2022. https://thenewstack.io/htmx-html-approach-to-interactivity-in-a-javascript-world/.
- ↑ "HTMX | Technology Radar". https://www.thoughtworks.com/en-us/radar/languages-and-frameworks/htmx.
- ↑ "Dynamic Web Apps without JavaScript - HTMX Showcase at DjangoCon and Devoxx". https://www.infoq.com/news/2022/10/htmx-web-app-no-javascript/.
- ↑ "Pros and Cons for a HTMX beginner | Labcodes". https://labcodes.com.br/blog/en-us/development/pros-and-cons-for-a-htmx-beginner/.
- ↑ "What is HTMX? Why it Matters? And How to use it". 11 December 2023. https://dev.to/alexmercedcoder/what-is-htmx-why-it-matters-and-how-to-use-it-10h3.
- ↑ "Fireship - YouTube". https://www.youtube.com/@Fireship.
- ↑ "HTMX in 100 seconds". https://www.youtube.com/watch?v=r-GSGH2RxJs.
- ↑ "ThePrimeTime - YouTube". https://www.youtube.com/@ThePrimeTimeagen.
- ↑ "From React to HTMX". https://www.youtube.com/watch?v=wIzwyyHolRs.
- ↑ "Theo - t3․gg - YouTube". https://www.youtube.com/@t3dotgg.
- ↑ "The Truth About HTMX". https://www.youtube.com/watch?v=NA5Fcgs_viU.
- ↑ "DjangoCon Europe - YouTube". https://www.youtube.com/@DjangoConEurope.
- ↑ "DjangoCon 2022 | from React to HTMX on a real-world SaaS product: We did it, and it's awesome!". https://www.youtube.com/watch?v=3GObi93tjZI.
- "HTMX: HTML Approach to Interactivity in a JavaScript World." The New Stack. Available at: https://thenewstack.io/htmx-html-approach-to-interactivity-in-a-javascript-world/.
- "HTMX - High Power Tools for HTML." HTMX. Available at: https://htmx.org/.
Original source: https://en.wikipedia.org/wiki/HTMX.
Read more |