Skip to content

feat: add framework-agnostic store engine - #63

Open
Akryum wants to merge 20 commits into
mainfrom
feat/core-data-store
Open

Akryum wants to merge 20 commits into
mainfrom
feat/core-data-store

Conversation

@Akryum

@Akryum Akryum commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator
  • Move cache storage and merge logic into core store-engine modules
  • Bridge Vue cache through fine-grained signals for item, list, and relation updates
  • Add store-engine tests for writes, layers, observers, tombstones, serialization, and CRDT behavior
  • Add Vue cache granularity coverage and legacy benchmarks

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new framework-agnostic storage engine under packages/core/src/store-engine and refactors the Vue package to act as a thin reactivity bridge over it. This architecture provides fine-grained reactivity, ensuring that single-item writes do not trigger full collection list re-runs. The review feedback highlights several critical issues, including memory leaks in the Vue cache bridge (due to signals not being dropped on item eviction or cache reset), a bug in index mapping where explicit null updates are ignored, a bug in replaceModuleContents when handling arrays, a performance bottleneck in clearCollection due to multiple synchronous flushes, and dangling timers in the staggering controller upon engine disposal.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/vue/src/cache.ts Outdated
Comment thread packages/vue/src/cache.ts Outdated
Comment thread packages/core/src/store-engine/resolve.ts Outdated
Comment thread packages/core/src/store-engine/serialize.ts Outdated
Comment thread packages/core/src/store-engine/engine.ts
Comment thread packages/core/src/store-engine/queue.ts Outdated
Comment thread packages/core/src/store-engine/engine.ts
@pkg-pr-new

pkg-pr-new Bot commented Jun 4, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@rstore/connector-toolkit

npm i https://pkg.pr.new/directus/rstore/@rstore/connector-toolkit@63

@rstore/core

npm i https://pkg.pr.new/directus/rstore/@rstore/core@63

@rstore/devtools

npm i https://pkg.pr.new/directus/rstore/@rstore/devtools@63

@rstore/directus

npm i https://pkg.pr.new/directus/rstore/@rstore/directus@63

@rstore/monospace

npm i https://pkg.pr.new/directus/rstore/@rstore/monospace@63

@rstore/nuxt

npm i https://pkg.pr.new/directus/rstore/@rstore/nuxt@63

@rstore/nuxt-directus

npm i https://pkg.pr.new/directus/rstore/@rstore/nuxt-directus@63

@rstore/nuxt-drizzle

npm i https://pkg.pr.new/directus/rstore/@rstore/nuxt-drizzle@63

@rstore/nuxt-monospace

npm i https://pkg.pr.new/directus/rstore/@rstore/nuxt-monospace@63

@rstore/nuxt-multiplayer

npm i https://pkg.pr.new/directus/rstore/@rstore/nuxt-multiplayer@63

@rstore/nuxt-multiplayer-server

npm i https://pkg.pr.new/directus/rstore/@rstore/nuxt-multiplayer-server@63

@rstore/offline

npm i https://pkg.pr.new/directus/rstore/@rstore/offline@63

@rstore/shared

npm i https://pkg.pr.new/directus/rstore/@rstore/shared@63

@rstore/vite-directus

npm i https://pkg.pr.new/directus/rstore/@rstore/vite-directus@63

@rstore/vite-monospace

npm i https://pkg.pr.new/directus/rstore/@rstore/vite-monospace@63

@rstore/vue

npm i https://pkg.pr.new/directus/rstore/@rstore/vue@63

commit: 943cb24

@Akryum
Akryum force-pushed the feat/core-data-store branch 2 times, most recently from 8cbc12c to a746816 Compare June 26, 2026 08:56
@Akryum
Akryum force-pushed the main branch 2 times, most recently from fe9642d to 79c6168 Compare July 3, 2026 22:40
@Akryum
Akryum force-pushed the feat/core-data-store branch 2 times, most recently from 851370b to a39ad93 Compare August 29, 2026 09:39
@Akryum
Akryum force-pushed the feat/core-data-store branch 2 times, most recently from 451bd8c to 60bcbd0 Compare September 15, 2026 10:15
@Akryum
Akryum force-pushed the feat/core-data-store branch 2 times, most recently from 67aca6e to de62e09 Compare October 25, 2026 17:38
Akryum and others added 17 commits October 26, 2026 12:35
- Move cache storage and merge logic into core store-engine modules
- Bridge Vue cache through fine-grained signals for item, list, and relation updates
- Add store-engine tests for writes, layers, observers, tombstones, serialization, and CRDT behavior
- Add Vue cache granularity coverage and legacy benchmarks
…e cases

- Release item signals + engine observers on delete/GC/reset to stop
  unbounded subscription growth; add SignalRegistry.size() introspection
- Drop an item from its index bucket when an indexed field is cleared to
  null, while preserving partial-update inheritance for untouched fields
- Truncate array module state in place on setState/clear to avoid stale
  slots and holes
- Batch clearCollection deletes behind a single flush (was O(N) observer
  dispatches)
- Cancel the staggering budget-reset timer on engine dispose so it can't
  re-drive a torn-down engine

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Port main's Vue cache features onto the store engine after rebasing:
- engine: queued prune, operation receipts, diagnostics inspection,
  write-dropped callback, committed-row reads, included relation tracking,
  tombstone maxSize, caller key form on tombstones
- engine: publish each staggered writeItems slice; marker and hooks stay
  at batch end
- vue: saved query state retention, page refs across getState/setState,
  absence write generations, dispose hook, unwritten wrapper release
- drop superseded vue cache modules and adapt tests to engine semantics
- nuxt: depend on h3 1.x so generated types do not pick the hoisted h3 2
  pulled in by Devframe
@Akryum
Akryum force-pushed the feat/core-data-store branch from de62e09 to 0befe73 Compare October 26, 2026 11:35
…ands

findFirst wraps its response before the queued cache write commits. The
first read of that wrapper activated its item cell even though the engine
had no row, and readItem's wrapper fast path then served it as cached
while the cache was paused. Only activate cells for committed rows; an
unwritten result stays dormant on its fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant