Inwerpsel / use-theme-editor

A React theme editor
GNU General Public License v3.0
4 stars 0 forks source link

Separate editor and frame JS #13

Open Inwerpsel opened 1 year ago

Inwerpsel commented 1 year ago

Current situation

Currently, to cut some corners and to ensure it uses the same build, the same script is run both for the editor and inside the iframe.

This causes double work, and makes the script more complex than it has to be for both cases.

The script also grew over time to support multiple small cases, and should probably be revised and split up.

Luckily, everything can be simplified a lot, as postMessage is not needed to interact with and read data from the frame. All code that was written under that false assumption can be moved to the main window quite easily. Shouldn't be much left after that is done.