i think it makes sense to use Sodium+React
Sodium creates the VDOM, and fast.
React uses the VDOM to update the real DOM, and fast.
React also has the concept of "Components" which can be stateful, React detects the state changes
and only updates where something needs to be updated. So react is fast.
If I were to use Sodium to generate the real DOM, then I would loose referential transparency.
With Sodium, I get a state-machine, that produces a VDOM, which is "immutable", and the VDOM is used
to update the real DOM, which is mutable. So Sodium widgets are simply functions that are used to create
VDOM and they don't have to worry about actually updating the real DOM - efficiently. React takes care of
For example think about a List with 1000 Sodium widgets in it. If there was no React then the Sodium widget
would be responsible for updating the DOM in an efficient way. It would need to do the diffing itself and only
update what has changed and re-generate the whole list from scratch.
So Sodium widget's simply output VDOM, and that VDOM can contain Sodium Widgets ... and then there
we also have switch... so the VDOM generating graph can be dynamic. The VDOM generating Widgets and their connections can depend on the state of the system and can change in response to events.
For example this could be used to implement a router in an SPA, with a few lines of code.
Well, I won't spend much time "fixing what works already", unless I will need to change it - but new things I will
try to write using Sodium.
For example this : https://github.com/jhegedus42/irie/blob/3b734ccffa5b0b8161288f856285d2aff0e6ef29/modules/client/src/main/scala/app/client/ui/components/mainPages/noteHandling/noteEditor/NoteEditorComp.scala#L85
also, FRP can be used very nicely for cache invalidation, since it is by default a cache invalidator machinery,
so I might replace my caches with Cell's and describe cache invalidation logic using Sodium.
But for now, my caches seem to work fine, but if it gets too complex to write cache invalidation code, then I might refactor the caches in be just simple Sodium cells.
Need to see. In theory it sounds pretty decent idea to use Sodium with React, and for now, it seems to work on simple examples. Let's see how far I can push it.