Hacker News new | ask | show | jobs
by gamw_mana_sou 2973 days ago
I have started prototyping a similar UI concept on top of Vue.js

I'd like to ask you how did you manage to support all those JavaScript frameworks in one go? It's still very possible for me to revert to vanilla js instead of getting locked into Vue.js

1 comments

The way it is getting along with other frameworks is that makes as little asumptions as possible. So layerJS will only deal with divs that have the attribute "lj-type". The it will only show, animate or hide them. There are a few exceptions to this but that's basically it. So if another framework like vue modifies other elements on the page its free to do so. layerJS actually has a few mutation observers lurking around to see if the dimensions of frames or stages change to adapt the view accordingly. So that means that other frameworks can modify the DOM the way they want and layerJS will adapt. If there may be some hickups in special cases, please let us know so we can fix it.
How well does it work with Shadow DOM? Do the mutation observers get created on attachShadow()?
basically layerJS will reparse if it detects a change rigth inside one of its objects. This works for example in a vuejs app we create. If the framework actually rebuilds the whole DOM hierarchy the layerJS parse would need to be triggered manually. Let me know if you get into this situation so we can tackle it.