Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
mercury
Advanced tools
Readme
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.
A truly modular frontend framework
To understand what I mean by truly modular just read the source
'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);
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
mercury
is similar to react, however it's larger in scope,
it is better compared against om
or
quiescent
virtual-dom
which uses
an immutable vdom structureobserv-struct
which uses
immutable data for your state atommercury
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.
See the documentation folder
See the FAQ document
WIP. In lieu of documentation please see examples :(
npm install mercury
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 test
runs the testsnpm run jshint
will run jshint on the codenpm run disc
will open discify (if globally installed)npm run build
will build the html assets for gh-pagesnpm run examples
will start a HTTP server that shows examplesnpm run dist
will create a distributed version of mercurynpm run modules-docs
will (re)generate docs of mercury modulesA 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 algorithmom
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.FAQs
A truly modular frontend framework
The npm package mercury receives a total of 310 weekly downloads. As such, mercury popularity was classified as not popular.
We found that mercury demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.