I wasn’t counting “library” code towards the code count (in this context). I was referring to the amount of code needed by the developer to interact with the library code.
If I understand what you’re proposing though, you’re saying that this “server side redux” is the first half of what I am suggesting LiveView be broken out into; with the acknowledgement that you’d either need a UI library that talked to it (eg. something morphdom driven), or build your own. Yes?
If so, I think that has merits (even outside of LiveView), but it feels like a pretty different approach to the LiveView problem/solution. I wasn’t personally suggesting an entirely different approach, simply breaking the current approach up into more modular libraries.
Yeah, I think that might a fair way to describe it (as far as I can see), but I’d disagree in the feasibility to decouple them. Even in cases where markup is sent from Elixir, a real-time compiler can convert this markup into framework code (eg. Vue, React, etc.), allowing your Elixir code to use Vue/React/WebComponent tags (eg. Material components).
Further, by separating communication from presentation, you can create components out of each “view”. These components can have their own markup, styling, scripting, and even JS dependencies. This opens up the ability to do a lot more than just hook in, but rather swap out entire render logic. If there were “single file components” that represented each view, some of the component would execute on the server, and some would execute in the browser. You don’t really get that with the current LiveView implementation.
For simple / static sites, it might feel overkill (warranting a “basic” UI using something like morphdom). But it would solve for many (if not all) of the SPA requirements.
I used Nuxt, so the rendering is done as part of the “UI” code (but technically a separate “server”). Essentially, some of the work is done on page request (UI server to Elixir server), giving you the SEO benefit and hydration performance. Subsequent diffs are done in the browser. This isn’t required though. You could send static markup from Elixir. The browser might re-render since it doesn’t know if it can trust hydration. With a little work though, you probably could do that. Not sure if that all makes sense.