Skip to content
/ mise Public

fully-featured front-end application library with built-in state management

License

Notifications You must be signed in to change notification settings

blueseph/mise

Repository files navigation

Mise (en place)

Build Status codebeat badge codecov

Mise is a fully-featured front-end application library with built-in state management. Mise uses component-based architecture to promote constructing elegant hierarchies for maximum code reuse and extensibility. By explicitly manipulating your state only via actions, code paths are clearly defined and change in predictable ways. Applications lend themselves to being highly and rigorously testable.

Mise has zero dependencies and strives for performance.

  • VDOM managed updates for fast, efficient rendering.
  • Easy state management.
  • Highly testable.
  • Asynchronous rendering.
  • Small file size (13kb~ minified, 4kb~ gzipped).

Installation

npm i @mise/core

In your actual project

import { dom, component } from '@mise/core';

Or, if you prefer to use umd

<script async src="https://unpkg.com/@mise/core"></script>
<script type="javascript">
  const { dom, component } = mise;
</script>

Mise doesn't require compilation to run, but you won't be able to use JSX until you do.

Example
/** @jsx dom */

import { dom, component } from '@mise/core';

component({
  template: state => actions => (
    <div>
      <span>{state.counter}</span>
      <button onclick={actions.increment}>+</button>
      <button onclick={actions.decrement}>-</button>
    </div>
  ),
  state: {
    counter: 0,
  },
  actions: {
    increment: state => ({ counter: state.counter + 1 }),
    decrement: state => ({ counter: state.counter - 1 }),
  },
  root: document.querySelector('#app'),
});

FAQs

Do I have to use /** @jsx dom */ on every file?

You can add the the transform-react-jsx plugin to your .babelrc.

{
  "plugins": {
    [
      "transform-react-jsx", {
        "pragma": "dom",
      }
    ]
  }
}

You'll still have to import dom just like you would import React, though.

About

fully-featured front-end application library with built-in state management

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published