nowfound

Dev tools · May 18, 2023

Swap.js – a JavaScript micro-framework (HTML fragments over the wire)

Hi HN! I created this lib in the need of a simple and tiny framework to easily do AJAX-style navigation / replacement of fragments in the page, in a web application. For people who don't want to use client-side-rendering and complex frameworks à la React, there are nowadays a few "HTML-over-the-wire" libraries, like HTMX, Unpoly or this super-tiny one Swap.js :) One other key thing is that no external tool is needed: no bundler, no webpack, no TypeScript compiler, no minification needed. Just write HTML, JS (+ your preferred server-side language: PHP, Python, etc.) and it works. The…

Swap.js – a JavaScript micro-framework (HTML fragments over the wire) launched on May 18, 2023 with 127 votes, #335 of 4,910 launches that month and more than 95% of that year's launches. The site was still online in September 2026, 3 years on.

Visit github.com ↗Alternativestop 7% of May 2023

In plain words

Swap.js is a lightweight JavaScript micro-framework that enables AJAX-style page updates by fetching and swapping HTML fragments from the server. It targets developers seeking an alternative to heavy client-side frameworks like React, allowing them to build dynamic web applications using HTML, plain JavaScript, and any server-side language without requiring bundlers, compilers, or build tools. The framework uses the Fetch API and MutationObserver to detect and handle DOM changes automatically.

written from the facts on this page · September 2026

From the sources

Swap.js is a "HTML-over-the-wire" AJAX-navigation micro-library - josephernest/Swap.js

In the maker’s words, at launch

Hi HN! I created this lib in the need of a simple and tiny framework to easily do AJAX-style navigation / replacement of fragments in the page, in a web application. For people who don't want to use client-side-rendering and complex frameworks à la React, there are nowadays a few "HTML-over-the-wire" libraries…

Does a similar job

all alternatives →
  • µJS, a 5KB alternative to Htmx and Turbo with zero dependenciesMar 2026 · mujs.org · ▲161

    I built µJS because I wanted AJAX navigation without the verbosity of HTMX or the overhead of Turbo. It intercepts links and form submissions, fetches pages via AJAX, and swaps fragments of the DOM. Single tag, one call to `mu.init()`. No build step, no dependencies. Key features: patch mode (update multiple fragments in one request), SSE support, DOM morphing via idiomorph, View Transitions, prefetch on hover, polling, and full HTTP verb support on any element. At ~5KB gzipped, it's smaller than HTMX (16KB) and Turbo (25KB), and works with any backend: PHP, Python, Go, Ruby, whatever.…

  • Swapy2024 · swapy.tahazsh.com · ▲146

    JavaScript tool to convert any layout to a drag-to-swap one

  • Remix2022 · remix.run · ▲413

    Next gen full stack web framework

  • One – A new React framework unifying web, native and local-first2024 · onestack.dev · ▲506

    Hey HN, I'm Nate, the creator of Tamagui. One is a React framework that does two things differently in hopes of simplifying how we build websites and apps: 1. It unifies React Native and React web with typed file system routing by making Vite able to serve RN. This lets you share (or diverge) your code in a simpler way for cross-platform apps. 2. We've partnered with Zero (https://zerosync.dev) to make local-first work well. We've been building a solution in One that makes Zero supporting server rendering, without waterfalls, and with seamless server/client handoff. ---…

  • FastDom – Lightweight replacement of React and MobX2019 · github.com · ▲41

    Full reactivity JS/TS framework. Lightweight replacement of React + MobX + React Router. Very small and fast !! - PxyUp/Revact

  • AI

More dev tools this month

the category →
  • /dev/null▲468

    a social network for devs

    Dev tools · 2d ago · dev-null.sh

  • open-source IDE for thoughtful software design. Contribute to devdotfast/whiteboard development by creating an account on GitHub.

    Dev tools · 27d ago · github.com

  • Contribute to reladraw/reladraw development by creating an account on GitHub.

    Dev tools · 25d ago · github.com

  • OpenBot▲362

    Grok Bot alternative: free, local, open-source, multiplayer

    Dev tools · 22d ago · openbot.run

  • Talanoa▲340

    Hi HN, I’m a fullstack developer, and honestly, I’ve lost count of how many side projects I’ve worked on over the years. But one idea kept coming back to me: a different kind of email client. It first came to me in 2014: “What if we could handle emails more like conversations?” Every year, I’d revisit this concept in my “Build Notes.” Ten years later, no one had built exactly what I had in mind — so I finally decided to do it myself. That’s how Talanoa was born. I wanted something focused on people, not timelines. I was tired of marking messages as unread just to remember to reply later, or…

    Dev tools · 20d ago · talanoa.email

  • CoreSpeed▲332

    One MCP for everything your agents need: apps, memory, tools

    Dev tools · 27d ago · corespeed.io

Source: Show HN post ↗ · launch text quoted in part

Launched alongside, May 2023

the whole month →
  • Sidekick▲1,341

    An AI-powered accessibility assistant in Stark

    AI · 2023 · getstark.co

  • In today's world, catchy headlines and articles often distract readers from the facts and relevant information. By utilizing OpenAI's language models, Boring Report processes sensationalist news articles, transforms them into the content you see, and helps readers focus on the essential details. We recently updated our iOS app experience, so any and all feedback would be appreciated. App Link: https://apps.apple.com/us/app/boring-report-news-by-ai/id644...

    AI · 2023 · boringreport.org

  • Generating powerful websites, one prompt at a time

    AI · 2023

  • AudioPen▲888

    The easiest way to convert messy thoughts into clear text

    AI · 2023 · audiopen.ai

  • Launch your website in seconds, get users in minutes

    Dev tools · 2023 · page.mmntm.build

  • Moda▲791

    An e-commerce growth marketing platform

    Growth · 2023