The inspector functionality can be used on the theme editor itself, which can add a lot of extra configurability.
In fact, it started out as a part of a single document that could be inspected like everything else. When the frame was added, at first the inspector would allow to inspect either the main or frame document at any time. However when history for inspections was added, it became too complicated to justify this.
Additionally, for this inspection to fully work it has to allow inspecting also the inspector itself, which worked but was very clunky and impossible (or very hard) to immediately see the result of many changes. So using a separate inspector for this makes sense anyway.
Challenges:
Tech debt in the inspector components: much logic will be the same, but some may be entirely different. Currently, there's only a few very complex components involved that would need to be refactored and split up. It's also heavily coupled with the inspection logic.
Performance: Although memory for now seems fine (even after storing hundreds of actions on a complex site), I didn't yet pay much attention to how much is stored per inspection, and whether de facto unreachable things are really cleaned up. On the bright side, it should be significantly less expensive overall, as no big messages have to be sent between frames, which involves serializing and immediately deserializing the contents. Still it now means storing 2 sets of inspection results.
Inline styles: Much styles are handled by simple style attributes through React. This is mostly because there's not much structure to the CSS yet, as the existential crisis resulting from seeing just about any kind of CSS approach in the editor made it even harder to make choices.
Styles of the inspected page: These are now all included in the editor too, leading to sometimes interesting and even great looking results, definitely a lot of inspiration, but also ugly and hard to use results. I do want to keep this, but it should probably be optional.
The inspector functionality can be used on the theme editor itself, which can add a lot of extra configurability.
In fact, it started out as a part of a single document that could be inspected like everything else. When the frame was added, at first the inspector would allow to inspect either the main or frame document at any time. However when history for inspections was added, it became too complicated to justify this.
Additionally, for this inspection to fully work it has to allow inspecting also the inspector itself, which worked but was very clunky and impossible (or very hard) to immediately see the result of many changes. So using a separate inspector for this makes sense anyway.
Challenges: