Close Menu
    Facebook LinkedIn YouTube WhatsApp X (Twitter) Pinterest
    Trending
    • GM reimagines Hummer off-roader with California ideas unit
    • London’s DEScycle secures over €10 million in grant funding to scale critical metals recovery platform
    • How to Edit, Merge, and Split PDFs With Free Online Tools
    • Florida crackdown targets illegal machines in Sarasota
    • Audiophile-Oriented Noble Audio Debuts More Affordable Osprey Earbuds
    • New radio bursts detected from binary stars
    • Remarkable, Catalysr and Indigenous pre-accelerators score NSW government support for diverse founders
    • Whoop Promo Codes May 2026: 20% Off | June 2026
    Facebook LinkedIn WhatsApp
    Times FeaturedTimes Featured
    Tuesday, June 2
    • Home
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    • More
      • AI
      • Robotics
      • Industries
      • Global
    Times FeaturedTimes Featured
    Home»Artificial Intelligence»Javascript Fatigue: HTMX is all you need to build ChatGPT — Part 1
    Artificial Intelligence

    Javascript Fatigue: HTMX is all you need to build ChatGPT — Part 1

    Editor Times FeaturedBy Editor Times FeaturedNovember 18, 2025No Comments11 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email WhatsApp Copy Link


    was a time, way back, when constructing web sites was straightforward. HTML and CSS. It felt easy. These days, Javascript frameworks are in all places. Relentless change, growing complexity. This phenomenon is known as “Javascript Fatigue” and is all about builders exhausted by chasing the most recent frameworks, construct instruments, libraries, and attempting to maintain the tempo. With HTMX, builders now have a technique to construct partaking internet functions with better simplicity and fewer burnout — and with out all of the JS trouble.

    An interesting internet software like ChatGPT, in lower than 200 strains of code, pure Python and HTML. Like this one:

    A fast refresher on how the Internet labored

    When Tim Berners-Lee created the primary internet web page in 1990, the system he designed was principally a “read-only” system, that will result in pages linked between themselves with hyperlinks, which everyone knows as anchor tags in HTML. HTML 1.0 was subsequently counting on one single tag and provided easy navigation between pages.

    
    About Us

    The anchor tag is a hypermedia management that does the next course of:

    • present the person that it is a hyperlink (clickable)
    • subject a GET request to the hyperlink URL

    When the server responds with a brand new web page, the browser will exchange the present web page with the brand new web page (navigation)

    Then got here Internet 2.0 which launched a brand new tag, the shape tag. This tag allowed to replace ressources along with studying them through the tag. Having the ability to replace ressources meant that we might actually begin constructing internet functions. All of this with solely two controls: and .

    
    

    The method when submitting a kind is kind of much like the anchor tag, besides that we will:

    • select which form of request we need to carry out (GET or POST)
    • connect person data like electronic mail, password, and many others. to be handed with the request

    The 2 tags are the one parts, in pure HTML, that may work together with a server.

    After which got here Javascript.

    JavaScript was initially created so as to add easy interactions to internet pages: kind validation, information fetching, and primary animations. However with the introduction of XMLHttpRequest (later referred to as AJAX), JavaScript developed into one thing way more highly effective and sophisticated.

    With Javascript, builders might now set off HTTP requests with out the 2 tags, utilizing one thing known as AJAX. AJAX permits to fetch information from the server, and although XHR can fetch any kind of information, together with uncooked HTML fragments, textual content, or XML, JSON turned the de facto information alternate format.

    This implies there must be a further step the place JSON will get transformed to HTML, through a operate that renders HTML from JSON. As proven within the instance beneath, we proceed by:

    • fetching JSON information from the /api/customers endpoints (the response => response.json() half)
    • inserting this information right into a HTML templates (the const html half)
    • that can then be added to the DOM (the doc.getElementById() half)
    // The JavaScript manner: JSON → HTML conversion
    fetch('/api/customers')
        .then(response => response.json())
        .then(customers => {
            const html = customers.map(person => 
                `

    ${person.identify}

    ` ).be a part of(''); doc.getElementById('customers').innerHTML = html; });

    This rendering entails a decent coupling between the JSON information format and the operate itself: if the JSON information format adjustments, it might break the HTML rendering operate. You already see one potential drawback right here, and this level is often a friction level between frontend and backend builders: frontend dev builds a UI based mostly on an anticipated JSON format, backend dev decides to alter the format, frontend dev must replace UI, backend dev adjustments once more, frontend dev adjustments once more, and many others.

    For some motive, internet builders began placing JSON in all places and managed all the things with JS. This result in what we name Single-Web page Purposes (SPAs): not like conventional HTML 2.0, we don’t navigate between pages anymore. All of the content material stays on one web page, and the content material is up to date with JS and UI rendering. That is how frameworks like React, Angular, Vue.js work.

    “The rising norm for internet growth is to construct a React single-page software, with. server rendering. The 2 key parts of this structure are one thing like:
    – The principle UI is constructed & up to date in JavaScript utilizing React or one thing comparable.
    – The backend is an API that that software makes requests in opposition to.
    This concept has actually swept the web. It began with a couple of main widespread web sites and has crept into corners like advertising and marketing websites and blogs.”

    (Tom MacWright, https://macwright.com/2020/05/10/spa-fatigue)

    Most present SPA architectures are “client-thick” functions the place a lot of the job happens on the client-side and the place the backend is merely an API returning JSON. This setup is understood for offering snappy and clean person experiences, however do we actually want that complexity each time?

    “(…) there are additionally quite a lot of issues for which I can’t see any concrete profit to utilizing React. These are issues like blogs, shopping-cart-websites, mostly-CRUD-and-forms-websites.”

    (Tom MacWright, https://macwright.com/2020/05/10/spa-fatigue)

    Javascript Fatigue is actual

    The “Javascript fatigue” is getting louder. It refers back to the primary drawbacks of SPA growth:

    • Rising complexity: Libraries and frameworks have turn into more and more heavy and sophisticated, requiring massive groups to handle. Some opinionated frameworks additionally imply that JS builders should specialize on one tech. No Python developer each known as itself “A Tensorflow Python developer”. They’re simply Python builders, and switching from TF to Pytorch nonetheless means you may learn and use the 2.
    • Tight coupling: The coupling between information APIs and the UI creates friction inside groups. Breaking adjustments happen on a regular basis, and there may be not technique to resolve this so long as groups use JSON as their alternate interface.
    • Framework proliferation: The variety of frameworks retains growing, resulting in an actual feeling of “fatigue” amongst JS builders.
    • Over-engineering: You don’t want JS-heavy frameworks 90% of the time. And in some instances (content-heavy apps), it’s even a foul concept.

    Apart from extremely interactive/collaborative UIs, easy HTML with Multi-Web page Purposes is usually sufficient.

    So what’s HTMX?

    HTMX is a really light-weight JS library (14k) that provides a HTML-centric strategy to constructing dynamic internet functions. It extends HTML by permitting any aspect to make AJAX requests and replace any a part of the DOM. Not like JS frameworks which do all of the rendering on the consumer facet, the heavy lifting is completed by the server by returning HTML fragments to be inserted within the DOM. This additionally implies that should you already know templating engines and HTML, the training curve might be a lot a lot a lot simpler in comparison with studying React or Angular.

    As a substitute of abandoning hypermedia for JSON APIs, HTMX makes HTML extra succesful with the next:

    • Any aspect could make HTTP requests (not simply and )
    • Any HTTP technique (GET, POST, PUT, DELETE, PATCH)
    • Any aspect could be focused for updates
    • Any occasion can set off requests (click on, submit, load, and many others.)

    In truth, you may truly write your personal little GPT-like UI with HTMX and just some strains of Python!

    An actual demo: a ChatGPT app with HTMX and FastAPI

    For this text, we’ll construct a little bit chat with lower than 100 strains of Python and HTML. We are going to begin with quite simple demos to point out how HTMX works, then add a easy chat UI, then add a streaming functionality to our chat. To make issues much more enticing, we’ll use the Google Agent Growth Toolkit, so we will leverage brokers in our chat!

    Easy HTMX demos

    Let’s assume we now have an API that returns a listing of customers. We need to click on a button to fetch the information and show a listing.

    The normal, JS-way:

    
    
    
    
    
      Demo
    
    
    
      
      
      
    
      
    
    
    

    And that is how you’ll do with HTMX.

    First create your backend:

    from fastapi import FastAPI, Request
    from fastapi.responses import HTMLResponse
    from fastapi.templating import Jinja2Templates
    import requests
    
    app = FastAPI()
    templates = Jinja2Templates(listing="templates")
    
    @app.get("/", response_class=HTMLResponse)
    async def house(request: Request):
        return templates.TemplateResponse("demo.html", {"request": request})
    
    @app.get("/customers")
    async def get_users():
        r = requests.get("https://dummyjson.com/customers")
        information = r.json()
        html = ""
        for row in information['users']:
            html += f"
  • {row['firstName']} {row['lastName']}
  • n" return HTMLResponse(html)

    After which the HTML:

    
    
    
    
    
      Demo
      
    
    
    
    
      
       
      
    

    And also you get precisely the identical outcome! What occurred simply right here? Have a look at the



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Editor Times Featured
    • Website

    Related Posts

    Escaping the Valley of Choice in BI

    June 2, 2026

    Ensuring Data Integrity with Cryptographic Hashing and the Ethereum Blockchain

    June 1, 2026

    RAG Is Not Machine Learning, and the ML Toolkit Solves the Wrong Problem

    June 1, 2026

    How to Combine Claude Code and Codex for Maximum Coding Power

    June 1, 2026

    It’s the Lessons We Learned Along the Way. Or, Is It?

    June 1, 2026

    Proxy-Pointer RAG: Eliminating Wasteful Entity & Relations Extraction in Knowledge Graphs

    May 31, 2026

    Comments are closed.

    Editors Picks

    GM reimagines Hummer off-roader with California ideas unit

    June 2, 2026

    London’s DEScycle secures over €10 million in grant funding to scale critical metals recovery platform

    June 2, 2026

    How to Edit, Merge, and Split PDFs With Free Online Tools

    June 2, 2026

    Florida crackdown targets illegal machines in Sarasota

    June 2, 2026
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    About Us
    About Us

    Welcome to Times Featured, an AI-driven entrepreneurship growth engine that is transforming the future of work, bridging the digital divide and encouraging younger community inclusion in the 4th Industrial Revolution, and nurturing new market leaders.

    Empowering the growth of profiles, leaders, entrepreneurs businesses, and startups on international landscape.

    Asia-Middle East-Europe-North America-Australia-Africa

    Facebook LinkedIn WhatsApp
    Featured Picks

    The Simplest Android App for Scanning Documents

    February 17, 2026

    Modular exoskeletons enhance hiking and outdoor activities

    October 1, 2025

    Best Gifts for Hikers, Backpackers, Outdoorsy People (2025)

    October 28, 2025
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    Copyright © 2024 Timesfeatured.com IP Limited. All Rights.
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us

    Type above and press Enter to search. Press Esc to cancel.