Not sure whether you have considered it before, but FWIW that's how re-frame-10x [does it](https://github.com/day8/re-frame-10x/blob/e7105ccc00b8458cdb2e5696eecc4b8602b53bca/src/day8/re_frame_10x/tools/shadow_dom.cljs).