LearnNewsExamplesServices
Frontmatter
id8242
title[Neural Link] Implement toJSON in data.Store
stateClosed
labels
enhancementai
assigneestobiu
createdAtDec 31, 2025, 5:01 PM
updatedAtDec 31, 2025, 5:10 PM
githubUrlhttps://github.com/neomjs/neo/issues/8242
authortobiu
commentsCount1
parentIssue8200
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 31, 2025, 5:10 PM

[Neural Link] Implement toJSON in data.Store

Closed v11.18.0 enhancementai
tobiu
tobiu commented on Dec 31, 2025, 5:01 PM

Implement the toJSON method in src/data/Store.mjs to support the Neural Link serialization protocol.

It should return an object containing:

  • Properties from super.toJSON() (which includes filters, sorters, count)
  • autoInitRecords
  • autoLoad
  • currentPage
  • initialChunkSize
  • isGrouped
  • isLoaded
  • isLoading
  • model: The model class name or config
  • pageSize
  • remoteFilter
  • remoteSort
  • totalCount
  • url

Note: We are NOT serializing the data array here, as Collection.toJSON already excludes items to avoid performance issues. Data inspection is a separate concern.

tobiu added the enhancement label on Dec 31, 2025, 5:01 PM
tobiu added the ai label on Dec 31, 2025, 5:01 PM
tobiu added parent issue #8200 on Dec 31, 2025, 5:02 PM
tobiu assigned to @tobiu on Dec 31, 2025, 5:04 PM
tobiu referenced in commit 35f26b6 - "feat(data): Implement toJSON in Model and Store for Neural Link (#8241, #8242)" on Dec 31, 2025, 5:08 PM
tobiu
tobiu Dec 31, 2025, 5:09 PM

Input from Gemini:

✦ I have implemented the toJSON method in src/data/Store.mjs. It returns:

{
    ...super.toJSON(),
    autoInitRecords : this.autoInitRecords,
    autoLoad        : this.autoLoad,
    currentPage     : this.currentPage,
    initialChunkSize: this.initialChunkSize,
    isGrouped       : this.isGrouped,
    isLoaded        : this.isLoaded,
    isLoading       : this.isLoading,
    model           : this.model?.toJSON(), // Recursive serialization of the model
    pageSize        : this.pageSize,
    remoteFilter    : this.remoteFilter,
    remoteSort      : this.remoteSort,
    totalCount      : this.totalCount,
    url             : this.url
}

Note: As with Collection, we deliberately exclude the record data itself from this serialization to prevent performance issues with large datasets. Data inspection should use getRecord or other specialized tools.

tobiu closed this issue on Dec 31, 2025, 5:10 PM
tobiu referenced in commit c3bd5ac - "docs(issue): Close tickets #8241, #8242" on Dec 31, 2025, 5:33 PM