Skip to content

Repository files navigation

Gehu Logo

Gehu

Simple. Signal-powered. Angular-first. Platform-agnostic.

Gehu is a modern state management ecosystem built around a flat, intuitive API, signal-based reactivity, and a platform-agnostic core. It is designed to provide the simplicity of Zustand while embracing Angular's signal ecosystem, zoneless applications, and SSR-first development.

The philosophy behind Gehu is straightforward:

  • Build a tiny, framework-independent core.
  • Provide first-class Angular integration.
  • Keep tooling optional.
  • Deliver excellent TypeScript inference.
  • Maintain zero runtime dependencies.
  • Optimize for performance, tree-shaking, and developer experience.

Why Gehu?

Most state management libraries force developers into one of two extremes:

  • Too much boilerplate.
  • Too much magic.

Gehu aims for the middle ground.

Instead of introducing new architectural concepts, Gehu keeps state management familiar:

  • State lives in stores.
  • Stores expose actions.
  • Derived values are simple.
  • Async operations are first-class.
  • Tooling stays optional.

The result is a library that scales from small applications to enterprise systems without changing how developers think.


Design Principles

Gehu follows a few non-negotiable principles:

  • Flat APIs over deeply nested configuration.
  • Platform-agnostic core.
  • Angular-first, not Angular-only.
  • Zero runtime dependencies.
  • SSR-safe by default.
  • Zoneless-ready.
  • Tree-shakable.
  • ESM-first.
  • Strong TypeScript inference.
  • Optional tooling.
  • Performance before convenience.

Packages

Package Current Next What Size (gzip)
@gehu-js/core npm current version npm next version platform-agnostic store engine, signals, resources, mutations, linked stores, plugin system ~2–3 KB
@gehu-js/angular npm current version npm next version provideGehu / injectStore, Angular signal adapter, SSR, zoneless ~2.4 KB
@gehu-js/react npm current version npm next version React hooks, provider scoping, SSR hydration helpers, server entry ~2 KB
@gehu-js/persist npm current version npm next version persistence plugin + storage adapters ~1.2 KB
@gehu-js/devtools npm current version npm next version event bridge (no UI) ~0.9 KB
@gehu-js/testing npm current version npm next version framework- & runner-agnostic test helpers ~1.6 KB

Docs

Start at docs/README.md:

Examples

Develop

bun install
bun run build        # tsc -> ESM + d.ts for every package
bun run typecheck
bun run test:ci      # all package tests, including React and Angular adapter suites
bun run release:pack-check

Design rules

Zero runtime dependencies · ESM-first · sideEffects: false · tree-shakable · no browser-only APIs in core · no global mutable stores on SSR · works in Bun, Node, browser, SSR, and tests.


Features

Platform-agnostic Core

The Gehu core contains no Angular-specific logic.

It can run in:

  • Browser
  • Node.js
  • Bun
  • Server-side rendering
  • Future framework adapters

Angular-first Integration

Gehu provides a dedicated Angular adapter with:

  • Dependency Injection support
  • Signal integration
  • Zoneless compatibility
  • Angular SSR support
  • Scoped stores
  • Simple providers

Flat Store API

Stores are intentionally simple.

const counterStore = createStore(
  ({ set, get, ctx }) => ({
    count: 0,

    double: () => get().count * 2,

    increment: () =>
      set(state => ({
        count: state.count + 1,
      })),

    reset: () => ctx.reset(),
  }),
  {
    name: "counter",
    devtools: true,
  }
);

The API remains flat and easy to understand.

Linked Stores

Coordinate multiple stores without tightly coupling them.

const checkoutStore = linkedStore(
  {
    cart: cartStore,
    user: userStore,
  },
  ({ stores }) => ({
    canCheckout: () =>
      stores.cart.items().length > 0 &&
      !!stores.user.currentUser(),
  })
);

Resources

Manage asynchronous reads with first-class support.

const store = createStore(({ ctx }) => ({
  users: ctx.resource({
    name: "users",
    fetch: () => api.users.list(),
  }),
}));

Resources expose:

  • data
  • loading
  • error
  • status
  • refetch()
  • clear()

Mutations

Model asynchronous writes cleanly.

const store = createStore(({ ctx }) => ({
  saveUser: ctx.mutation({
    name: "saveUser",
    run: api.saveUser,
  }),
}));

Mutations expose:

  • loading
  • error
  • status
  • reset()

SSR Ready

Gehu is designed for modern server-side rendering.

Supports:

  • Angular SSR
  • React SSR / Next.js hydration flows
  • Bun
  • Node.js
  • Browser hydration
  • Per-request store instances

Zoneless Ready

Built with modern Angular applications in mind.

Gehu works naturally with Angular's zoneless change detection model.

TypeScript First

The API is designed to maximize inference and minimize explicit generics.

Most users should rarely need to specify types manually.

Zero Runtime Dependencies

The runtime core intentionally avoids third-party runtime dependencies.

Benefits include:

  • Smaller bundles
  • Faster installs
  • Better control over performance
  • Easier long-term maintenance

Package Structure

@gehu-js/core
Platform-agnostic state engine

@gehu-js/angular
Angular integration

@gehu-js/react
React integration

@gehu-js/testing
Framework-agnostic testing utilities

@gehu-js/devtools
Runtime devtools bridge

@gehu-js/persist
Persistence adapters

Repository Structure

gehu/

packages/
    core/
    angular/
    react/
    testing/
    devtools/
    persist/

examples/
docs/
tooling/

Project Goals

Gehu aims to become:

  • The simplest signal based state management library for javascript.
  • A reusable state engine for multiple frameworks.
  • An excellent developer experience.
  • Lightweight enough for small projects.
  • Powerful enough for enterprise applications.

Performance Targets

Package Target (gzip)
@gehu-js/core 4–8 KB
@gehu-js/angular 2–5 KB
@gehu-js/react 2–4 KB
@gehu-js/testing 2–4 KB
@gehu-js/devtools 2–5 KB
@gehu-js/persist 1–3 KB

Overall runtime target:

Under 25 KB gzip


License

LGPL


Status

🚧 Gehu is currently under active development.

The project is being built incrementally following a phased architecture with a strong focus on stability, performance, and developer experience.

Contributions, discussions, and feedback will be welcomed once the initial public release is available.

About

Simple. Signal-powered. Platform-agnostic.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages