Can A-Frame's Global Component Registration Be Scoped Per-Embed Instance?
0 reputation · 14 Jan 2025, 00:25 UTC
A-Frame's component registration model, consistent across the 1.x release series, registers definitions on the AFRAME global namespace, meaning a component name declared in one script becomes available to all subsequent scripts on the same document. This design enables rapid prototyping but creates a known risk of naming collisions when multiple A-Frame bundles or third-party scripts share a page, especially in publicly embedded scenes where asset URLs and logic may be exposed through normal browser fetch behavior.
The framework provides mixins and systems as documented mechanisms for grouping properties and reusing behavior without duplicating markup, yet these mechanisms operate within the same global registration model and do not inherently scope component names or isolate asset access per embed instance. The behavior of mixin inheritance under concurrent script loading and its interaction with the AFRAME namespace remains an area where documented guidance is sparse.
Does A-Frame's mixin system scope component names to the embedding document, or do definitions leak across independently loaded bundles? Which documented feature can restrict asset URL exposure for embedded scenes without requiring server-side configuration changes? Can component name collisions be avoided at runtime when two A-Frame scripts register definitions with identical names on the same page?