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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Nicd" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Nicd/120/2357_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Nicd
                    <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>I’ve continued implementing the profile page with LV and I’m currently this far:</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/b/e/be9df2e898638cca9c7e176cab47e7cc46431fd5.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/be9df2e898638cca9c7e176cab47e7cc46431fd5" title="Screen Shot 2021-05-31 at 12.57.12-fullpage" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/b/e/be9df2e898638cca9c7e176cab47e7cc46431fd5_2_272x600.jpeg" alt="Screen Shot 2021-05-31 at 12.57.12-fullpage" data-base62-sha1="rch7DOsGsXfymKmMWHBgJrjZIFf" width="272" height="600" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/b/e/be9df2e898638cca9c7e176cab47e7cc46431fd5_2_272x600.jpeg, https://forum.elixirforum.com/uploads/default/optimized/3X/b/e/be9df2e898638cca9c7e176cab47e7cc46431fd5_2_408x900.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/optimized/3X/b/e/be9df2e898638cca9c7e176cab47e7cc46431fd5_2_544x1200.jpeg 2x" data-dominant-color="DDDFDF"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screen Shot 2021-05-31 at 12.57.12-fullpage</span><span class="informations">1024×2256 224 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>As you can see, all the graphs are done except for those that were made with Chart.js in the existing frontend. I will see about converting them to Contex.</p>
<p>The setup is the same as I described earlier, with Graphs, DataProviders, and SharedData, but some details have evolved a bit. Turns out I <em>don’t</em> lose change tracking if I convert all of my child components to live components and I can still use my renderer tricks in Graphs.Catalogue and the graph modules themselves.</p>
<p>Currently my live update size is around 5 KB for any change. That’s a lot of data so I will see about how to minimize it but it’s a lot better than the 60 KB of the initial implementation. Biggest change was adding <code>id</code> tags in all the lists.</p>
<p>With the UserInfo graph, for some reason it always updates <em>all</em> the data even though the only changed data is in the numbers. The username or avatar can’t change, but they are always re-rendered. Don’t know why that is, let me know if you have any ideas.</p>
<p>All in all it’s going quite well. <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"> Looking into Contex next.</p>
<p>Oh, and the code is still here: <a href="https://gitlab.com/code-stats/code-stats/-/tree/wip/live-view/lib/code_stats_web/profile_live" class="inline-onebox" rel="noopener nofollow ugc">lib/code_stats_web/profile_live · wip/live-view · CodeStats / code-stats · GitLab</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="215765" 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/structuring-a-liveview-with-many-similar-dynamic-components/39445/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-215765" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="215765"
                     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 #11"></div>
  </section>
</div>
    <div class="postbit" id="215766" data-post-id="215766">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for the update!</p>
<p>Re: Contex - there are quite a few unreleased goodies at the moment. If you need them, point your deps to github for now (updates are in changelog).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="215766" 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/structuring-a-liveview-with-many-similar-dynamic-components/39445/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-215766" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="215766"
                     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 #12"></div>
  </section>
</div>
    <div class="postbit" id="218382" data-post-id="218382">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Nicd" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Nicd/120/2357_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Nicd
                    <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>The code has evolved and I’ve gotten the update diff pushed down. The most impactful thing there were to use stateful components instead of stateless. I had understood wrong the readme note about stateless components always rendering, and it ended up sending all the components as diffs with every small update. I gave the components <code>id</code> arguments and the diff is instantly much smaller.</p>
<p>The diff is currently around 3.5 KB. But mostly it’s full of numbers going into <code>data-phx-component</code> attributes, like this:</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/2/e/2e5ab49a5bd80edd637595855e9e2b6fd7ce09d7.png" data-download-href="https://forum.elixirforum.com/uploads/default/2e5ab49a5bd80edd637595855e9e2b6fd7ce09d7" title="Screenshot 2021-06-24 at 23.42.01" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/original/3X/2/e/2e5ab49a5bd80edd637595855e9e2b6fd7ce09d7.png" alt="Screenshot 2021-06-24 at 23.42.01" data-base62-sha1="6C4iygjzpV6cWvCitrwffVFSKl9" width="344" height="562"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot 2021-06-24 at 23.42.01</span><span class="informations">344×562 60.2 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>I don’t know what to do about that. But ContEx is next!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="218382" 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/structuring-a-liveview-with-many-similar-dynamic-components/39445/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-218382" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="218382"
                     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 #13"></div>
  </section>
</div>
    <div class="postbit" id="218461" data-post-id="218461">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yeah, I’ve found it perplexing that LiveView sends the entire diff of dynamic bits down every time an event happens. Feels like it has the capacity to eat up a good bit more bandwidth than a SPA. But I haven’t benchmarked.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="218461" 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/structuring-a-liveview-with-many-similar-dynamic-components/39445/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-218461" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="218461"
                     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>