HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
gnat
surreal
JavaScript2023–2026
gnat / surreal

surreal

🗿 Mini jQuery alternative. Dependency-free animations. Locality of Behavior. Use one element or arrays transparently. Pairs with htmx. Vanilla querySelector() but better!

5Distinct people
10Mentions
0Explicit recommenders
1.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

🗿 Mini jQuery alternative. Dependency-free animations. Locality of Behavior. Use one element or arrays transparently. Pairs with htmx. Vanilla querySelector() but better!

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year10 dated mentions

Observed mentions: 2023-06-23 04:32:00 UTC to 2026-06-15 16:48:10 UTC.

012342023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 3 mentions; 2 submissions, 1 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC321
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC404
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC211

What Hacker News says

10 sources
I recently had a similar junk PR on my 1,700 star repository: https://github.com/gnat/surreal/pull/56 I'm fairly convinced these are bot / LLM generated; the content is nonsensical garbage. PS: If an LLM needs a whole seperate fork to understand your content, the LLM is failing at it's job. PS PS: I want to highlight that the PR itself also seems to be an excuse to get the library quantizor made pulled in as a new dependency. Nasty.
In Creators of Tailwind laid off 75% of their engineering team
2 neat libraries I've found to work like this are Surreal[1] and CSS-Scope-Inline[2] to get your Locality of Behavior (and Style) without a huge overhead. That said, your markup can get unwieldy fairly quick, and you end up with a lot of similar and duplicated code/style blocks. My solution on a personal site, was to also use a backend-style templating library with partials[3], a file watcher[4] to build them automatically etc to kind of SSG a static site while maintaining reusable components. You can see where this is going, at what point does it make sense to just "reach for xyz framework" out of the gate? For as often as people (especially here) cry "ya aint gonna need it", there are at least as many times where people (less vocally) cry silently to themself, "I wish I'd just used a framework instead of unintentionally building a frank
Read the rest
en-framework". This from a minimalist developer who has been doing it for a long time, with STRONG opinions about the modern state of the art. Honestly, it's very common for me to feel torn about ideals vs actual pragmatism. [1]: https://github.com/gnat/surreal [2]: https://github.com/gnat/css-scope-inline [3]: https://github.com/leafo/lapis [4]: https://gittup.org/tup
In How do you do, fellow web developers? A growing disconnect
For those interested in jQuery alternatives- I've been waiting for jQuery 4.0 soooo long I ended up making my own jQuery with some key differences: * Animations, tweens, timelines use pure CSS, instead of jQuery's custom system. * Use one element or lists transparently. * Inline <script> Locality of Behavior. No more inventing unique "one time" names. * Vanilla first. Zero dependencies. 1 file. Under 340 lines. https://github.com/gnat/surreal
In Cash: A small jQuery alternative for modern browsers
Awesome. My problem is I've been waiting for 4.0 soooo long I ended up making my own jQuery with some key differences: * Animations, tweens, timelines use pure CSS, instead of jQuery's custom system. * Use one element or lists transparently. * Inline <script> Locality of Behavior. No more inventing unique "one time" names. * Vanilla first. Zero dependencies. 1 file. Under 340 lines. https://github.com/gnat/surreal That said, it's fantastic to see 4.0 here, and I'll certainly be upgrading my many sites that use it!
In jQuery v4.0 Beta
Mostly obsolete with CSS tweening. You can do non-blocking animation timelines without any library if you use async javascript. <html> <body> <div>Click me to change color every second, then remove. <script> // Locality of Behavior me = document.currentScript.parentElement; me.addEventListener("click", async event => { me = event.target me.style.transition = "background 1s" await sleep(1000) me.style.background = "red" await sleep(1000) me.style.background = "green" await sleep(1000) me.style.background = "blue" await sleep(1000) me.style.background = "none" await sleep(1000) me.remove() }) const sleep = ms => new Promise(r => setTimeout(r, ms)); </script> </div> </body> </html> If you like th
Read the rest
is, you may also want to check out: https://github.com/gnat/surreal
In Anime.js – A lightweight JavaScript animation library

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.