GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - javaquasar/mutaflow: The mutation orchestration layer for Next.js Server Actions.

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
examples
examples
 
 
packages
packages
 
 
scripts
scripts
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
ECOSYSTEM_ROADMAP.md
ECOSYSTEM_ROADMAP.md
 
 
LICENSE
LICENSE
 
 
MVP_API.md
MVP_API.md
 
 
POSITIONING.md
POSITIONING.md
 
 
README.md
README.md
 
 
RELEASING.md
RELEASING.md
 
 
VERSIONING.md
VERSIONING.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.base.json
tsconfig.base.json
 
 

Repository files navigation

Mutaflow

CI License: MIT

Mutation orchestration for Next.js Server Actions.

Mutaflow is for the part that starts after an action is callable:

  • optimistic UI
  • rollback and reconcile
  • invalidation and consistency
  • server action orchestration
  • mutation devtools and test helpers

Why Mutaflow

Server Actions are powerful, but production mutation flows still end up spread across optimistic state, invalidation, retries, redirects, error handling, and custom glue code.

Mutaflow gives that lifecycle one place to live.

Visuals

Devtools Overview

Mutaflow Devtools Overview

Devtools Inspector

Mutaflow Devtools Inspector

Packages

  • packages/mutaflow: main runtime package
  • packages/devtools: grouped timeline, filters, summary, and inspector UI
  • packages/testkit: test assertions and flow recording helpers

Quick Start

import { createFlow, optimistic } from "mutaflow";
import { consistency, createInvalidationRegistry, definePaths, defineTags } from "mutaflow/next";

const registry = createInvalidationRegistry({
  tags: defineTags((tags) => ({
    posts: {
      list: () => tags.posts.list(),
      byId: (id: string) => tags.posts.byId(id),
    },
  })),
  paths: definePaths((paths) => ({
    posts: {
      byId: (id: string) => paths.posts.byId(id),
    },
  })),
});

const createPostFlow = createFlow({
  action: createPost,
  optimistic: optimistic.insert({
    target: "posts:list",
    item: (input) => ({
      id: `temp:${input.title}`,
      title: input.title,
      pending: true,
    }),
  }),
  consistency: ({ result }) =>
    consistency.immediate({
      tags: [registry.tags.posts.list(), registry.tags.posts.byId(result.id)],
      paths: [registry.paths.posts.byId(result.id)],
    }),
});

What You Get

  • createFlow, runFlow, useFlow
  • optimistic resources with rollback and reconcile
  • lifecycle hooks and middleware
  • mutaflow/next, mutaflow/next/server, and mutaflow/next-safe-action
  • @mutaflow/devtools
  • @mutaflow/testkit

How It Works

  • concept guide: docs/CONCEPTS.md
  • includes step-by-step explanations and Mermaid diagrams for flow runtime, optimistic updates, Next cache integration, devtools, and testkit

Comparison

Mutaflow vs next-safe-action

next-safe-action focuses on safe action definition, schemas, and invocation.

Mutaflow focuses on what happens around a mutation after the action exists:

  • optimistic behavior
  • rollback and reconcile
  • invalidation and consistency
  • lifecycle hooks and middleware
  • grouped devtools
  • test assertions for mutation flows

They can work together. Mutaflow is designed to complement next-safe-action, not replace it.

Mutaflow vs Handwritten Server Action Glue

Handwritten glue is flexible, but it usually scatters mutation behavior across:

  • server action bodies
  • optimistic client state
  • retries and cancellations
  • cache invalidation calls
  • logging and error handling

Mutaflow trades some raw freedom for a more inspectable and reusable mutation system.

Examples

  • examples/basic/README.md
  • examples/next-app/README.md
  • examples/published-next-app/README.md

Release Readiness

  • release checklist: RELEASING.md
  • versioning discipline: VERSIONING.md
  • release history: CHANGELOG.md

Repository Notes

The repo uses packages/ intentionally so the runtime and ecosystem packages can evolve together.

See also:

  • POSITIONING.md
  • MVP_API.md
  • ECOSYSTEM_ROADMAP.md
  • CONTRIBUTING.md
  • CODE_OF_CONDUCT.md

About

The mutation orchestration layer for Next.js Server Actions.

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.