mobxjs/mobx.dart
72.4
Strong · 23 September 2026
11.8k
lines of production code
Dart
with TypeScript
5
measurements over time
What this system is
This system is a reactive state management library for Dart and Flutter, providing a framework for managing application state through observables, computed values, and actions. It includes a code generator to automate boilerplate, a linter with code assists for UI integration, and a comprehensive suite of examples demonstrating patterns like async handling and collection reactivity. The project also features robust tooling for performance benchmarking, testing, and documentation deployment.
How it got here
2018–2019 — MobX Dart v2.7.0 release and Flutter integration
36 changes.
This period focused on restructuring the MobX Dart codebase into a Melos monorepo and releasing version 2.7.0, which introduced a refined public API, configurable reactive contexts, and comprehensive test coverage for core primitives. It also marked the initial release of the flutter\_mobx package, providing essential widgets like Observer and ReactionBuilder for Flutter integration, alongside a robust code generator migration to the Element2 API. The work was further supported by the creation of extensive example applications demonstrating various state management patterns and the establishment of CI/CD and documentation tooling.
2020–2026 — Documentation, examples, and performance tooling
8 changes.
This period focused on expanding the project's ecosystem through new Flutter examples, a linter code assist, and comprehensive documentation deployment infrastructure. It also established a robust performance benchmarking suite and regression test harness to validate core reactivity correctness and optimization efforts.
Features
Add 'Wrap with Observer' code assist
The linter now provides a new code assist that automatically wraps selected widget constructors in an Observer widget. This feature helps users quickly integrate reactivity into their Flutter UI components by inserting the necessary Observer boilerplate around the selected code.
_mobx\lint/lib · high confidence
Add Hacker News example app demonstrating reactive state management
A new Hacker News example has been added to the examples directory, providing a complete Flutter application that fetches and displays news stories from the Hacker News API. The implementation uses MobX to manage reactive state, featuring a store that handles asynchronous data fetching for both 'Newest' and 'Top' story feeds, and UI widgets that automatically update based on the loading, success, or error status of these observables.
_mobx\examples/lib/hackernews · high confidence
Add random stream example using ObservableStream
The random\_stream example now demonstrates how to use ObservableStream to react to periodic updates. The RandomStore creates a timer that emits random integers every second into a StreamController, which is wrapped in an ObservableStream. The UI uses an Observer widget to display the latest value, automatically updating as new numbers are generated.
_mobx\_examples/lib/random\stream · high confidence
Added Flutter Web entry point for MobX examples
A new index.html file has been added to the web directory, serving as the HTML entry point for running the MobX examples in a browser. This file includes the necessary meta tags and loads the flutter\_bootstrap.js script, enabling the Flutter web application to initialize correctly.
_mobx\examples/web · high confidence
Added MobX counter examples with and without code generation
The \mobx\_examples/lib/counter\ directory now includes example implementations demonstrating how to use MobX in Flutter. This includes a standard store-based counter using code generation (\counter.dart\ and \counter.g.dart\) and a manual observable counter without code generation (\without\_codegen.dart\), along with their corresponding UI widgets (\counter\_widgets.dart\). These examples serve as a reference for integrating MobX state management into Flutter applications.
_mobx\examples/lib/counter · high confidence
Added MobX example application with Counter and Todos stores
The \mobx/example\ directory now includes a complete example application demonstrating core MobX features. It provides a simple Counter store and a more complex Todos store that showcases observables, computed properties, and actions. The entry includes the source files (\counter.dart\, \todos.dart\) and their corresponding generated code (\\*.g.dart\), along with a README explaining how to use annotations and run the code generator.
mobx/example · high confidence
Added MobX raw API example
A new example file demonstrating the use of MobX's raw API has been added to the examples directory. It shows how to create an observable, a computed value, and a parametrized action using the underlying store mechanisms.
_mobx\examples/lib/raw · high confidence
Added connectivity status monitoring example
The connectivity example now demonstrates how to monitor network status changes using MobX. It introduces a ConnectivityStore that wraps the connectivity\_plus stream into an ObservableStream, and a UI widget that uses ReactionBuilder to react to these changes by displaying a snackbar indicating whether the device is online or offline.
_mobx\examples/lib/connectivity · high confidence
Flutter MobX library initialization and public API exposure
The flutter\_mobx package is introduced, providing bindings to use MobX observables within Flutter applications. The library exposes key components including the Observer widget, StatelessObserverWidget, StatefulObserverWidget, ReactionBuilder, and MultiReactionBuilder, allowing developers to reactively render UI based on observable state. The package is initialized with version 2.4.0.
_flutter\mobx/lib · high confidence
Initial release of MobX examples package (v1.1.0)
The mobx\_examples package is introduced as a new collection of reference applications demonstrating MobX usage in Flutter. This release includes a suite of examples such as Clock, Counter, Signup form, Github repo search, Hackernews, Multi Counter, Random Stream, Todos, and Dice. The package is configured with standard Flutter analysis options and includes a CHANGELOG noting support for annotations.
_mobx\examples · high confidence
Initial release of flutter\_mobx package
This change introduces the \flutter\_mobx\ package, providing Flutter integration for MobX. It includes the core \Observer\ widget, which monitors observables and automatically rebuilds UI components when state changes. The package also provides a \README\ with usage examples, standard \LICENSE\ and \CHANGELOG\ files, and configuration for analysis options and project metadata.
_flutter\mobx · high confidence
Introduction of ObservableList, ObservableMap, and ObservableSet with action-enforced mutations
The \mobx/lib/src/api/observable\_collections\ area now provides reactive wrappers for Dart's standard collections: \ObservableList\, \ObservableMap\, and \ObservableSet\. These classes implement \Listenable\ interfaces that notify listeners of structural changes (add, remove, update, clear). Crucially, all mutating methods (such as \add\, \set\, \remove\, and \clear\) are wrapped in conditional actions via \conditionallyRunInAction\, ensuring that state changes are batched and tracked correctly within the MobX reactive context, while read operations enforce the read policy to track dependencies.
_mobx/lib/src/api/observable\collections · high confidence
New Cloudflare Pages deployment tooling for Flutter documentation and gallery
Added build and deployment scripts for hosting the Flutter documentation site and gallery on Cloudflare Pages. The new \tool/cloudflare\ directory includes a build script (\build.sh\) that provisions a specific Flutter SDK version (3.47.2) and runs the VitePress documentation build, alongside a provisioning script (\ensure-project.mjs\) that automatically creates or validates the Cloudflare Pages project via API. This enables GitHub Actions to deploy the combined output (including JavaScript and Wasm builds) to Cloudflare without requiring a Cloudflare-hosted build environment or GitHub App installation.
tool/cloudflare · high confidence
New Dice Counter example demonstrating reactive state management
A new interactive example has been added to the \mobx\_examples/lib/dice\ directory, showcasing how to manage reactive state with MobX in a Flutter application. The implementation includes a \DiceCounter\ store that tracks two dice values and a computed total, along with a UI that uses the \Provider\ package to inject the store and \Observer\ widgets to automatically update the displayed dice images and total sum when the user taps to roll.
_mobx\examples/lib/dice · high confidence
New GitHub repository browser example
Added a new Flutter example in the \github\_examples\ module that demonstrates fetching and displaying GitHub user repositories. The implementation includes a \GithubStore\ using MobX observables and actions to manage the API request lifecycle (including loading and error states via \ObservableFuture\), alongside UI widgets that reactively render the repository list, loading indicators, and error messages.
_mobx\examples/lib/github · high confidence
New MobX Todos example using Provider and JSON serialization
The \mobx\_examples/lib/todos\ location now includes a complete, runnable example demonstrating a Todo application. This example introduces a \TodoList\ store that manages observable state (including an \ObservableList\<Todo\>\) and computed properties for filtering and status descriptions. It showcases integration with the \Provider\ package for state management in Flutter widgets, utilizes \json\_annotation\ and generated code (\todo.g.dart\, \todo\_list.g.dart\) for serializing the store to and from JSON, and implements UI components like \ToggleButtons\ for visibility filtering and \Observer\ widgets for reactive UI updates.
_mobx\examples/lib/todos · high confidence
New MobX performance benchmark suite and documentation
A new benchmarking infrastructure has been added to the MobX package, including a comprehensive README, a Dart-based runner, and a comparison tool. This suite allows developers to measure reactivity performance by running 35 upstream workloads, collection scaling tests, and propagation graphs on both native and WebAssembly targets. The addition provides a standardized way to validate performance improvements and correctness regressions before release.
(repo-wide) · high confidence
New MultiReactionBuilder widget and refactored Observer internals
Developers can now use the new MultiReactionBuilder widget to merge multiple ReactionBuilder widgets into a single widget tree, reducing nesting and boilerplate when composing multiple reactive reactions. The Observer widget and its underlying implementation have been refactored to use StatelessObserverWidget and StatefulObserverWidget base classes with a shared ObserverWidgetMixin, improving code structure and maintainability. Additionally, the Observer now includes debug stack frame information in its name by default to help identify the source of warnings or errors during development.
_flutter\mobx/lib/src · high confidence
New async observable wrappers for Futures and Streams
The library now exposes \ObservableFuture\ and \ObservableStream\ classes in the async API, allowing asynchronous operations to be tracked as reactive state. \ObservableFuture\ exposes a \status\ (pending, fulfilled, rejected) and a \result\ property that updates automatically when the underlying future completes, while \ObservableStream\ mirrors emitted values and errors into observable properties like \data\, \value\, and \status\. These classes enable reactions to trigger on async completion or stream events without manual subscription management.
mobx/lib/src/api/async · high confidence
New documentation gallery and example app structure
The examples module has been restructured to include a new documentation gallery that lists available MobX examples (Counter, Multi Counter, Todos, etc.) in a navigable list. The app now uses Provider to manage stores (MultiCounterStore, Counter, SettingsStore, ConnectivityStore) and integrates with shared\_preferences for settings. A spy is enabled on the main context for debugging. The app entry point now initializes Flutter bindings and sets up the provider hierarchy before running the app.
_mobx\examples/lib · high confidence
New extension methods for converting standard types to Observable collections and primitives
This change introduces new Dart extension methods in the \mobx/lib/src/api/extensions\ directory, allowing users to easily convert standard Dart types into their observable counterparts. Specifically, \Future\, \List\, \Map\, \Set\, and \Stream\ types now have an \asObservable()\ method to create \ObservableFuture\, \ObservableList\, \ObservableMap\, \ObservableSet\, and \ObservableStream\ instances respectively. Additionally, primitive types (\int\, \bool\, \double\, \String\) gain an \obs()\ method to create simple \Observable\ wrappers, and \Observable\<bool\>\ gains a \toggle()\ method for convenient value flipping.
mobx/lib/src/api/extensions · high confidence
New login form example with reactive validation
Added a new example in the form module demonstrating a login/signup form that uses MobX for reactive state management. The FormStore manages observable fields for username, email, and password, along with an ObservableFuture for asynchronous username availability checks. Reactions automatically trigger validation logic when fields change, updating error states and computed properties like canLogin. The UI widgets use Observer to reactively display validation errors and a progress indicator during pending checks, with proper disposal of reactions in the widget's lifecycle.
_mobx\examples/lib/form · high confidence
New multi-counter example demonstrating dynamic store lists
Added a new example in the multi-counter location that demonstrates managing a dynamic list of observable stores. The MultiCounterStore maintains an ObservableList of SingleCounter instances, allowing users to add or remove individual counters. The UI uses Provider to inject the store and Observer widgets to reactively render the list of counters and their individual values, showing how to handle collections of stateful objects in a Flutter app.
_mobx\_examples/lib/multi\counter · high confidence
New settings example demonstrating dark mode persistence with MobX
Added a new settings example in the \mobx\_examples/lib/settings\ directory that showcases a \SettingsStore\ using MobX observables and actions to manage a dark mode toggle. The implementation includes a \PreferencesService\ backed by \shared\_preferences\ to persist the user's choice, a generated store file (\settings\_store.g.dart\) handling reactivity, and a \SettingsExample\ widget that uses an \Observer\ to reactively update a \SwitchListTile\ when the dark mode setting changes.
_mobx\examples/lib/settings · high confidence
New tooling scripts for coverage, API documentation, and version management
The \tool/\ directory now includes several new scripts to support development and publishing workflows. \coverage.sh\ automates running Dart tests and generating LCOV coverage reports for the \lib\ directory. \docs\_inventory.dart\ scans public exports from core packages (mobx, flutter\_mobx, mobx\_codegen, mobx\_lint) to generate or validate a JSON API reference file, ensuring documentation consistency. \expose\_version.dart\ reads the version from \pubspec.yaml\ and generates a \version.dart\ file, while \version\_lint.dart\ acts as a wrapper to run Melos version commands within the mobx\_lint package.
tool · high confidence
Project initialization and repository structure setup
The repository has been initialized with the core project files, including the MIT License, a comprehensive README with documentation and badges, and a CHANGELOG tracking versions for the \mobx\, \flutter\_mobx\, \mobx\_codegen\, and \mobx\_lint\ packages. The project is configured as a monorepo using Melos, with a \.gitignore\ updated to exclude Flutter-specific build artifacts (iOS/Android folders) and IDE files. Additionally, infrastructure files have been added to support CI/CD and community standards, including a \codecov.yml\ for coverage reporting, a \netlify.toml\ for site redirects, a \CODE\_OF\_CONDUCT.md\, and an \.all-contributorsrc\ to automatically manage contributor recognition in the README.
(repo-wide) · high confidence
Behavioural changes
Added clock example using MobX Atom for manual observation
The clock example in mobx\_examples/lib/clock has been updated to demonstrate manual observation using MobX's Atom API. The new clock.dart implementation replaces previous observable patterns with a Clock class that uses an Atom to manually report observation and changes, triggering a periodic timer that updates the time every second. The accompanying clock\_widgets.dart file provides a Flutter UI that wraps the clock in an Observer widget to display the formatted time, showing users how to integrate manual atom-based reactivity with Flutter's widget tree.
_mobx\examples/lib/clock · high confidence
Internal refactoring of core MobX source files
The internal implementation of the MobX library has been reorganized, with core components such as actions, atoms, computed values, contexts, derivations, observables, reactions, and spy utilities consolidated into a new core.dart entry point and its associated part files. This change also introduces updated exception handling classes (MobXException, MobXCyclicReactionException, MobXCaughtException) with improved toString implementations and adds utility functions for equality checking and delayed scheduling, alongside new interceptable and listenable interfaces to manage change notifications and interceptors more effectively.
mobx/lib/src · medium confidence
MobX code generator refactored to use the analyzer Element2 API with improved error reporting
The code generation engine in \mobx\_codegen\ has been rewritten to migrate from the legacy analyzer API to the newer Element2 model (required for analyzer \>= 7.4.0). This change updates the core visitor logic in \store\_class\_visitor.dart\ and the type resolution logic in \type\_names.dart\ to correctly handle import prefixes and nullability suffixes in generated code. Additionally, a new \errors.dart\ module has been introduced to provide structured, user-friendly validation messages for common store configuration mistakes, such as using \@observable\ on methods or \@computed\ on fields.
_mobx\codegen/lib/src · high confidence
MobX library restructured and updated to version 2.7.0
The mobx package has been reorganized with files moved into a dedicated mobx/ directory, and the main entry point (mobx.dart) now explicitly exports the core API components including actions, annotations (such as @readonly and @computed), async observables, and collection types. The library version has been updated to 2.7.0, reflecting recent changes and improvements in the state management system.
mobx/lib · high confidence
ReactiveContext now enforces configurable read and write policies
The core \ReactiveContext\ now exposes \ReactiveConfig\ with \readPolicy\ and \writePolicy\ settings, allowing you to enforce that observable reads happen only inside reactions/computeds (\ReactiveReadPolicy.always\) and that mutations occur only inside actions (\ReactiveWritePolicy.observed\ or \always\). These policies are applied via \enforceReadPolicy\ and \enforceWritePolicy\ in the new \atom\_extensions.dart\ and \context\_extensions.dart\, and the \ActionController\ and \conditionallyRunInAction\ helpers ensure state changes are properly batched and tracked. This gives you stricter control over state mutation and observation boundaries to catch unintended side effects early.
mobx/lib/src/core · high confidence
Replaced legacy code generation templates with a modular, object-oriented template system
The code generator's internal structure has been completely rewritten to use a new set of dedicated template classes (ActionTemplate, AsyncActionTemplate, ComputedTemplate, ObservableTemplate, etc.) instead of the previous string-based or monolithic approach. This change introduces support for advanced observable features such as late initialization, custom equality checks, and deep equality, while also enabling the generation of mixins for stores, async actions, and observable futures/streams. Additionally, the generated output now includes standardized analyzer ignore directives and improved handling of method parameters and type arguments.
_mobx\codegen/lib/src/template · high confidence
Reworked public API surface with new annotations and context support
The \mobx/lib/src/api\ module has been restructured to expose a cleaner, more configurable public API. Users can now define stores using the \Store\ mixin and configure them via the new \@StoreConfig\ annotation. Observable fields are declared with \@observable\ (or \@readonly\), supporting custom equality checks via the \equals\ parameter and deep equality for collections. Computed values use \@computed\ with an optional \keepAlive\ flag, and actions are marked with \@action\. The API now supports custom \ReactiveContext\ instances via \createContext()\, allowing parallel reactivity systems, and reactions (\autorun\, \reaction\, \when\) accept optional \scheduler\ and \onError\ parameters for finer control over execution and error handling.
mobx/lib/src/api · high confidence
Fixes
Redirect legacy MobX.dart site to new domain
A new HTML landing page has been added to the tool/netlify-redirect location to handle traffic for the legacy MobX.dart site. Visitors accessing this page are now presented with a message indicating that the project has moved, with a direct link to the new domain at mobx.vyuh.tech.
tool/netlify-redirect · high confidence
Test coverage
Added benchmark harness and regression test suites; Added comprehensive test suite for mobx\_codegen; Added test coverage for MobX examples gallery and TodoList store; Added test coverage for Observer, ReactionBuilder, and MultiReactionBuilder widgets; Added tests for observable extension methods; Added tests for the 'Wrap with Observer' code assist; Comprehensive test suite for MobX core primitives and collections; Expanded test coverage for code generation edge cases and annotations.
Dependencies
Release of mobx\_codegen version 2.8.0
This update releases mobx\_codegen version 2.8.0, establishing the new version constant in the library's entry point. The package now exposes a standard build configuration via builder.dart, which registers the StoreGenerator as a SharedPartBuilder, making the code generator ready for use with the build\_runner toolchain.
_mobx\codegen/lib · high confidence
Workspace restructure and dependency updates across MobX Dart packages
The repository has been restructured into a Melos monorepo workspace, introducing a root \pubspec.yaml\ that manages \mobx\, \flutter\_mobx\, \mobx\_codegen\, and \mobx\_examples\. This change updates the Dart SDK constraints to \\>=3.7.0\ (or \\>=3.9.0\ for examples) and upgrades core dependencies, including \analyzer\ to \^13.3.0\ in \mobx\_codegen\ and \^8.4.0\ in \mobx\_lint\, \mocktail\ to \^1.0.5\, and \provider\ to \^6.1.5+1\. The documentation site (\docs/\) has been migrated to VitePress with Vue 3, and the \flutter\_mobx\ package now requires \mobx ^2.7.0\.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 63 → 72 (+8.9)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 92 → 97 (+4.2)
- Architecture 97 → 88 (-8.6)
- Maturity 60 → 75 (+14.4)
- Readiness 51 → 67 (+15.4)
- Security 77 → 70 (-7.2)
- Domain Modelling 100 → 100 (+0.0)
Resolved (23)
- Change coupling: SponsorSection.tsx ↔ Testimonial.tsx (docs/src/components/home/SponsorSection.tsx)
- Change coupling: mobx_codegen_base.dart ↔ util.dart (mobx_codegen/lib/src/mobx_codegen_base.dart)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Dormant codebase
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- No exposed public API
- …and 3 more
New (63)
- Change coupling: observable.dart ↔ utils.dart (mobx/lib/src/core/observable.dart)
- Duplicated block (10 lines × 2) (mobx_codegen/lib/src/template/observable_future.dart)
- Duplicated block (15 lines × 2) (mobx_examples/lib/gallery/examples/async.dart)
- Duplicated block (15–17 lines × 2) (mobx_examples/lib/counter/counter_widgets.dart)
- Duplicated block (16 lines × 2) (mobx/lib/src/api/observable_collections/observable_list.dart)
- Duplicated block (7 lines × 2) (mobx/lib/src/api/observable_collections/observable_map.dart)
- Duplicated block (7 lines × 2) (mobx/lib/src/api/observable_collections/observable_map.dart)
- Duplicated block (7 lines × 2) (mobx_codegen/lib/src/template/observable_future.dart)
- FunctionTooLong: index.Home (docs/src/pages/index.tsx)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 43 more
Changes since last survey
- 30 commits — 24 feature/other, 6 fixes
By area
- docs/.vitepress — 9 commits
- (root) — 5 commits
- .github/workflows — 4 commits
- docs/package.json — 2 commits
- tool/cloudflare — 2 commits
- docs/public — 1 commit
- mobx/benchmark — 1 commit
- mobx/lib — 1 commit
- mobx_codegen/CHANGELOG.md — 1 commit
- mobx_examples/.gitignore — 1 commit
- mobx_examples/lib — 1 commit
- mobx_lint/CHANGELOG.md — 1 commit
- translation/zh-CN — 1 commit
Notable commits
- fix: fix(ci): resolve Flutter workspace during publishing and coverage
- fix: fix(deploy): retry transient Pages propagation errors
- fix: fix(docs): redirect legacy Netlify site to Cloudflare domain
- fix: fix(docs): show only the last updated date
- fix: fix(mobx): fix analyzer infos on beta channel (super parameters + collection contains) (#1081)
- fix: fix(web): include Flutter web entry point in clean builds
- change: Support analyzer v13 and v14 (#1078)
- change: Update README.md
- change: build(deps): bump axios from 1.15.0 to 1.18.0 in /docs (#1082)
- change: build(deps-dev): bump postcss from 8.5.4 to 8.5.18 in /docs (#1083)
- change: build: prepare Cloudflare Pages with bundled Flutter gallery
- change: chore(release): publish packages
- change: chore(release): publish packages
- change: chore(release): synchronize version metadata and publish core before dependents
- change: chore: add trailing newline to zh-CN README for consistency
- change: chore: add trailing newlines to markdown files for consistency
- change: chore: add trailing newlines to markdown files for consistency
- change: ci: build and deploy the Flutter documentation site from GitHub Actions
- change: ci: pause the GitHub website job during Cloudflare migration
- change: docs: add Birju Vachhani testimonial
- …and 10 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
mobxjs/mobx.dart was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit d5b739baaf654728244a4f674fe8cc5ce077501b — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.