Add seekable bounded JSON array import source

This commit is contained in:
2026-11-09 17:50:35 +08:00
parent 46fabafca8
commit c4dfaf50a5
4 changed files with 55 additions and 0 deletions
+9
View File
@@ -328,3 +328,12 @@ transform. Unchanged nodes reuse their geometry result; removed nodes release
cache entries. Viewport queries reuse the grid. `clear()` discards it. The cache
still scans projected nodes and synchronizes rectangle membership; it is not a
claim of constant-time full-frame updates or complete region-based drawing.
`createJsonArrayImportSource` is a seekable parser building block for a UTF-8 JSON
array, with byte cursors, bounded record payloads, structural depth limits and
abort/yield checks. It uses parserVersion 3 and can feed a host-managed generic
ImportRunner. It does not yet interpret the exported document envelope, and
ProjectEngine's persisted imports/UI still accept their existing formats only.
A malformed structural tail ends with an explicit failure; previously emitted
records remain available. Empty source bytes reject, while `[]` is a valid empty
array. Array record errors are distinct from document schema/reference failures.