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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="65" data-topic="16445">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>I am OK with this restriction,</p>
</blockquote>
</aside>
<p>This is not a restriction! This is the result of an algorithm that transforms the AST into an equivalent AST with the variable bindings at the top. The goal is for the user to write a normal template (the template above) and all the rest is done by the template compiler. The goal of having this complex compilation step is to remove all restrictions from the templates.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97049" 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/54-elixirconf-us-2018-closing-keynote-chris-mccord/16445/66">Post #65</a>
	                </div>
	            </div>
              <div id="likers-container-97049" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97049"
                     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 #65"></div>
  </section>
</div>
    <div class="postbit" id="97050" data-post-id="97050">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Oh I see. You are saying templates can be fully compiled in this fashion. That’s an even better idea, yes. I don’t think we need to do this an extra pass, we can probably change the engine to emit this code from the beginning.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97050" 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/54-elixirconf-us-2018-closing-keynote-chris-mccord/16445/67">Post #66</a>
	                </div>
	            </div>
              <div id="likers-container-97050" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97050"
                     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 #66"></div>
  </section>
</div>
    <div class="postbit" id="97053" data-post-id="97053">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="67" data-topic="16445">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>I don’t think we need to do this an extra pass, we can probably change the engine to emit this code from the beginning.</p>
</blockquote>
</aside>
<p>Yes, you can try that. If I were to follow that path (I’ve actually tried to do it for about 30mins or something, and it’s not trivial), I’d do the following:</p>
<ol>
<li>
<p>Don’t try to produce a valid expression at all steps. You probably need to keep some context of what variables you have already bound and stuff like that</p>
</li>
<li>
<p>Instead of “folding over a quoted expression” (which is what an engine currently does), fold over a more complex struct (e.g. <code>%Context{}</code>), which keeps the metadata you need. You do have <em>some</em> experience in writing compilers, so you probably know what you need (NimbleParsec, in particular, is a work of art, although I can’t understand much of the source)</p>
</li>
<li>
<p>You’ll probably need some minimal postprocessing anyway.</p>
</li>
</ol>
<p>I can help, but I can’t commit to deadlines: I might have something ready in 1 day or in 1 month. And in any case, I’d like to go the way of rewriting the already compiled template according to a “typical” engine (nothing special, just personal preference).</p>
<p>If you want to try to build the template as you parse the EEx template, I suggest you go that way while I try to transform the already compiled template. In any case, the optimum approach will probably take a bit from both perspectives.</p>
<p>I have a sandbox project named <code>PhoenixUndeadView</code> where I try some approaches. I’ll publish it today or tomorrow so you can see for yourself what I’m doing (not much, currently). I’ve started a topic to sorta blog about it, but most (<a href="https://forum.elixirforum.com/t/phoenixundeadview-lets-discuss-optimization-possibilities-for-something-like-phoenix-liveview/16533" rel="nofollow">here</a>), but most of the interesting discussion is in this topic <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97053" data-batch-url="/posts/batch_likers">
                        5
                      </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/54-elixirconf-us-2018-closing-keynote-chris-mccord/16445/68">Post #67</a>
	                </div>
	            </div>
              <div id="likers-container-97053" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97053"
                     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 #67"></div>
  </section>
</div>
    <div class="postbit" id="97054" data-post-id="97054">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="tmbb" data-post="68" data-topic="16445">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/t/77aa72/48.png" class="avatar"> tmbb:</div>
<blockquote>
<p>Yes, you can try that. If I were to follow that path (I’ve actually tried to do it for about 30mins or something, and it’s not trivial), I’d do the following:</p>
</blockquote>
</aside>
<p>Yup. I think this is the best approach indeed. I am just not sure about the interplay between handle_begin + handle_end and handle_expr but it should be doable. We should probably require Elixir v1.5 too, as doing a metadata approaches requires <code>handle_body</code> which does not exist in earlier versions.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97054" 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/54-elixirconf-us-2018-closing-keynote-chris-mccord/16445/69">Post #68</a>
	                </div>
	            </div>
              <div id="likers-container-97054" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97054"
                     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 #68"></div>
  </section>
</div>
    <div class="postbit" id="97055" data-post-id="97055">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>RANT (tangentially related to what we’re discussing)</p>
<p>The Elixir and Erlang compilers seem to leave out a lot of easy optimizations that other compilers perform (e.g. Java’s bytecode compiler, Haskell, OCaml) perform. I don’t know how big the results would be in practice, but currently it’s a little hard to experiment with Elixir’s compilation, because the compiler doesn’t have any extension points that I know.</p>
<p>It would be interesting to have a some kind of Elixir compiler in Elixir (even if it doesn’t compile directly to Erlang), which could be hooked into certain parts of the compilation pipeline. It would make it easy to perform radical AST rewritings.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97055" 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/54-elixirconf-us-2018-closing-keynote-chris-mccord/16445/70">Post #69</a>
	                </div>
	            </div>
              <div id="likers-container-97055" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97055"
                     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 #69"></div>
  </section>
</div>
    <div class="postbit" id="97057" data-post-id="97057">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="grych" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/120/5610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  grych
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Drab</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="62" data-topic="16445">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>For a reference, the approach I have in mind would render <strong>all of the comments</strong> again and send it to the browser for diffing.</p>
</blockquote>
</aside>
<p>Well, Drab does almost the same, your approach is even better because I replace all the content. Like <a href="https://tg.pl/drab#poke" rel="noopener nofollow ugc">in this example</a>:</p>
<pre><code>  &lt;strong&gt;&lt;%= @title %&gt;:&lt;/strong&gt;&lt;br&gt;
  &lt;%= for user &lt;- @users do %&gt;
    Username: &lt;%= user %&gt; &lt;br&gt;
  &lt;% end %&gt;
</code></pre>
<p>After processing with Drab Engine, the html would look like:</p>
<pre><code>  &lt;strong drab-ampere="1234"&gt;&lt;%= @title %&gt;:&lt;/strong&gt;&lt;br&gt;
  &lt;span drab-ampere="5678"&gt;&lt;%= for user &lt;- @users do %&gt;
    Username: &lt;%= user %&gt; &lt;br&gt;
  &lt;% end %&gt;&lt;/span&gt;
</code></pre>
<p>So in the simple case, when you update <code>@title</code>, it would just update innerHTML of the <code>&lt;strong drab-ampere="1234"&gt;</code>, but when you update <code>@users</code> collection, it must update the whole <code>&lt;span drab-ampere="5678"&gt;</code>. <strong>Doing the diff on the client side is a great idea</strong>, and it solves the problem when, for example, system needs to replace the whole <code>form_for</code> and refreshes the <code>&lt;input&gt;</code>s so the value user already set is gone.</p>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="62" data-topic="16445">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>Also, how do you sync assigns in case of disconnect+reconnect? Because the data on the server may be more recent, so you can’t just trust the assigns the client sends?</p>
</blockquote>
</aside>
<p>In Drab, the server-side data is only updated when the client successfully updates. In the other case, <code>poke</code> returns <code>{:error, description}</code>. Server-side data is rather a cache, I treat client as a data source.</p>
<p>The other issue is a broadcast change. At the beginning, I did not want to build the broadcasting version of the <code>poke</code>, as the browsers may have different data at the same time. But the community convinced me to do it, but <a href="https://hexdocs.pm/drab/Drab.Live.html#module-broadcasting" rel="noopener nofollow ugc">it is limited</a>. There were more concepts, like re-sending back to the server changes coming from the other browsers, or send the changes to all Drab servers in the server, but I’ve found them overcomplicated.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97057" data-batch-url="/posts/batch_likers">
                        3
                      </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/54-elixirconf-us-2018-closing-keynote-chris-mccord/16445/71">Post #70</a>
	                </div>
	            </div>
              <div id="likers-container-97057" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97057"
                     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 #70"></div>
  </section>
</div>
    <div class="postbit" id="97064" data-post-id="97064">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="grych" data-post="71" data-topic="16445">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/48/5610_2.png" class="avatar"> grych:</div>
<blockquote>
<p>Server-side data is rather a cache, I treat client as a data source</p>
</blockquote>
</aside>
<p>Interesting! This is a big distinction then. I know Chris is exploring some ideas and I have some thoughts as well. My latest idea is to store only “params” on the client and you can update those parameters with LiveView. So for example, if you want to do something like pagination, you would start with the parameter set to <code>nil</code> (or zero) and every time you change the page you could update the parameters in the client with a data push (or change the URL - but that’s a separate discussion). So you keep in the client only what is necessary to tell the server where it was. Not much different from the usual request/response life-cycle.</p>
<p>Thoughts?</p>
<aside class="quote no-group" data-username="grych" data-post="71" data-topic="16445">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/48/5610_2.png" class="avatar"> grych:</div>
<blockquote>
<p>The other issue is a broadcast change. At the beginning, I did not want to build the broadcasting version of the <code>poke</code> , as the browsers may have different data at the same time. But the community convinced me to do it, but <a href="https://hexdocs.pm/drab/Drab.Live.html#module-broadcasting" rel="nofollow">it is limited</a>.</p>
</blockquote>
</aside>
<p>Agreed. It is always tricky, especially if you consider what will happen on disconnects and so on.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97064" 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/54-elixirconf-us-2018-closing-keynote-chris-mccord/16445/72">Post #71</a>
	                </div>
	            </div>
              <div id="likers-container-97064" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97064"
                     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 #71"></div>
  </section>
</div>
    <div class="postbit" id="97065" data-post-id="97065">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="72" data-topic="16445">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>Agreed. It is always tricky, especially if you consider what will happen on disconnects and so on.</p>
</blockquote>
</aside>
<p>I think this problem is a lot less difficult to solve if you keep all of your state on the server.  That way when something inevitably goes wrong and the user refreshes their page, every issue is solved from a known good state</p>
<p>edit: well not that you can’t mess up server-side state, but going over the internet is certainly going to expose way more super rare bugs than dealing with your code all running on one node or inside a relatively much more stable local network</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97065" data-batch-url="/posts/batch_likers">
                        3
                      </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/54-elixirconf-us-2018-closing-keynote-chris-mccord/16445/73">Post #72</a>
	                </div>
	            </div>
              <div id="likers-container-97065" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97065"
                     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 #72"></div>
  </section>
</div>
    <div class="postbit" id="97086" data-post-id="97086">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Let’s not lose track of what the goal with Drab or LiveView is: the “gold standard” is always the lovingly crafted client side framework with both custom javascript and server side rendering (it really helps if you’re using JS on the server too). That way you can be smart about which data you send, how to deal with disconnect, etc.</p>
<p>These solutions <em>are not</em> operating on the same space. Drab and LiveView are a kind of a hack to simplify development (at least LiveView was explicitly presented as such).</p>
<p>If you start to have a smart client and at the same time the ability to push changes from the server, you now have a distributed system and your code is automatically orders of magnitude more complex for things to work.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97086" 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/54-elixirconf-us-2018-closing-keynote-chris-mccord/16445/74">Post #73</a>
	                </div>
	            </div>
              <div id="likers-container-97086" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97086"
                     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 #73"></div>
  </section>
</div>
    <div class="postbit" id="97100" data-post-id="97100">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="grych" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/120/5610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  grych
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Drab</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="72" data-topic="16445">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>Thoughts?</p>
<p><img src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/40/5610_1.png" alt="" width="20" height="20" role="presentation"> grych:</p>
</blockquote>
</aside>
<p>That would simplify the implementation, but IMO is not enough. The power of living assigns (LIveView, Drab.Live) is that you can do everything what you could do with normal action in the controller, but live.</p>
<aside class="quote no-group" data-username="dgmcguire" data-post="73" data-topic="16445">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dgmcguire/48/12192_2.png" class="avatar"> dgmcguire:</div>
<blockquote>
<p>I think this problem is a lot less difficult to solve if you keep all of your state on the server.</p>
</blockquote>
</aside>
<p>IMO is more difficult <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"> - vide: handling disconnections.<br>
Now, I have a drab genserver linked with channel process. In case of disconnection, it just dies, I don’t care about cleaning up stuff etc. After reconnect, new process gathers the data from the client, so if anything were changed before disconnection, we have it in a new process.<br>
Keeping on the server means that your data must persist the disconnection. So you need to keep it somewhere, handling timeouts. For me that was more difficult!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97100" 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/54-elixirconf-us-2018-closing-keynote-chris-mccord/16445/75">Post #74</a>
	                </div>
	            </div>
              <div id="likers-container-97100" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97100"
                     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 #74"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/16445/load_more?page=8">Load more posts (16 remaining)</a>
</div></template></turbo-stream>