• About
  • Advertise
  • Privacy & Policy
  • Contact
Monday, December 29, 2025
  • Login
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
Advertisement
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
No Result
View All Result
Home Machine Learning

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

AiNEWS2025 by AiNEWS2025
2025-11-17
in Machine Learning
0
Javascript Fatigue: HTMX is all you need to build ChatGPT — Part 1
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


was a time, long ago, when building websites was easy. HTML and CSS. It felt simple. Nowadays, Javascript frameworks are everywhere. Relentless change, increasing complexity. This phenomenon is called “Javascript Fatigue” and is all about developers exhausted by chasing the latest frameworks, build tools, libraries, and trying to keep the pace. With HTMX, developers now have a way to build engaging web applications with greater simplicity and less burnout — and without all the JS hassle.

An engaging web application like ChatGPT, in less than 200 lines of code, pure Python and HTML. Like this one:

A quick refresher on how the Web worked

When Tim Berners-Lee created the first web page in 1990, the system he designed was mostly a “read-only” system, that would lead to pages connected between themselves with hyperlinks, which we all know as anchor tags in HTML. HTML 1.0 was therefore relying on one single tag and offered simple navigation between pages.


About Us

The anchor tag is a hypermedia control that does the following process:

  • show the user that this is a link (clickable)
  • issue a GET request to the hyperlink URL

When the server responds with a new page, the browser will replace the current page with the new page (navigation)

Then came Web 2.0 which introduced a new tag, the form tag. This tag allowed to update ressources in addition to reading them via the tag. Being able to update ressources meant that we could really start building web applications. All of this with only two controls: and .


The process when submitting a form is quite similar to the anchor tag, except that we can:

  • choose which kind of request we want to perform (GET or POST)
  • attach user information like email, password, etc. to be passed with the request

The two tags are the only elements, in pure HTML, that can interact with a server.

And then came Javascript.

JavaScript was originally created to add simple interactions to web pages: form validation, data fetching, and basic animations. But with the introduction of XMLHttpRequest (later known as AJAX), JavaScript evolved into something much more powerful and complex.

With Javascript, developers could now trigger HTTP requests without the two tags, using something called AJAX. AJAX allows to fetch data from the server, and though XHR can fetch any type of data, including raw HTML fragments, text, or XML, JSON became the de facto data exchange format.

This means there needs to be an additional step where JSON gets converted to HTML, via a function that renders HTML from JSON. As shown in the example below, we proceed by:

  • fetching JSON data from the /api/users endpoints (the response => response.json() part)
  • inserting this data into a HTML templates (the const html part)
  • that will then be added to the DOM (the document.getElementById() part)
// The JavaScript way: JSON → HTML conversion
fetch('/api/users')
    .then(response => response.json())
    .then(users => {
        const html = users.map(user => 
            `

${user.name}

` ).join(''); document.getElementById('users').innerHTML = html; });

This rendering involves a tight coupling between the JSON data format and the function itself: if the JSON data format changes, it could break the HTML rendering function. You already see one potential problem here, and this point is usually a friction point between frontend and backend developers: frontend dev builds a UI based on an expected JSON format, backend dev decides to change the format, frontend dev needs to update UI, backend dev changes again, frontend dev changes again, etc.

For some reason, web developers started putting JSON everywhere and managed everything with JS. This lead to what we call Single-Page Applications (SPAs): unlike traditional HTML 2.0, we don’t navigate between pages anymore. All the content stays on one page, and the content is updated with JS and UI rendering. This is how frameworks like React, Angular, Vue.js work.

“The emerging norm for web development is to build a React single-page application, with. server rendering. The two key elements of this architecture are something like:
– The main UI is built & updated in JavaScript using React or something similar.
– The backend is an API that that application makes requests against.
This idea has really swept the internet. It started with a few major popular websites and has crept into corners like marketing sites and blogs.”

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

Most current SPA architectures are “client-thick” applications where most of the job occurs on the client-side and where the backend is merely an API returning JSON. This setup is known for providing snappy and smooth user experiences, but do we really need that complexity every time?

“(…) there are also a lot of problems for which I can’t see any concrete benefit to using React. Those are things like blogs, shopping-cart-websites, mostly-CRUD-and-forms-websites.”

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

Javascript Fatigue is real

The “Javascript fatigue” is getting louder. It refers to the main drawbacks of SPA development:

  • Increasing complexity: Libraries and frameworks have become increasingly heavy and complex, requiring big teams to manage. Some opinionated frameworks also mean that JS developers have to specialize on one tech. No Python developer every called itself “A Tensorflow Python developer”. They’re just Python developers, and switching from TF to Pytorch still means you can read and use the two.
  • Tight coupling: The coupling between data APIs and the UI creates friction within teams. Breaking changes occur everyday, and there is not way to solve this as long as teams use JSON as their exchange interface.
  • Framework proliferation: The number of frameworks keeps increasing, leading to a real feeling of “fatigue” among JS developers.
  • Over-engineering: You don’t need JS-heavy frameworks 90% of the time. And in some cases (content-heavy apps), it is even a bad idea.

Except for highly interactive/collaborative UIs, simple HTML with Multi-Page Applications is often enough.

So what is HTMX?

HTMX is a very lightweight JS library (14k) that offers a HTML-centric approach to building dynamic web applications. It extends HTML by allowing any element to make AJAX requests and update any part of the DOM. Unlike JS frameworks which do all the rendering on the client side, the heavy lifting is done by the server by returning HTML fragments to be inserted in the DOM. This also means that if you already know templating engines and HTML, the learning curve will be much much much easier compared to learning React or Angular.

Instead of abandoning hypermedia for JSON APIs, HTMX makes HTML more capable with the following:

  • Any element can make HTTP requests (not just and )
  • Any HTTP method (GET, POST, PUT, DELETE, PATCH)
  • Any element can be targeted for updates
  • Any event can trigger requests (click, submit, load, etc.)

In fact, you can actually write your own little GPT-like UI with HTMX and just a few lines of Python!

A real demo: a ChatGPT app with HTMX and FastAPI

For this article, we will build a little chat with less than 100 lines of Python and HTML. We will start with very simple demos to show how HTMX works, then add a simple chat UI, then add a streaming capability to our chat. To make things even more attractive, we will use the Google Agent Development Toolkit, so we can leverage agents in our chat!

Simple HTMX demos

Let’s assume we have an API that returns a list of users. We want to click a button to fetch the data and display a list.

The traditional, JS-way:






  Demo



  
  
  

  


And this is how you would 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(directory="templates")

@app.get("/", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("demo.html", {"request": request})

@app.get("/users")
async def get_users():
    r = requests.get("https://dummyjson.com/users")
    data = r.json()
    html = ""
    for row in data['users']:
        html += f"
  • {row['firstName']} {row['lastName']}
  • \n" return HTMLResponse(html)

    And then the HTML:

    
    
    
    
    
      Demo
      
    
    
    
    
      
       
      
    

    And you get exactly the same result! What happened just here? Look at the

    Source link

    #Javascript #Fatigue #HTMX #build #ChatGPT #Part

    Tags: chatbotDeep DiveshtmxProgrammingPython
    Previous Post

    I’ve already been using a “Steam Machine” for months, and I think it’s great

    Next Post

    The Download: How to survive a conspiracy theory, and moldy cities

    AiNEWS2025

    AiNEWS2025

    Next Post
    The Download: How to survive a conspiracy theory, and moldy cities

    The Download: How to survive a conspiracy theory, and moldy cities

    Stay Connected test

    • 23.9k Followers
    • 99 Subscribers
    • Trending
    • Comments
    • Latest
    A tiny new open source AI model performs as well as powerful big ones

    A tiny new open source AI model performs as well as powerful big ones

    0
    Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

    Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

    0
    Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

    Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

    0
    Best Headphones for Working Out (2024): Bose, Shokz, JLab

    Best Headphones for Working Out (2024): Bose, Shokz, JLab

    0
    Breaking the Hardware Barrier: Software FP8 for Older GPUs

    Breaking the Hardware Barrier: Software FP8 for Older GPUs

    2025-12-28
    How AI coding agents work—and what to remember if you use them

    How AI coding agents work—and what to remember if you use them

    2025-12-28
    You need to read the subversive cosmic horror novella The Ballad of Black Tom

    You need to read the subversive cosmic horror novella The Ballad of Black Tom

    2025-12-28
    Days After Mass Bricking Event, Waymo Fleet Shuts Down Again

    Days After Mass Bricking Event, Waymo Fleet Shuts Down Again

    2025-12-28

    Recent News

    Breaking the Hardware Barrier: Software FP8 for Older GPUs

    Breaking the Hardware Barrier: Software FP8 for Older GPUs

    2025-12-28
    How AI coding agents work—and what to remember if you use them

    How AI coding agents work—and what to remember if you use them

    2025-12-28
    You need to read the subversive cosmic horror novella The Ballad of Black Tom

    You need to read the subversive cosmic horror novella The Ballad of Black Tom

    2025-12-28
    Days After Mass Bricking Event, Waymo Fleet Shuts Down Again

    Days After Mass Bricking Event, Waymo Fleet Shuts Down Again

    2025-12-28
    Footer logo

    We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

    Follow Us

    Browse by Category

    • AI & Cloud Computing
    • AI & Cybersecurity
    • AI & Sentiment Analysis
    • AI Applications
    • AI Ethics
    • AI Future Predictions
    • AI in Education
    • AI in Fintech
    • AI in Gaming
    • AI in Healthcare
    • AI in Startups
    • AI Innovations
    • AI News
    • AI Research
    • AI Tools & Automation
    • Apps
    • AR/VR & AI
    • Business
    • Deep Learning
    • Emerging Technologies
    • Entertainment
    • Fashion
    • Food
    • Gadget
    • Gaming
    • Health
    • Lifestyle
    • Machine Learning
    • Mobile
    • Movie
    • Music
    • News
    • Politics
    • Review
    • Robotics & Smart Systems
    • Science
    • Sports
    • Startup
    • Tech
    • Travel
    • World

    Recent News

    Breaking the Hardware Barrier: Software FP8 for Older GPUs

    Breaking the Hardware Barrier: Software FP8 for Older GPUs

    2025-12-28
    How AI coding agents work—and what to remember if you use them

    How AI coding agents work—and what to remember if you use them

    2025-12-28
    • About
    • Advertise
    • Privacy & Policy
    • Contact

    © 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

    Welcome Back!

    Login to your account below

    Forgotten Password?

    Retrieve your password

    Please enter your username or email address to reset your password.

    Log In
    No Result
    View All Result

    © 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.