Getting started with Solid.js

I was introduced to Solid.js a while back and really like the speed and syntax. Does anyone has any suggestions on implementing it with Babylon. It has a similar syntax to react but as it doesn’t use the virtual DOM I didn’t know if it would be a bit different to integrate.

I haven’t used Solid.js yet, but it’s pretty easy to integrate Babylon.js and Svelte which I gather is similar in many respects to Solid (no virtual DOM, “compile away” framework, precise/surgical updates). There’s been a few forum posts about Svelte but I haven’t seen anything yet for Solid.

“- Put the DOM down and move away sir!” - :policeman:

The only DOM you’ll need is an html and canvas tag. BJS will take care of the rest! :smiling_imp:

Hello,

I made a small POC about integrating BJS with SolidJS.
You can checkout the code and the demos at GitHub - age2pierre/solid-akkadi: A simple integration of BabylonJS and Rapier with SolidJS (it may still move a lot in the upcoming days, as it is only the beginning).

My first attempts were done by trying to use solidjs/universal renderer, but I got stuck quite fast; the tricks was to return an Babylon Node instead of a JSX tag.

I also integrated Rapier instead of using the new physics engine, because I wanted to use their CharacterController feature.

2 Likes

This is super cool!

Thanks! how’s Rapier’s performance in comparison to the Havok plugin that’s offered?

I did not do any benchmarks, but it’s fast enough.
Both are WASM modules.
By feel, they seemed to perform in the same order of magnitude.

It is really hard to say without benchmark considering the difference for instance between havok and ammo which is also wasm