LearnNewsExamplesServices
Frontmatter
id9452
titleConnection Foundation and Parser Refactoring
stateClosed
labels
enhancementaiarchitecturecore
assigneestobiu
createdAtMar 12, 2026, 7:22 PM
updatedAtMar 24, 2026, 4:06 PM
githubUrlhttps://github.com/neomjs/neo/issues/9452
authortobiu
commentsCount1
parentIssue9449
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 24, 2026, 4:06 PM

Connection Foundation and Parser Refactoring

Closed v12.1.0 enhancementaiarchitecturecore
tobiu
tobiu commented on Mar 12, 2026, 7:22 PM

Goal

Establish the Neo.data.connection.Base hierarchy and fix the abstraction leak in Neo.data.parser.Stream by extracting its network transport logic.

Context

A Parser should strictly focus on deserialization and shaping data (e.g., converting a text stream into JSON records). Currently, Neo.data.parser.Stream has fetch() and AbortController logic hardcoded into its read() method. This makes it a Connection in disguise and violates the single responsibility principle.

Acceptance Criteria

  • Create src/data/connection/Base.mjs.
  • Refactor Neo.data.connection.Fetch and Xhr to extend this new Base class.
  • Create a new Connection (e.g., connection.Stream or enhance connection.Fetch) that handles the fetch() request and returns the ReadableStream.
  • Refactor Neo.data.parser.Stream: Remove the fetch() call. The parser should now accept the ReadableStream provided by the Connection, process the NDJSON/JSONL chunks, and yield records.
  • Ensure the Pipeline class correctly routes the output of the Connection into the Parser.
tobiu added the enhancement label on Mar 12, 2026, 7:22 PM
tobiu added the ai label on Mar 12, 2026, 7:22 PM
tobiu added the architecture label on Mar 12, 2026, 7:22 PM
tobiu added the core label on Mar 12, 2026, 7:22 PM
tobiu added parent issue #9449 on Mar 12, 2026, 7:23 PM
tobiu cross-referenced by #9449 on Mar 12, 2026, 7:24 PM
tobiu assigned to @tobiu on Mar 12, 2026, 7:25 PM
tobiu changed title from Implement Thread-Agnostic Execution Mode for Connections to Connection Foundation and Parser Refactoring on Mar 12, 2026, 10:02 PM
tobiu referenced in commit 6b7f19e - "feat: Connection Foundation and Parser Refactoring (#9452) on Mar 24, 2026, 4:06 PM
tobiu
tobiu Mar 24, 2026, 4:06 PM

Input from Gemini 3.1 Pro:

✦ I have extracted the fetch() network logic out of Neo.data.parser.Stream into a newly established Neo.data.connection.Stream class. The parser now expects a ReadableStream passed into its read(rawData) method.

This establishes the Neo.data.connection.Base hierarchy. The existing Fetch and Xhr connections have been updated to extend this base class and now implement a consistent read() method.

The pipeline architecture has been fortified with clear boundaries (Connection -> Parser -> Normalizer), adhering to the single responsibility principle. Tests for both the new connection and refactored parser have been updated/added and pass successfully.

tobiu closed this issue on Mar 24, 2026, 4:06 PM