LearnNewsExamplesServices
Frontmatter
id9550
titleRefactor(data): Implement Store-to-Pipeline Legacy Bridge
stateClosed
labels
airefactoringarchitecturecorefeature
assigneestobiu
createdAtMar 25, 2026, 4:23 PM
updatedAtMar 25, 2026, 4:28 PM
githubUrlhttps://github.com/neomjs/neo/issues/9550
authortobiu
commentsCount1
parentIssue9449
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 25, 2026, 4:28 PM

Refactor(data): Implement Store-to-Pipeline Legacy Bridge

Closed v12.1.0 airefactoringarchitecturecorefeature
tobiu
tobiu commented on Mar 25, 2026, 4:23 PM

Goal

Implement a clean, reactive bridge in Neo.data.Store to automatically transition "simple" stores using the url config to the new Pipeline architecture without breaking existing applications.

Context

Following the removal of the implicit legacy bridge in Store.mjs (#9502), many existing stores that relied on the url config without an explicit pipeline began failing. To maintain a lean App Worker dependency graph while preserving backward compatibility, we need a mechanism that dynamically creates a pipeline only when needed.

Changes

  • Reactive Legacy Bridge: Modified beforeSetPipeline in Store.mjs to detect when a url is provided without an explicit pipeline or api. In this case, it triggers a dynamic import of Neo.data.connection.Xhr and generates a "dummy" pipeline configuration.
  • Race Condition Prevention: Introduced me.urlPipelinePromise to handle the asynchronous gap between the dynamic import and the initial load() or autoLoad execution.
  • Enhanced Load Flow:
    • load() now awaits urlPipelinePromise if it exists.
    • Improved result extraction to correctly handle responseRoot and nested JSON structures.
    • Added safety checks for undefined or null responses from the pipeline to prevent runtime errors.
  • Cleanup: Removed the broken Neo.Xhr.promiseJson fallback at the bottom of the load() method, leaving only the Node.js fs/promises fallback for non-browser environments.

Acceptance Criteria

  • Stores using only the url config (like Portal.store.Releases) function correctly via a dynamically created pipeline.
  • Race conditions during autoLoad are prevented via the urlPipelinePromise.
  • Store.load() is more robust and correctly extracts data from diverse pipeline responses.
  • The App Worker remains lean by only importing connection.Xhr on-demand.
tobiu added the ai label on Mar 25, 2026, 4:23 PM
tobiu added the refactoring label on Mar 25, 2026, 4:23 PM
tobiu added the architecture label on Mar 25, 2026, 4:23 PM
tobiu added the core label on Mar 25, 2026, 4:23 PM
tobiu added the feature label on Mar 25, 2026, 4:23 PM
tobiu added parent issue #9449 on Mar 25, 2026, 4:24 PM
tobiu cross-referenced by #9502 on Mar 25, 2026, 4:25 PM
tobiu referenced in commit 9a61232 - "refactor(data): Implement Store-to-Pipeline Legacy Bridge (#9550)" on Mar 25, 2026, 4:26 PM
tobiu assigned to @tobiu on Mar 25, 2026, 4:26 PM
tobiu
tobiu Mar 25, 2026, 4:27 PM

Input from Gemini 3.1 Pro:

✦ I have successfully implemented the Store-to-Pipeline legacy bridge.

Summary of changes:

  • Reactive Legacy Bridge: Modified beforeSetPipeline in Store.mjs to automatically create a connection-xhr pipeline if url is defined without a pipeline or api.
  • Race Condition Prevention: Added me.urlPipelinePromise to handle the asynchronous gap when importing the XHR connection, ensuring load() and autoLoad await the bridge completion.
  • Robust Load Flow: Enhanced load() to handle diverse pipeline responses, correctly extracting data based on responseRoot and providing safety checks for null/undefined results.
  • Legacy Cleanup: Removed the broken Neo.Xhr.promiseJson fallback from Store.load().

The portal app's store-driven views are now back online.

Task complete. (#9550)

tobiu closed this issue on Mar 25, 2026, 4:28 PM