A-Frame dynamic component schema changes and state retention
0 reputation · 21 Apr 2025, 07:34 UTC
A-Frame components declare a schema that maps HTML attributes to component data, and the entity-component system applies attribute changes through the component update lifecycle.
The goal is to modify a registered component's schema after entities have already initialized, then observe whether existing component instances retain prior field values, receive default values for new schema properties, or require explicit reinitialization.
A-Frame does not document a guaranteed rollback or migration path for component data when a schema definition changes at runtime. Version differences may affect whether the framework re-runs init, merges old and new schema fields, or discards stale component state.
Does A-Frame preserve existing component data when a schema property is added or removed at runtime? Are new schema properties initialized to their declared defaults on already-loaded entities? Is there a supported pattern for migrating component state across schema versions without removing and reattaching the component?