Skip to content

About

Define classes to organize and control state used by React apps

Resources

Stars

104 stars

Watchers

1 watching

Forks

Latest commit

 

History

6,232 Commits

Folders and files

Repository files navigation

Expressive logo

Expressive MVC

Define reactive UI with plain classes. When properties change, your components will too.

Documentation · Playground · Discord

CI Coverage License: MIT

Expressive puts application state, behavior, and lifecycle in plain classes. Class fields are reactive, getters are computed, methods are auto-bound, and UI components subscribe only to the values they read.

Install

npm install @expressive/mvc @expressive/react

Quick start

import { Component } from '@expressive/mvc';

class Counter extends Component {
  count = 0;

  increment() {
    this.count++;
  }

  decrement() {
    this.count--;
  }

  render() {
    const { count, increment, decrement } = this;

    return (
      <div>
        <button onClick={decrement}>-</button>
        <span>{count}</span>
        <button onClick={increment}>+</button>
      </div>
    );
  }
}

No reducers, selectors, dependency arrays, or action wrappers. Update a property and every consumer that reads it updates automatically.

The adapter is renderer-agnostic, so the same install covers React Native and Expo - exercised on an iOS simulator and an Android emulator in both Debug and Release builds (Expo SDK 57, React Native 0.86) and gated per release on Metro resolution and a Hermes build. See React Native for the three boundaries.

Continue with Getting Started, explore the guides, or browse the API reference.

Packages

Package Description
@expressive/mvc Framework-agnostic reactive core: Model, Component, instructions, context. A peer dependency of every adapter - install it alongside one.
@expressive/react React adapter. Registers the host - import it once from the entry. Also covers React Native and Expo.
@expressive/dom MVC-native browser renderer with no React underneath - same core and router, native events, built-in styling. Early 0.x; expect change.
@expressive/jsx Base JSX host: the reconciler, style engine and JSX runtime that @expressive/dom builds on. For writing a host or a library that renders under any host - apps install a host instead.
@expressive/router Host-agnostic router built on Expressive components, for the React adapter and the DOM renderer alike.
@expressive/inspect Dev-only in-process inspector: registry, ownership tree, path queries, and a frame journal for tests, browser drivers, and agents.
@expressive/steps Multi-step processes as Models: every method a step, with undo, waits, retries and concurrency gates, and the instance awaitable for its result. In-process; early 0.x.

All packages are pre-1.0 under one discipline: breaking changes land only in minor versions, each documented by a changeset in the package's CHANGELOG - patch releases are always safe to take.

Learn more

Contributing

This repository is a Bun workspace. To get started:

bun install
bun run test
bun run build

See AGENTS.md for repository conventions and .github/RELEASING.md for the release process.

License

MIT

About

Define classes to organize and control state used by React apps

Resources

Stars

104 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages