Virtual DOM is the new IR
What is IR first:
An intermediate representation is a representation of a program part way between the source and target languages. A good IR is one that is fairly independent of the source and target languages, so that it maximizes its ability to be used in a retargetable compiler.
By saying “‘virtual DOM is an IR” I mean it helps in compiling our code different platforms, even though it’s interpreted. In React native, the virtual DOM is essential technology to bring React into various platform including Android, iOS and TVs. Already old story. It’s what LLVM does being an IR.
But for some reason I still got a question:
However, to port virtual DOM to various platforms we do need something that maps to the View components existing in Android and iOS, which is like reimplement a subset of a real DOM based on mobile technology other than WebViews. And I did see it in Weex: