Fork me on GitHub
#hyperfiddle
<
2023-09-13
>
Dustin Getz13:09:38

We want to see this ported to Electric if anyone is looking for a cool project https://github.com/opqdonut/malli-edn-editor/tree/main

plus_one 3
👀 2
mmer13:09:04

Would you consider the server holding the schema?

Dustin Getz16:09:56

sure, ideally it shouldn't matter right

mmer16:09:40

I only ask as does electric make sense if no server exists?

xificurC17:09:28

You can use it client side only, in theory

joshcho19:09:12

this feels very tractable in electric, my standard for how “difficult” a project is has changed

bhurlow20:09:35

I started experimenting with a “CLI” approach for developing and running electric apps: https://github.com/bhurlow/electric-tools. Main motivation here is just preference to not have to copy an existing repo with stuff I don’t need. This grabs the server and build config from the starter app and packages it as a library. Unfortunately due to some cljs specifics, it’s not as plug and play as I’d hoped

👀 1
Dustin Getz20:09:21

starter apps are all getting paved fwiw

bhurlow20:09:32

nice, how so?

Dustin Getz20:09:34

we streamlined a lot of the little annoying complexities with the build/ops and some other stuff, i forget

Dustin Getz20:09:54

it unfortunately got paused before completion as i am oversubscribed right now but willget back to it after i do my taxes

❤️ 1
bhurlow20:09:23

got it. happy to review or pitch in on the starter experience, feels like there’s a great opportunity for the long tail of programmers that might not fully grok deps.edn for example

Dustin Getz22:09:39

will fix, is it breaking something?

nivekuil22:09:37

well you can't use it because the e alias doesn't exist

Dustin Getz22:09:45

it works if the caller ns binds that alias which of course it does, unless you have bound it to something else

nivekuil22:09:52

I don't understand, it's the only thing in that file that uses e/ , and it was broken for me in my ui file with the usual e alias until I edited that electric source file

Dustin Getz22:09:47

ok i will log a ticket, if you want the contributor badge send commit (and we will get to it faster too)

nivekuil22:09:37

might be interesting, came across this issue in svelte about appendchild vs a faster clonenode method of rendering https://github.com/sveltejs/svelte/issues/3898

🙏 1
nivekuil23:09:37

what's the idiom for (.appendChild dom/node my-node) but with proper cleanup?

Dustin Getz23:09:13

m/observe is the default way i think, in the case of electric-dom there is some nuance - mentioning this because i’m not sure what you’re trying to do

xificurC06:09:05

can you instead (dom/element :my-node-type ...)?

nivekuil21:09:27

i want to render to pixi instead of dom, so trying to learn the details a little better. The event handling bits look hard, I don't understand yet why dom event stuff can't be in the dom namespace

Dustin Getz23:09:25

tell us more about what pixi is and what you are trying to do?

nivekuil00:09:42

pixi is a rendering library, mostly for games, like sdl or flash. it should be straightforward to port electric-dom's rendering model to any other retained mode system. I think this should trivialize making things like .io games

nivekuil00:09:20

i saw that comment, but I don't know what it implies in general. I'm looking for a generic pattern of "m/observe this listener, and convert fn callback to e/fn"

Dustin Getz00:09:25

electric ships an efficient clock on every platform and in the browser implementing that clock correctly depends on the visibility state which is a dom event

👍 1
Dustin Getz00:09:41

you can do the naive thing for events with m/observe, it’s the e/fn callback pattern that is problematic, we believe it’s an anti pattern now and it will be deprecated with electric UI5 which is callback free FRP based design

nivekuil00:09:34

this pattern is in electric-dom, not electric-ui right? does ui5 replace dom

nivekuil01:09:06

is the new design generalizable outside of dom events?

Dustin Getz01:09:15

yes the new design should generalize, however it is currently blocked on differential electric

Dustin Getz01:09:26

we can give you some old patterns we used to get by if you want, or perhaps you can copy/paste any electric- dom implementations

Dustin Getz01:09:21

UI4 and dom2 are we believe correct and bug free if you understand how to call them correctly , but definitely not idiomatic long run

nivekuil01:09:46

i'll wait on the proper way to do it, I've been looking at electric-dom just to try to understand what's going on and I don't get it 🙂

🙂 1
Dustin Getz01:09:15

“hook” is a mechanism to track order in the DAG so that in an e/for-by if elements move around in the collection the underlying dom elements are gracefully swapped and not rebuilt. this is a central functionality in the differential electric rewrite, all this hook stuff is getting paved