Here’s a clip of Jon Stewart laying it out for you:
@11:00
> “And that, ladies and gentlemen, I present to you, is why we need courts. Whatever flaws the American justice system has, and they are legion, especially for non billionaire former presidents, it does appear to be the last place where you can’t just say whatever the fuck you want regardless of reality.”
Love Clojure, but am repulsed by the idea of a “responsive DOM network stream”.
This feels over engineered to me. The classic cool factor influencing the “if we could vs if we should”, bolstered by developing it as a software engineer on a performant dev box with impeccable internet connection; hell, maybe even a local dev db clone.
I suppose you could argue server side caching would alleviate some of the pains of a design like this, but you’re still performing redundant server round trips for the stream when a piece of data goes in and out of view.
Does the tech have any local caching options to make this a little more sane for a worst case an end user?
> you’re still performing redundant server round trips for the stream when a piece of data goes in and out of view
This is not the way how Electric apps work, this was just a demonstration of how easily you can orchestrate complex network-transparent client-server interactions _when_ you need them.
Have you tried it? I was skeptical too until I built a few apps with it. The learning curve is easier than it seems (I started by modifying the examples) and it really does cut down on development time - turns out much of modern web programming revolves around network management and its associated complexities.
> Does the tech have any local caching options to make this a little more sane for a worst case an end user?
This is trivially solved in Electric- as long as you hold onto a client-side handle of the data, it won't be unmounted.
Re. performance - Electric v2 is already faster than alternatives for many kinds of apps (not all). We expect v3 to be so fast that it can express apps that are outright impossible with alternatives. The robotics observability IDE in the talk, for example, as well as Hyperfiddle itself.
Re. server caching – Electric (being reactive) auto memoizes all scopes, even on the server. (The essence of reactive programming is a time/space tradeoff - cache more things to minimize recomputation later.) For example, in the virtual scroll demo from the talk, the database query runs once and is retained in memory, so that scrolling simply indexes over the memoized collection:
Regarding client caching - it's basically the same. Hoist the value you want to save to be above the conditional that is disposing it. If that doesn't work, use an atom.
@11:00 > “And that, ladies and gentlemen, I present to you, is why we need courts. Whatever flaws the American justice system has, and they are legion, especially for non billionaire former presidents, it does appear to be the last place where you can’t just say whatever the fuck you want regardless of reality.”
That’s the energy I want to bring to congress.
https://m.youtube.com/watch?v=qmxzQJt80XI&t=660