aframe-inspector icon indicating copy to clipboard operation
aframe-inspector copied to clipboard

History lib doesn't account for some types of changes

Open klyap opened this issue 2 years ago • 2 comments

Problem: I'm trying to use inspector with aframe-watcher to update my local files with changes I make with AFrame inspector. However, I noticed that some types of changes don't get written:

  1. Component is added or removed
  2. Entity is added or removed

Potential cause: From my best understanding, the way it works is when a change in inspector happens, it fires an "entityupdate" event. This is listened to in the history.js file and recorded. When the save button is pressed, it makes a request to aframe-watcher with the contents of what has been recorded in AFRAME.INSPECTOR.history.updates.

It seems like the "entityupdate" event is not fired when these additions / removals are done in inspector.

klyap avatar Feb 14 '23 01:02 klyap

The scope of aframe-watcher is to update only existing entities because it's based on the entity id. https://github.com/supermedium/aframe-watcher#scope I'm not sure if adding or removing components on an existing entity is in the scope of the supported features. aframe-watcher didn't get updates for years. I didn't even know it was still working. I usually do my own build of aframe-inspector to remove the save button.

vincentfretin avatar Feb 15 '23 09:02 vincentfretin