Skip to content

[Roadmap] Mutative v2 #168

Open
Open

Description

@unadlib

Goal

Mutative v2 will focus on correctness, performance, smaller package output, and a better developer experience.

Correct by default. Faster when safe. Smaller and easier to adopt.

Plan

Core semantics

Array performance

Benchmarks

Performance follow-ups

Measured in #177, #180 and #184; see Tradeoffs and limits.

Build system and bundle size

Tooling

Website and documentation

Real-world validation

Local packed-artifact validation — October 9, 2026

Source: a8655eac5bbe311036d4cd8422b2fb98a9acb51d. The local identification version was 2.0.0-beta.validation.a8655ea; only package.json's version changed after building and packing this commit. This package was not published to npm. Candidate SHA-256: 4b43be4d6fb91deafb377236990a75f6b77390a223383adc92ac1e3eb3e903e7.

Each application's installed Mutative was backed up and replaced with the complete packed contents; all 76 files matched the candidate at all eight application installation locations. Baseline and candidate results were compared on the same application revisions.

Application / pinned revision Tested scope Candidate result
InstantDB b97a116 Core Node suite and www tests 208 + 9 passed, 1 existing skipped; core type tests passed
Plate 6f3815d Official fast and slow runners with pinned Bun 1.3.9 3,739 fast and 410 slow passed; core/table type checks passed
MSW Data 43b2cf1 Node, type checking and Chromium persistence/sync tests 187 Node and 16 browser tests passed
OpenRewrite 2627cb4 Current JavaScript rewrite package's full Vitest suite 2,647 passed, 56 existing pending; type check passed
Notesnook 1a40555 Web test build; notes/notebooks/tags/tabs Chromium suites 96 passed, 2 existing TODO skips, 4 existing archive locator timeouts; 4 supplemental archive/unarchive cases passed on baseline and candidate
Mol* 4fcb35e Full Jest suite plus actual StateBuilder function updates 1,504 passed, 14 existing pending; 10 supplemental consumer tests passed on baseline and candidate
Appsmith 4f8e991 Main client's full Jest suite 528 suites, 4,108 tests and 19 snapshots passed

Notesnook's original archive helper targets #notes [data-test-id="archive-list"], while both builds render it under #archive. The supplemental cases kept the original archive-state assertions and selected the visible archive note card; all four passed on both versions. The 102 original browser cases had identical names and statuses across baseline and candidate. Two stream unit tests also passed on both versions; the toolbar suite could not load in the original happy-dom environment because of its mac-scrollbar SSR entry and missing Worker, and is not counted as passed. The candidate Web bundle's source map contained the exact shipped Mutative ESM source.

Mol*'s original suite made no create() calls, so the supplemental tests changed two existing state updates to the application's supported function-update API, retained dependency/relink assertions, and checked input immutability. Native V8 coverage confirmed two calls each to the packed candidate's create() and finalizeDraft().

The initial OpenRewrite baseline heap-threshold failure passed when rerun with the unchanged baseline. An initial MSW browser persistence failure passed in isolation and in the complete serial baseline/candidate runs. Appsmith's optional unbuilt canvas installation was moved to a local backup so its existing Jest canvas mock and Jsdom fallback could run; worker interruptions were independently rerun, and the final full candidate run passed without coverage, with two workers and no Jest cache. No Mutative implementation changes were needed.

Bun, Deno and native Hermes each passed seven semantic check groups covering moved array drafts and forward/inverse patches, frozen Map/Set values and mutator guards, iterator continuation/exhaustion/revocation, multiple changed Set children and patch replay, returned drafts and rawReturn, stable current() snapshots, and symbol values/object Map keys. Hermes executed the raw production UMD artifact and both Metro JavaScript and optimized bytecode variants in its real VM.

The source repository's build, 66 test files (4,917 passed, 234 expected failures, 8 skipped), type check, publint, attw and packed-consumer checks also passed. Validation reports, commands, pinned revisions, logs, package hashes and supplemental tests remain in the local evidence archive; they are not hosted in this issue.

Activity

  1. self-assigned this
    on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions