main thread => convert StudioDom to TSX code, stored in cache, signal sandbox
service worker => convert cached code to ES5 to be runnable by the browser
sandbox => HMR engine receive updates from main thread, reload changed modules through service worker
Future:
main thread => send StudioDom updates to worker thread
worker thread =>
maintain mirror of StudioDom
keep up to date through small updates received from main thread
generate application code, store in indexeddb
signal serviceworker for updated files
serviceworker =>
to serve files: read from indexeddb, convert files to ES5, (cache?)
signal connected clients on updates
sandbox => HMR receive updates through serviceworker, reload changed modules, apply changes with react-refresh
Rough ideas on editor sandbox architecture
currently:
main thread => convert StudioDom to TSX code, stored in cache, signal sandbox service worker => convert cached code to ES5 to be runnable by the browser sandbox => HMR engine receive updates from main thread, reload changed modules through service worker
Future:
main thread => send StudioDom updates to worker thread worker thread =>
serviceworker =>
sandbox => HMR receive updates through serviceworker, reload changed modules, apply changes with
react-refresh