Fork me on GitHub
#hyperfiddle
<
2022-09-04
>
tlonist14:09:04

I thought I understood when @dustingetz gave the instruction few weeks ago, but now I'm confused about • when do I use p/client(and p/server)? In demo-4-chat the dom elements were rendered with p/client whereas demo-1-hello-world did not. • is photon/ui just a wrapper of photon/dom made for convenience? + I've tested simple CRUD with mysql; and it works! Now I'm trying to make another demo in which one person's REPL can be shared with others.

Dustin Getz14:09:50

let bindings transfer automatically (no need to wrap access but is harmless if you do) dynamic bindings currently have an issue we haven't fixed yet which is that the binding form is peer local and therefore you have to explicitly wrap access to remote dynamic bindings with p/client p/server. in other words, today, there are two possible distinct bindings with the same name so you have to specify which you mean. it's on the roadmap to unify them

Dustin Getz14:09:02

also the default client/server locality is inherited from the caller, and today the photon entry point always starts on the client (it need not be this way)

tlonist00:09:43

So using p/client&server is more inclusive as of now, got it.

Dustin Getz16:09:05

Can I see your repo? We were going to add SQL examples, would you like to contribute your code?

Dustin Getz16:09:39

Confirming that the p/client in demo-4-chat is unnecessary, as it inherits the "color" of the caller I do not recommend you over-specify the client/server markers, because in more advanced/abstract demos (like the Explorer) there are sections of abstract code which need to work regardless of if called from client or server. As well as the subtle rules I mentioned above.

1
tlonist01:09:00

> Can I see your repo? We were going to add SQL examples, would you like to contribute your code? Sure. I'll be happy to contribute. The code needs a bit of polishing, I'll let you know by this thursday.