Possible implementation method: Use React to render pages and page changes and something like https://github.com/browniefed/htlmparser2-react to turn HTML into React's virtual DOM.