I thought this was a three.js demo but it's actually built with a language called haxe [1]. I've never heard of this language before and looks really cool. Makes me want to play with it!
Ive been wondering the same thing. especially when u see what can be done with WASM in apps like Figma. I believe most of the QGIS code base is c++ so i wonder if it's just a case writing a bunch of js, wasm glue code to make this a reality...