Repository navigation
mobx-view-model 11 - #88
Conversation
There was a problem hiding this comment.
2 existing issues remain and 8 new issues found across 416 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/vite-plugin/package.json">
<violation number="1" location="packages/vite-plugin/package.json:52">
P2: This range now advertises v11 support, but nothing in this PR verifies the plugin works against v11. The plugin injects runtime code that depends on mobx-view-model internals (`viewModelsConfig.hooks.storeCreate`, `sub`, `lastPub`, `store.viewModels` in store-access.ts), and the plugin's tests run only against the v10 workspace packages (no devDependencies here). If the v11 major changed any of those internals, users on v11 get broken HMR/runtime code while npm considers the peer satisfied. Verify the injected API surface against v11, or add a test/CI matrix entry that runs the plugin against the v11 packages before widening the peer contract.</violation>
</file>
<file name="docs/other/dev-tools.md">
<violation number="1" location="docs/other/dev-tools.md:99">
P3: The new rule "The automatic script and the Vite plugin connect stores for you" contradicts the unchanged "Development-only setup" example at the bottom of this file, which loads `auto.global.js` and then manually calls `ViewModelDevtools.connect(viewModelStore)` in `script.onload`. Users following that section will do the opposite of the new guidance (redundant/double connection). Align the sections: if the auto script auto-connects, drop the manual `connect()` call from the "Development-only setup" example; otherwise, drop the new claim.</violation>
</file>
<file name=".changeset/funky-coins-read.md">
<violation number="1" location=".changeset/funky-coins-read.md:7">
P3: The description uses a backslash as a separator: `react\solid contexts creation`. Changeset summaries are published verbatim into the changelog, so the release notes would render the garbled `react\solid`. Use `react/solid` or `react-solid`.</violation>
</file>
<file name="docs/api/view-models/overview.md">
<violation number="1" location="docs/api/view-models/overview.md:22">
P3: The example's `private userData = /* some data source */;` is not valid TypeScript — a class field initializer cannot be empty (`Expression expected` after `=`). The getters below also read `this.userData.fullName`, so `userData` needs a concrete type to compile. Give the field a real or asserted initializer, e.g. `private userData = null as unknown as { fullName?: string; isLoading: boolean };`.</violation>
</file>
<file name="docs/introduction/usage/with-view-model-store.md">
<violation number="1" location="docs/introduction/usage/with-view-model-store.md:23">
P3: This relative import won't resolve from the React root component: the store is defined (per section 1's fence title) at `/src/shared/lib/mobx/view-model-store.ts`, and `App` is not co-located with it. The same doc uses the `@/` alias elsewhere (e.g. section 4's `@/app-layout`), so import via that alias, or qualify the path relative to the reader's App file.</violation>
</file>
<file name="docs/index.md">
<violation number="1" location="docs/index.md:20">
P2: The icon class changed from `i-logos:mobx-icon` to `i-logos:mobx`. The Iconify `logos` collection names this icon `mobx-icon` (the previous value, still used by the v9/v10 home pages next to `typescript-icon`), and plain `mobx` is not a known entry — the icon will render empty or fail the docs build. Verify the icon name in `@iconify-json/logos` and revert to `mobx-icon` if `mobx` is absent.</violation>
</file>
<file name="docs/recipes/integration-with-root-store.md">
<violation number="1" location="docs/recipes/integration-with-root-store.md:51">
P2: This `create` override drops store-level `vmConfig` (and `config.factory`): unlike `super.create`, it passes the raw `config` straight to `new VM(...)`, so `this.vmConfig` set on the store (e.g. `useDecorators`, `startViewTransitions`, `resource`) is silently ignored for these VMs. Follow the library's own example (examples/csr-react18/src/shared/lib/vm-store.ts) and merge store config before constructing.</violation>
</file>
<file name="packages/solid/vitest.config.ts">
<violation number="1" location="packages/solid/vitest.config.ts:20">
P2: `coverage.include: ['src']` is a bare directory pattern, but vitest matches coverage include entries as globs against file paths relative to the package root, so `src/...` files do not match the literal pattern `src` and the coverage report comes back empty. Use `src/**/*.{ts,tsx}` (or at least `src/**`).</violation>
</file>
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Requires human review: Auto-approval blocked because this review re-detected 4 unresolved issues already reported by Cubic.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 22 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 30 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 21 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 24 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Summary by cubic
Splits
mobx-view-modelinto a framework-agnostic core with React bindings inmobx-view-model-react, adds SolidJS support via a newmobx-view-model-solidpackage, and migrates docs todocusitewith versioned v9/v10 content. The ViewModel lifecycle is hardened to fix React 19lazy/Suspenseduplication and orphaning, and framework contexts are namespaced to support microfrontends.mobx-view-model-solid(powered bymobx-solid):withViewModel,withPropsViewModel,useCreateViewModel,useViewModel,ViewModelsProvider,OnlyViewModel.useCreateViewModel; regression tests for React 19lazy/Suspense.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.docusite; Solid guides added; new Error Version Packages #4 (view already wrapped); v9/v10 versioned content.Migration/Review notes
mobx-view-model-react; keep core types inmobx-view-model. Usemobx-view-model-solidfor Solid.withViewModel(VM, View, config?)and pass a plain View; do not pre-wrap withobserverorReact.memo.create()instead ofcreateViewModel()and provide an ID when customizing the factory flow.Written for commit 35e9336. Summary will update on new commits.