Documentation
    Preparing search index...

    Variable PACKAGE_NAMEConst

    PACKAGE_NAME: "@fourjs/serialization"

    @fourjs/serialization — the §79 scene document and its §80 migrations.

    Three modules: format.ts is the document (types, canonical validation, JSON text), serializer.ts turns a live scene graph into one and back through a per-type component-serializer registry, and migration.ts upgrades older documents.

    const registry = createDefaultComponentSerializers();
    const text = encodeSceneDocument(serializeScene(scene, registry));
    // … later, possibly from an older build:
    const document = migrateSceneDocument(JSON.parse(text), migrations);
    const reloaded = instantiateScene(document, registry);

    That sample is enough for a Scene of Groups. A graph that holds a Renderable, Text, camera, or light needs registerSceneNodeTypes() from the umbrella — this package cannot name those classes (§3.1). Without that pair, serializeScene throws rather than dropping the node.