npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jbrowse/mobx-state-tree

v6.10.1

Published

Fork of mobx-state-tree starting from v5.4.2 for use in jbrowse 2

Readme

@jbrowse/mobx-state-tree

Fork of mobx-state-tree v5.4.2 for JBrowse 2.

  • In: any upstream MST code. Every upstream type and API is still here.
  • Out: the same trees, with the additions and fixes below.
  • Each bullet links to the page, ADR or commit that has the detail.
  • CHANGELOG.md lists every release.

Highlights

  • Lazy loading and plugins: types.union({ members: () => [...] }) re-reads its members on every operation, so a plugin can register a type after the tree exists. extendInstance adds views and actions to a live node. types.resilient keeps the tree alive when a plugin is missing.
  • Smaller snapshots: types.stripDefault drops a key from the snapshot while it holds the default value.
  • Faster at scale: array replacement, applySnapshot, onSnapshot and type construction are 2x to 35x faster in the cases measured (Performance).
  • Safer writes: a refused write leaves the tree untouched.

Added APIs

Details in docs/added-apis.md.

  • types.resilient(type, fallback, createFallbackSnapshot): an unrecognized snapshot builds the fallback instead of crashing the tree.
  • types.stripDefault(type, default): like optional, but the key leaves the snapshot when the value equals the default.
  • types.union({ members: () => [...] }): membership re-read on every operation, for lazily loaded types.
  • extendInstance(instance, fn): attach views, actions and volatile state to a live instance.
  • getChildType, getUnionSubtypes, getDefaultInstanceOrSnapshot: reflection for editors and inspectors.
  • getWrappedType, unwrapType, asArrayType, asMapType, asModelType: exact-type helpers.
  • types.compose takes 11 parts, up from 9.

Error messages

Details in docs/error-messages.md.

  • Conversion errors are depth-bound, length-capped and limited to 10 entries.
  • A discriminated union reports only the member whose literal type matched.

Behavior changes

Details in docs/behavior-changes.md.

  • A refused write leaves the tree as it found it.
  • A never-read node still runs beforeDestroy and its disposers.
  • Detaching an ancestor of a reference's target invalidates the reference.
  • A throwing preprocessor counts as a refusal during union dispatch.
  • A flow that yields a non-promise rejects.
  • Action-tracking middleware keeps per-instance state and settles after its last flow.

Performance

Details in docs/performance.md.

  • Keyed array reconcile is linear: 10x at n=1000.
  • Type construction is ~2.4x faster, and no-options unions are interned: −34% heap.
  • onSnapshot and getSnapshot reads are ~2x faster, and the onSnapshot reaction dies with its last listener.
  • The validation-result cache is gone.

Upgrading from upstream

Code that worked on upstream can break in these places:

  • The peer dependency is mobx ^7.0.0; upstream accepts ^6.3.0.
  • Node >=22 is required.
  • isArrayType, isMapType and isModelType no longer narrow. Type errors move to asArrayType, asMapType and asModelType (ADR 0006).
  • NonEmptyObject is removed, so code that imported it must stop.
  • A property or action named toString, valueOf, constructor or another Object.prototype member throws at definition.
  • In production, union(A, 5) throws Invalid value used as weak map key; upstream built a broken union.
  • union(A, B) === union(A, B), so a write to one union's type object shows up in every caller's (ADR 0005).

Types and build

  • Phantom unique symbol properties became string-keyed brand interfaces, which fixes tsgo TS4058/TS4023.
  • setDevMode() toggles dev mode at runtime. NODE_ENV is read once at load.
  • Dual CJS/ESM build, Vitest instead of Jest, eslint instead of tslint.

Design records

agent-docs/architecture-decision-records holds the decisions where the obvious change is wrong for a measured reason. Read the matching ADR before touching array reconciliation, union dispatch, type construction or the isXType guards.

Footnote

Written with extensive use of Claude Code.