Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support calling server-side cells from client-side cells #30

Open
jaked opened this issue May 16, 2024 · 0 comments
Open

support calling server-side cells from client-side cells #30

jaked opened this issue May 16, 2024 · 0 comments

Comments

@jaked
Copy link
Collaborator

jaked commented May 16, 2024

right now server / client are separate worlds, and each client-side cell is its own world (i.e. it doesn't share modules with others). So it would be useful to be able to refer to a variable defined in a server-side cell from a client-side cell, and have the value of the variable fetched via RPC. Then you could e.g. fetch data server side and display it client side.

Ideally this would work with hot reloading. We could re-run dependent client cells when the server cell changes; and/or we could integrate with React etc. to hot-reload the state without re-running the whole cell. Maybe this would involve an explicit hook, e.g. useVariable(v) where v is defined server-side. At cell rewrite time we'd turn v into a reference we can use to push state changes back to the client over RPC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant