2 ms·
Key difference is there is no VDOM. Instead of doing multiple passes over a tree top-down on scheduled update cycles to render a virtual DOM representation and
by ryansolid 8y ago
Key difference is there is no VDOM. Instead of doing multiple passes over a tree top-down on scheduled update cycles to render a virtual DOM representation and then diffing and patching against a real DOM. Solid compiles it's JSX down to optimized real DOM instructions. Then through basically event subscriptions it triggers updates based only on dependencies of data that has changed to update specific nodes.
While ReactDOM is just an implementation of the VDOM, Solid uses a completely different change management approach than React which is why it's API can look like React Hooks but not be subject to the Hook Rules. Although its more the other way around in that React Hooks is influenced by fine grained libraries that have existed for over a decade now.
Historically this approach suffered greatly on initialization but precompilation of the JSX mitigates this. Which just leaves this approaches strength which is partial updates to handle the rest. In so the approach differs from a lot of previous precompiled work since the update cycle is more optimized.
EDIT: I see meant more that React itself isn't married to the VDOM. That is true-ish. It still is based on Partitioned Top Down evaluation. So even if it wasn't using a VDOM it would attack things a similar way. Solid is using fine grained evaluation through an Synchronous Reactive Programming graph. It just fundamentally works very differently on how it handles changes.
- treyhuffine 8y agoVery interesting approach, I'm excited to try it out. The performance is pretty undeniable.