Fork me on GitHub
#hyperfiddle
<
2023-11-04
>
nivekuil21:11:15

what might an electric-dom3 look like? i'm designing something similar, would be interested to hear any lessons from dom2

Dustin Getz21:11:53

the problem with dom2 is the event handing is imperative, adding latency to the reactjs change callback pattern has really confusing semantics

Dustin Getz21:11:51

it’s also plausible that the event side of views should be done in discrete time, which means no network transfer in response to events except at the root of the component tree

Dustin Getz21:11:05

that’s my 2c what is yours?

Dustin Getz21:11:34

also optimistic updates infrastructure is needed

👀 1
nivekuil21:11:06

aside from what's blocked by differential electric, are you satisfied with (or at least have no current plans to change) the api?

Dustin Getz22:11:01

um a better props syntax would be nice but the requirements are stringent, it cannot damage expressive power

henrik22:11:16

UIx etc. have special considerations in their macros for props delivered as a map literal in the first parameter position of DOM constructors. But it’s also quite powerful to be able to return props and treat it as a graph node in some cases. A #props reader macro?

nivekuil15:11:39

it’s also plausible that the event side of views should be done in discrete time, which means no network transfer in response to events except at the root of the component treeI think I agree with this; I made callbacks defer their effects by putting them into a global event queue that gets flushed every frame, inspired by https://bevy-cheatbook.github.io/programming/events.html I think it's pretty clean, seems to have fixed the glitches i was seeing by making all the reactive effects happen at known points and also paves the way for split client/server data

henrik15:11:59

Interesting @U797MAJ8M. What glitches were fixed by using an event queue?

nivekuil15:11:03

changes being dropped etc. probably the same sorts of glitches dustin is referring to with react-style callbacks that they want to get rid of with differential electric, and making multiple watches on an atom; you can only have one reactive system that fully controls when all things happen, you can't mix dataflow/execution semantics or things become impossible to reason about

👍 1
nivekuil15:11:00

the problem is more visible in ecs (because it forces you to think explicitly about data dependencies and execution order, i'm bridging odoyle and electric for dynamic reactive state) than frp but should exist in general

Dustin Getz15:11:37

idk what glitches you are talking about, the ui4 library has no known bugs or glitches

nivekuil16:11:23

well yeah, ui4 bridges callbacks to electric/missionary land