CodeVetter · Repo Unpack · Extension points
mobxjs/mobx
Extension mechanisms are explicit interfaces and callback factories rather than a central runtime plugin loader. Observable annotations, enhancers, comparers, scheduling callbacks, and lifecycle hooks allow targeted customization. Package-level registries and shared configuration factories provide corresponding extension boundaries for lint rules and builds.
- Annotation defines make_ and extend_ contracts with MakeResult control flow; annotation maps accept an Annotation, true for the default, or false to skip a property.
- CreateObservableOptions supplies deep, equals, autoBind, name, and defaultDecorator controls; factory creation translates these into enhancer and default-annotation choices.
- createAtom exposes reportObserved/reportChanged and optional observation lifecycle callbacks, allowing custom resources to participate in dependency tracking without adopting an observable container.
- Interceptors form a disposable ordered handler chain; interceptChange snapshots handlers, runs untracked, accepts transformed changes, and stops when a handler cancels with a falsy return.
- Scheduling can be customized per autorun/reaction with scheduler or delay, or globally through configure.reactionScheduler; global replacement composes with the previous scheduler.
- Reaction error handling supports a local constructor handler and a disposable global onReactionError registry; the development tools hook receives spy, getDebugName, and $mobx.
- New ESLint rules plug into the named rules table, with recommended severity configured separately; individual modules expose ESLint create visitors, metadata, diagnostics, and optional fixes.
- Build packages reuse createRollupConfig with input, packageName, packageBase, and globals; the codemod separately exposes a parser and transform with configurable import/decorator/TS parsing behavior.