BOOKS - Server-Driven Web Apps with htmx
Server-Driven Web Apps with htmx - R. Mark Volkmann August 2024 (Book version P1.0) PDF | EPUB | MOBI Pragmatic Bookshelf BOOKS
US $6.92

Views
927636
Server-Driven Web Apps with htmx
Author: R. Mark Volkmann
Year: August 2024 (Book version P1.0)
Number of pages: 182
Format: PDF | EPUB | MOBI
File size: 15.2 MB
Language: ENG

htmx is a library that adds logic and server interaction to HTML; you get the effect of using a front-end SPA framework without writing front-end code. Use any server-side programming language and framework to build server applications with endpoints that simply return snippets of HTML. Dynamically update portions of the current web page from HTTP responses. Add interactivity with javascript and libraries such Alpine and _hyperscript. Make your apps more secure by escaping user-supplied content and specifying a Content Security Policy. Go beyond basic HTTP requests with WebSockets and server-sent events. The htmx javascript library gives you a new way to craft web applications. The htmx approach differs significantly from that of the currently popular single-page application (SPA) frameworks; rather than write a bunch of javascript, you simply annotate HTML elements before you send them to the browser. The resulting code is easier to understand and modify, and because it downloads less to the browser and doesn't need JSON creation and parsing, you'll find it performs better, too. The htmx library is quite small—less than 17KB minified and compressed. Pages load faster due to downloading less javascript code than when using typical SPA frameworks. You can see these improvements with app metrics such as First Contentful Paint and Time to Interactive. Htmx applications also provide faster server interactions because the time spent generating and parsing JSON is eliminated.

You may also be interested in: