Skip to content

Instantly share code, notes, and snippets.

@dustingetz
Last active March 1, 2023 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustingetz/89ca122af0175933042e481ee9aa59f8 to your computer and use it in GitHub Desktop.
Save dustingetz/89ca122af0175933042e481ee9aa59f8 to your computer and use it in GitHub Desktop.

Direct recursion over file system from the frontend — Electric Clojure (2022 June)

This video demonstrates traversing a filesystem tree from the frontend. The filesystem tree exists only on the server, and the HTML view exists only on the client. Nonetheless, we are able to unify the query/view logic into a single recursion in the simple, direct style of PHP, despite network. The Electric compiler automatically coordinates fine-grained reactive network sync.

Code note: in this video from last year, ~@ is the legacy syntax for client/server transfer, it has since been superseded by e/client and e/server markers.

20220621.photon.treeview.with.managed.nework.mp4
  • No API, no client side database, no frontend state at all (except DOM)
  • Literally all accidental complexity GONE
  • Look how fast it is! It's incremental/streaming network, not request/response.
  • Electric brings a higher level of expressiveness and fluency than was possible before
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment