<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="273503" data-post-id="273503">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kanishka" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kanishka
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>For me, inertiajs is about being able to swap out front end and backend frameworks with a common protocol.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="273503" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/client-side-rendering-server-side-state-statechannel/52709/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-273503" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="273503"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #31"></div>
  </section>
</div>
    <div class="postbit" id="273539" data-post-id="273539">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hansihe" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hansihe/120/15871_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hansihe
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I want to throw my project into the arena here as well. Confusingly it’s also called LiveData, but uses a quite different approach from a lot of other projects I have seen.</p>
<p>LiveData has a concept of tracked functions, defined with <code>deft</code> instead of a regular <code>def</code>. When compiling <code>deft</code> functions, they are transformed in a way which extracts static chunks of the data structure and sends them only once. Instead of a general tree diff, it draws inspiration from virtual dom frontend frameworks and enable you to specify keys/IDs for subtrees which enables the runtime to efficiently generate diffs for you.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  deft render(assigns) do
    %{
      posts: for post &lt;- assigns.posts do
        keyed post.id do
          %{
            id: post.id,
            title: post.title,
            content: post.content,
          }
        end
      end
    }
  end
</code></pre>
<p>This is how the render function could look like in a LiveData. Other than this, things look pretty much exactly like a LiveView.</p>
<p>Here, <code>keyed</code> is used to specify an a key that can uniquely identify the post. By doing this you get the following advantages:</p>
<ul>
<li>If a post changes, only the change in that post is ever sent.</li>
<li>No static content is sent twice, the <code>posts</code> key, <code>content</code> key + more in the map is static, so is only sent once at the beginning of the connection.</li>
<li>If a post is added, only the added post is sent.</li>
</ul>
<p>It’s not very cleaned up, but here is a simple example of a LiveView: <a href="https://github.com/hansihe/phoenix_data_view_demo/blob/main/pdv_backend/lib/pdv_backend_web/hello_world_data.ex" class="inline-onebox" rel="noopener nofollow ugc">phoenix_data_view_demo/pdv_backend/lib/pdv_backend_web/hello_world_data.ex at main · hansihe/phoenix_data_view_demo · GitHub</a></p>
<p><a href="https://github.com/hansihe/live_data" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/hansihe/live_data</a></p>
<div class="youtube-onebox lazy-video-container" data-video-id="I4vVxtrow-E" data-video-title="Introducing LiveData: LiveView for JSON endpoints | Hans Elias Josephsen | ElixirConf EU 2022" data-video-start-time="" data-provider-name="youtube">
  <a href="https://www.youtube.com/watch?v=I4vVxtrow-E" target="_blank" class="video-thumbnail" rel="noopener nofollow ugc">
    <img class="youtube-thumbnail" src="https://i.ytimg.com/vi/I4vVxtrow-E/hqdefault.jpg" title="Introducing LiveData: LiveView for JSON endpoints | Hans Elias Josephsen | ElixirConf EU 2022" width="480" height="360">
  </a>
</div>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="273539" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/client-side-rendering-server-side-state-statechannel/52709/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-273539" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="273539"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #32"></div>
  </section>
</div>
    <div class="postbit" id="273545" data-post-id="273545">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hubertlepicki" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/120/6822_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hubertlepicki
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>What can I say, great minds think alike <img src="https://forum.elixirforum.com/images/emoji/apple/rofl.png?v=15" title=":rofl:" class="emoji" alt=":rofl:" loading="lazy" width="20" height="20"></p>
<p>But it’s both validating and encouraging that this is not just me N=1 thinking about this. Also, many different projects may result in fragmentation with no clear choice for users, temporarily, but we probably don’t need a dozen of different solution but 2 or 3 slightly different ones.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="273545" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/client-side-rendering-server-side-state-statechannel/52709/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-273545" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="273545"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #33"></div>
  </section>
</div>
    <div class="postbit" id="273642" data-post-id="273642">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>this approach gets some more publicity:</p><aside class="quote quote-modified" data-post="1" data-topic="52934">
  <div class="title">
    <div class="quote-controls"></div>
    <img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brainlid/48/20975_2.png" class="avatar">
    <div class="quote-title__text-content">
      <a href="https://forum.elixirforum.com/t/podcast-thinkingelixir-132-embed-friendly-alternative-to-liveview/52934" rel="nofollow">Podcast: ThinkingElixir 132 - Embed Friendly Alternative to LiveView?</a> <a class="badge-category__wrapper " href="/c/blogs-podcasts/podcasts/156" rel="nofollow"><span data-category-id="156" style="--category-badge-color: #339c57; --category-badge-text-color: #FFFFFF; --parent-category-badge-color: #339c57;" data-parent-category-id="155" data-drop-close="true" class="badge-category --style-square --has-parent"><span class="badge-category__name">Podcasts</span></span></a>
    </div>
  </div>
  <blockquote>
    Episode 132 of <a href="https://podcast.thinkingelixir.com" rel="noopener nofollow ugc">Thinking Elixir</a>. LiveView isn’t always the right answer. <a href="https://twitter.com/superchris" rel="noopener nofollow ugc">Chris Nelson</a> created LiveState to enable embedding custom HTML components in other websites and connect over Phoenix channels to keep UI state on the server! LiveState takes an interesting approach that tries to keep many of the benefits of LiveView but apply it to situations like custom components in static sites hosted by other people. Chris explains how it works and what problems it solves. Check it out! 
<a href="https://podcast.thinkingelixir.com/132" class="onebox" target="_blank" rel="noopener nofollow ugc">https://podcast.…</a>
  </blockquote>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="273642" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/client-side-rendering-server-side-state-statechannel/52709/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-273642" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="273642"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #34"></div>
  </section>
</div>
    <div class="postbit" id="273738" data-post-id="273738">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="addstar" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  addstar
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/superchris" rel="nofollow">@superchris</a> I’m having a play around with your library <code>live_state</code> and am really liking it. I’m using it with lit and your decorators. Whats your approach to handling errors? I’m thinking of 2 different types of errors; expected errors like changeset errors and unexpected errors like if you have a case statement with a catch all.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="273738" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/client-side-rendering-server-side-state-statechannel/52709/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-273738" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="273738"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #35"></div>
  </section>
</div>
    <div class="postbit" id="273764" data-post-id="273764">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="superchris" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/superchris/120/23484_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  superchris
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Great question! For actual errors (socket or channel failures for example) I’m underway with adding support for an error event from LiveState and added an issue to track it here: <a href="https://github.com/launchscout/live_state/issues/5" class="inline-onebox" rel="noopener nofollow ugc">Error handling · Issue #5 · launchscout/live_state · GitHub</a>. I have an initial implementation, but am not entirely happy with what I came up with and want to rework it a little.</p>
<p>For changeset “errors” (really validation failures) my thought is those belong on state. I put together a CRUD example recently to show how this could work, I need to figure out where to put it. With the amount of subprojects, examples and related things it might be time for a livestate github org. For now, I created an issue so I can remember to do this: <a href="https://github.com/launchscout/live_state/issues/6" class="inline-onebox" rel="noopener nofollow ugc">CRUD example · Issue #6 · launchscout/live_state · GitHub</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="273764" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/client-side-rendering-server-side-state-statechannel/52709/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-273764" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="273764"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #36"></div>
  </section>
</div>
    <div class="postbit" id="274153" data-post-id="274153">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="maxmannen" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/maxmannen/120/20861_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  maxmannen
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thrilled about this…<br>
I have started to look in to Sveltekit (1.0 now) with a Phoenix backend. This could the bridge between this great programming tools.<br>
I there a NPM package for the client side of Svelte? I can find your examples but it seems you include packages that are local on your server?  I am not up to speed on Svelte so might miss something.<br>
Anyway, Phoenix/LiveData/Sveltekit (with Skeleton UI) looks like  a really nice way forward for me.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="274153" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/client-side-rendering-server-side-state-statechannel/52709/38">Post #37</a>
	                </div>
	            </div>
              <div id="likers-container-274153" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="274153"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>