Drei seems to be coming out with some really nice features, and in some areas seems to be pushing ahead of normal threejs.
For example, their version of transform controls not only look better (in my opinion) but have some nice features built in too.
How viable is it to take a component of Drei / r3f and convert to vanilla js?
A side question…I appreciate the whole point of drei is to use react, but that seems rather limiting, not everyone can use it, and who knows if some new framework will overthrow it in the future. Would it not make sense for their dev team to discuss/collaborate with the three team so that beneficial features/examples can go in the core and not be limited to react?
you can try to port it, it may be feasible, the code is here.
as for drei components in general, i don’t think it’s feasible. we do try to make bits that can be used vanilla accessible, but there’s a problem if you wanted to port components … oop. these are polar opposites: imperative—declarative, object oriented—functional. reacts only job is to complement imperative systems (for instance three) with the latter of these pairs.
classes can’t adequately express components. a component is a self-contained unit with a lifecycle and awareness of its environment. it has interop with other components through functional composition. that is what would be lost in translation with a port.