News for hackers. Stuff that matters.
Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by bedroom_jabroni on Sunday September 06, 2026 @05:36PM (#49591215)
There are many standalone plug-n-play implementations of the signal primitive in JS. To name a few: preact/signals, vue reactivity, etc, there's even a TC39 proposal for a lang feature. Is this meant to stand out by doing things differently or reinvent them?
Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by bosmarcel on Sunday September 06, 2026 @05:40PM (#49591244)
Honestly, mostly for the fun of building it and seeing how small and simple I could make it. While big solutions like Preact or Vue are great, sometimes you just want a tiny zero-dependency script without the overhead. And it turned out to be quite nice as I may say so
Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by bedroom_jabroni on Sunday September 06, 2026 @05:51PM (#49591319)
preact/signals-core has 0 dependencies, your project could also benefit from mentioning what primitive is being implemented for the reader's information. The size difference is negligible. The readme creates a false dilemma where there's either Mador or "having to use a framework" but it hasn't been the case for ages - as I mentioned above the major frameworks have decoupled versions of their reactivity available. This makes the other reply where "the frontend community deserves tools like this" sound weird because it ignores the great tools that have been available for a while.

Good learning experience but a very weird presentation.

Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by bosmarcel on Sunday September 06, 2026 @06:01PM (#49591391)
That's a fair distinction, but I think they solve different problems. Signals are great, but they usually require managing primitives individually and don't map directly to deep, nested JS objects the same way. Mador is specifically about dropping in a plain, nested object and working with it like normal JS without .value "boilerplate". Appreciate the feedback on the README phrasing though—I'll tweak it so it doesn't sound like a false dilemma!
Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by bedroom_jabroni on Monday September 07, 2026 @06:41AM (#49596628)
The .value comparison is not fair because it's a single value vs an object property. A better comparison would be against something like Vue's reactive() where it doesn't require you to add this "boilerplate".
Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by kevinfiol on Monday September 07, 2026 @01:57AM (#49594396)
It's not that weird of a presentation, just different ergonomics for the same problem.

preact/signals-core is great, but since HTML elements have no way to subscribe to signals, you have to handle that yourself:

  import { signal, effect } from "@preact/signals-core";

  const $ = (s) => document.querySelector(s);

  const counter = signal(0);

  effect(() => {
    $('.counter').textContent = counter.value;
  });

  $('.increment').addEventListener('click', () => {
    counter.value += 1;  
  });

  vs mador:

  import mador from "https://cdn.jsdelivr.net/npm/@marsbos/mador@latest/dist/mador.js";

  const $ = (s) => document.querySelector(s);

  const [read, write] = mador({
    count: 0,
  });

  read(".counter", (el, count) => {
    el.textContent = count;
  },
    (state) => state.count,
  );

  $('.increment').addEventListener('click', () => {
    write((state) => { state.count++; });
  });
Anyways, I love projects like these that try to make working with the web easier with minimal tools.
Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by bosmarcel on Monday September 07, 2026 @02:14AM (#49594530)
Great post/reply, thanks a lot
Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by bedroom_jabroni on Monday September 07, 2026 @06:40AM (#49596626)
I wasn't referring to the ergonomics - the weirdness was from the way it was worded like "Here's one trick Big Framework doesn't want YOU to know" as if React, Vue and such were gatekeeping their reactivity while they're actively maintaining and sharing standalone versions of it.
Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by kevinfiol on Monday September 07, 2026 @02:44PM (#49601550)
Fair, although I'm aware of preact/signals-core, what are React/Vue's standalone reactive libraries?
Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by phatskat on Monday September 07, 2026 @09:07PM (#49604578)
You're looking for `@vue/reactivity`[1] - looks like it provides ref, computed, watch, and some internals.

Honestly, this seems pretty nifty. Most projects I'd do today would likely have more value in Vue as a whole, and it's nice to see these kinds of things exposed and standalone bits

[1] https://github.com/vuejs/core/tree/main/packages/reactivity/...

Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by kevinfiol on Friday September 11, 2026 @10:28AM (#49659057)
This looks cool, but standalone usage doesn't seem to be documented anywhere. The README for the above package says "For full exposed APIs, see src/index.ts."

So while Vue is not gatekeeping their reactive primitive library, they aren't exactly advertising it like Preact in a way that the average library author (like Mador's author) might even be aware of it.

Also as someone who has built React applications for more than 7+ years, I'm also still not sure what React's reactive primitive package is. Googling or asking ChatGPT has turned up nothing.

Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by afavour on Sunday September 06, 2026 @06:50PM (#49591721)
First time I’ve seen Preact described as a “big solution”!
Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by nxobject on Sunday September 06, 2026 @08:25PM (#49592397)
(Just for (my) reference, the TC39 proposal is here:

https://github.com/tc39/proposal-signals)

Re:Show HN: Mador – Make any DOM reactive with a tiny 80-lin... by royal_ts on Monday September 07, 2026 @05:22AM (#49596012)
The TC39 proposal seems pretty much dead :(; it doesn't look like much is happening. If I understand it correctly, it's really just about agreeing on a protocol, and it's ultimately up to frameworks to implement it, there isn't anything (yet?) that can run directly in JavaScript.