mobx-view-model 11
Merged
JS
12d ago+19796+19796+01234567890123456789012345678901234567890123456789-4876-4876-0123456789012345678901234567890123456789
Summary by cubic
Splits mobx-view-model into a framework-agnostic core with React bindings in mobx-view-model-react, adds SolidJS support via a new mobx-view-model-solid package, and migrates docs to docusite with versioned v9/v10 content. The ViewModel lifecycle is hardened to fix React 19 lazy/Suspense duplication and orphaning, and framework contexts are namespaced to support microfrontends.
- Solid bindings in
mobx-view-model-solid(powered bymobx-solid):withViewModel,withPropsViewModel,useCreateViewModel,useViewModel,ViewModelsProvider,OnlyViewModel. - React lifecycle: explicit Suspense retry-loop detection; stabilized mount/unmount and staged vs committed disposal; SSR mode for
useCreateViewModel; regression tests for React 19lazy/Suspense. - Store/API:
define(),create(),connect(),unmount(),generateId()replace the attachment lifecycle; stores support an optionalresourcedata source; automatic global ID generation removed;vmmetadata exposesvm.stateandvm.data;processRenderreplacesprocessViewComponent; payload comparison uses a configurable comparer; thedisableWrappingoption was removed. - React/Solid contexts are namespaced per framework and stay microfrontend-friendly; SSR is supported and tested for both bindings.
- Docs: migrated to
docusite; Solid guides added; new Error #4 (view already wrapped); v9/v10 versioned content.
Migration/Review notes
- Import React bindings from
mobx-view-model-react; keep core types inmobx-view-model. Usemobx-view-model-solidfor Solid. - Call
withViewModel(VM, View, config?)and pass a plain View; do not pre-wrap withobserverorReact.memo. - In custom stores, override
create()instead ofcreateViewModel()and provide an ID when customizing the factory flow. - Base implementations now always apply MobX annotations; provide a custom annotation function if you previously disabled wrapping.