Skip to content

Validate archetype ids on fromData restore and add space option to serializeToJSON - #278

Merged
krisnye merged 1 commit into
mainfrom
krisnye/fromdata-archetype-validate-compact-json
Nov 16, 2026
Merged

krisnye merged 1 commit into
mainfrom
krisnye/fromdata-archetype-validate-compact-json

Conversation

@krisnye

@krisnye krisnye commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • fromData archetype-id validation (@adobe/data/ecs): Validate allocated occupied slots in serialized entity-location tables before mutating store state on restore, throwing an error naming the entity index and archetype id when a slot references an out-of-range archetype id (whether archetypesData is populated or empty) while leaving the store unchanged.
  • serializeToJSON spacing option (@adobe/data/functions): Add SerializeToJSONOptions ({ space?: number | string }, defaulting to 2) to serializeToJSON so callers can emit compact single-line JSON ({ space: 0 } / { space: "" }) or custom indentation while round-tripping through deserializeFromJSON.
  • Version: Bump publishable packages to 0.10.35.

Verification

  • Red/green unit and regression tests for remapSerializedArchetypeIds and store.fromData (id past archetypesData.length, id that would alias a live archetype, and empty archetypesData).
  • Unit tests for serializeToJSON default pretty-printed output, compact output, custom indentation, and deserializeFromJSON round-tripping.
  • Clean monorepo typecheck, lint, build, docs, and full @adobe/data + @adobe/data-persistence test suites.

…rializeToJSON; bump 0.10.35

Co-Authored-By: OpenCode <noreply@opencode.ai>
@krisnye
krisnye merged commit 062d082 into main Nov 16, 2026
3 checks passed
@krisnye
krisnye deleted the krisnye/fromdata-archetype-validate-compact-json branch November 16, 2026 17:38
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