Skip to main content

Persistence and JSON Canvas

What the engine exports, validates, normalizes, and deliberately excludes.

exportDocument() returns committed JSON Canvas data. It excludes transient interaction, DOM measurements, subscribers, and history stacks.

loadDocument(unknown, options) validates and normalizes the entire input before publication. A rejected candidate leaves the current board unchanged.

Persistence laboratory

Unknown input is validated before it can replace the committed document.

Try this Load the invalid example, import it, then inspect the board and error. Fix or reset the payload to commit again.

Relevant code
const document = engine.exportDocument()\n\n// loadDocument accepts unknown and validates the full boundary.\nengine.loadDocument(candidate, { mode: 'replace' })

Load the invalid example in the lab. The error is reported without destroying the current document. A valid import is normalized and then committed once.

Core owns JSON Canvas nodes. The connections plugin owns its edge extension. If the application has richer domain state, choose one canonical application model and derive board records rather than persisting competing copies.