HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Raynos
mercury
JavaScript2014–2024
Raynos / mercury · Archived

mercury

A truly modular frontend framework

23Distinct people
39Mentions
2Explicit recommenders
2.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A truly modular frontend framework

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

I liked angular when I was using it, I felt I was able to get more done quicker than I could with Backbone, but both were slower than straight up, good ol' no framework JS. The…

pedalpete used a recommendation phrase. 2 indexed comments match. This is a phrase match, not a verdict.

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

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 2:04:58 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 year39 dated mentions

Observed mentions: 2014-05-14 06:25:18 UTC to 2024-05-13 10:15:33 UTC.

051015202014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 13 mentions; 1 submissions, 12 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 19 mentions; 0 submissions, 19 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

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
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC13112
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC19019
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC312
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
mercury Deprecated: Not actively being worked on. Instead tonic and https://tonic.technology/ are actively being worked on. mercury has some interesting ideas but they are not very practical at scale. tonic is a lightweigth component system on top of web components that leverages the browsers HTML parser for the heavy lifting instead of virtual-dom. It comes with a set of components which help with building apps more quickly by having some re-usable components out of the box. Description A truly modular frontend framework To understand what I mean by truly modular just read the source Examples Hello world 'use strict'; var document = require('global/document'); var hg = require('mercury'); var h = require('mercury').h; function App() { return hg.state({ value: hg.value(0), channels: { clicks: incrementCounter } }); } function incrementCounter(state) { state.value.set(state.value() + 1); } App.render = function render(state) { return h('div.counter', [ 'The state ', h('code', 'clickCount'), ' has value: ' + state.value + '.', h('input.button', { type: 'button', value: 'Click me!', 'ev-click': hg.send(state.channels.clicks) }) ]); }; hg.app(document.body, App(), App.render); Basic Examples count shared-state bmi-counter canvas async-state real-dom Intermediate Examples TodoMVC markdown editor number-input serverside rendering login form geometry 2048 (wip) github issues (wip) hot reloading with browserify or webpack Unidirectional examples The following examples demonstrate how you can mix & match mercury with other frameworks. This is possible because mercury is fundamentally modular. Disclaimer: The following are neither "good" nor "bad" ideas. Your milage may vary on using these ideas Backbone + Mercury Immutable + Mercury JSX + Mercury Motivation Mercury vs React mercury is similar to react, however it's larger in scope, it is better compared against om or quiescent mercury leverages virtual-dom which uses an immutable vdom structure mercury comes with observ-struct which uses immutable data for your state atom mercury is truly modular, you can trivially swap out subsets of it for other modules mercury source code itself is maintainable, the modules it uses are all small, well tested and well documented. You should not be afraid to use mercury in production as it's easy to maintain & fix. mercury encourages zero dom manipulation in your application code. As far as your application is concerned elements do not exist. This means you don't need to reference DOM elements when rendering or when handling events mercury is compact, it's 11kb min.gzip.js, that's smaller than backbone. mercury strongly encourages FRP techniques and discourages local mutable state. mercury is highly performant, it's faster than React / Om / ember+htmlbars in multiple benchmarks TodoMVC benchmark animation benchmark TodoMVC benchmark source mercury comes with FP features like time-travel / easy undo out of the box. mercury is lean, it's an weekend's read at 2.5kloc. (virtual-dom is 1.1kloc, an evening's read.) compared to react which is almost 20kloc (a month's read) Modules mercury is a small glue layer that composes a set of modules that solves a subset of the frontend problem. If mercury is not ideal for your needs, you should check out the individual modules and see if you can re-use something. Alternatively if the default set of modules in mercury doesn't work for you, you can just require other modules. It's possible to for example, swap out vtree with react or swap out observ-struct with backbone See the modules README for more information. Documentation See the documentation folder FAQ See the FAQ document API WIP. In lieu of documentation please see examples :( Installation npm install mercury Development If you want to develop on mercury you can clone the code git clone git@github.com:Raynos/mercury cd mercury npm install npm test npm run tasks npm test runs the tests npm run jshint will run jshint on the code npm run disc will open discify (if globally installed) npm run build will build the html assets for gh-pages npm run examples will start a HTTP server that shows examples npm run dist will create a distributed version of mercury npm run modules-docs will (re)generate docs of mercury modules Inspirations A lot of the philosophy and design of mercury is inspired by the following: react for documenting and explaining the concept of a virtual DOM and its diffing algorithm om for explaining the concept and benefits of immutable state and time travel. elm for explaining the concept of FRP and having a reference implementation of FRP in JavaScript. I wrote a pre-cursor to mercury that was literally a re-implementation of elm in javascript (graphics) reflex for demonstrating the techniques used to implement dynamic inputs. Contributors Raynos Matt-Esch neonstalwart parshap nrw kumavis MIT Licenced
Read the full README on GitHub

What Hacker News says

1 sources

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.