I recently built an instance of Paraview-Glance as I wished to customize the interface. While doing that, I saw that almost all of the DOM was being created by a JS script. Can somebody please share why this design decision was taken? Why would you not create a template HTML and only change certain parts of DOM using JS?
It is my assumption that the creators of the script had very good reasons to design it in such a way. I would really like to learn that please.
Glance is built using vue.js, which helps decompose a complex UI into smaller, manageable, and reusable snippets of HTML/CSS/JS. Essentially, from a developer’s perspective, one can focus on working on one aspect of a UI/UX (e.g. a TreeView, for example) in relative isolation, as well as reuse that in various locations in an application.
You could build upon this same “reusable component” concept with vanilla JS, but that’s not a discussion for here. vue.js already provides tooling for components, and so using it (or really any component library) helps us break down the UI/UX and work on smaller units.