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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Surface docs explain it well here:</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://surface-ui.org/state_management">
  <header class="source">

      <a href="https://surface-ui.org/state_management" target="_blank" rel="noopener nofollow ugc">surface-ui.org</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://surface-ui.org/state_management" target="_blank" rel="noopener nofollow ugc">Surface</a></h3>



  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="233408" 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/surface-a-component-based-library-for-phoenix-liveview/27671/204">Post #203</a>
	                </div>
	            </div>
              <div id="likers-container-233408" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="233408"
                     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 #203"></div>
  </section>
</div>
    <div class="postbit" id="233434" data-post-id="233434">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>also in <code>send_update</code> docs</p>
<blockquote>
<p>While a component may always be updated from the parent by updating some parent assigns which will re-render the child, thus invoking update/2 on the child component, send_update/3 is useful for updating a component that entirely manages its own state, as well as messaging between components mounted in the same LiveView.</p>
</blockquote> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="233434" 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/surface-a-component-based-library-for-phoenix-liveview/27671/205">Post #204</a>
	                </div>
	            </div>
              <div id="likers-container-233434" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="233434"
                     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 #204"></div>
  </section>
</div>
    <div class="postbit" id="233447" data-post-id="233447">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Error: <strong>invalid value for property “vod_ingest”. Expected a :map, got: nil.</strong></p>
<p>I have a stateful surface livecomponent called MediaItemCard that shows a MediaItem. I want to display vod_ingest events while the upload the user just uploaded is being encoded – in the MediaItemCard.</p>
<p>The MediaItem has_one VodIngest and the :vod_ingest field is nil if it is not currently ingesting vod.</p>
<p>In MediaItemCard:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  @doc "The media_item vod_ingest data"
  prop vod_ingest, :any, default: nil
</code></pre>
<p>the parent channel_page.ex:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">              &lt;MediaItemCard :for={media_item &lt;- @new_media_items} id={"media_item_card-#{media_item.id}"} username={media_item.user.username}
                media_item={media_item}
                vod_ingest={media_item.vod_ingest}
                current_user={@current_user}
                media_item_changeset={@media_item_changeset}
                playlists={@playlists}
                language_identifiers={@language_identifiers}
                /&gt;
</code></pre>
<p>But I’m not sure why I’m getting the “invalid value for property “vod_ingest” Expected a :map, got: nil.” error on render()</p>
<p>dependencies:</p>
<p>phoenix 1.6.2<br>
phoenix_ecto 4.4.0<br>
phoenix_html 3.1.0<br>
phoenix_live_view 0.16.4<br>
phoenix_view 1.0.0<br>
surface 0.6.1<br>
surface_formatter 0.6.0</p>
<p>background info: my plan to update the card I do Endpoint.broadcast_from(media_item_id) when I get vod_ingest events, which the parent channel_page does handle_info() on. I fetch the MediaItem from the db and then I append the updated MediaItem to the socket.</p>
<p>As an alternative I can use <code>send_update</code> but if the user refreshes the page those get clobbered unless I inject the state directly into the child livecomponent .. right?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="233447" 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/surface-a-component-based-library-for-phoenix-liveview/27671/206">Post #205</a>
	                </div>
	            </div>
              <div id="likers-container-233447" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="233447"
                     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 #205"></div>
  </section>
</div>
    <div class="postbit" id="247397" data-post-id="247397">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Is surface 0.7.x released? I am having a lot of problem porting my application from 0.6.x. Even simple stuff like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"> {#for n &lt;- 1..2}
 &lt;span :if={n &gt; 1}&gt;{n}&lt;/span&gt;
 {/for}
</code></pre>
<p>Does not work. It actually works in static rendering, but gives me <code>undefined</code> in live rendering.<br>
I am using surface 0.7.3 and liveview 0.17.7</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247397" 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/surface-a-component-based-library-for-phoenix-liveview/27671/207">Post #206</a>
	                </div>
	            </div>
              <div id="likers-container-247397" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247397"
                     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 #206"></div>
  </section>
</div>
    <div class="postbit" id="247414" data-post-id="247414">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/derek-zhou" rel="nofollow">@derek-zhou</a> that code works for me and I’m running 0.7.1 and 0.17.7. Maybe clean your <code>_build</code>?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247414" 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/surface-a-component-based-library-for-phoenix-liveview/27671/208">Post #207</a>
	                </div>
	            </div>
              <div id="likers-container-247414" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247414"
                     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 #207"></div>
  </section>
</div>
    <div class="postbit" id="247415" data-post-id="247415">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Will try again later. Also, it seems like Surface is getting a lot stricter. I have some data assigned as <code>:map</code>, but could be nil in some cases. in 0.6.x Surface it works but no longer in 0.7.x. I have to change it to <code>:any</code>. In a dynamic language like Elixir, nil shall be a necessary evil?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247415" 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/surface-a-component-based-library-for-phoenix-liveview/27671/209">Post #208</a>
	                </div>
	            </div>
              <div id="likers-container-247415" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247415"
                     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 #208"></div>
  </section>
</div>
    <div class="postbit" id="247416" data-post-id="247416">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="derek-zhou" data-post="207" data-topic="27671">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">{#for n &lt;- 1..2}
 &lt;span :if={n &gt; 1}&gt;{n}&lt;/span&gt;
 {/for}
</code></pre>
</blockquote>
</aside>
<p>after nuking my _build, it still does not work. I am using elixir 1.12.3, on Erlang/OTP 24 [erts-12.0.4]</p>
<p>What I found is anything dynamic, a component or a html element with a <code>:if</code> pseudo attribute, within a <code>for</code> construct will not render correctly in a liveview.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247416" 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/surface-a-component-based-library-for-phoenix-liveview/27671/210">Post #209</a>
	                </div>
	            </div>
              <div id="likers-container-247416" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247416"
                     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 #209"></div>
  </section>
</div>
    <div class="postbit" id="247418" data-post-id="247418">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="derek-zhou" data-post="209" data-topic="27671">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<p>I have some data assigned as <code>:map</code>, but could be nil in some cases. in 0.6.x Surface it works but no longer in 0.7.x. I have to change it to <code>:any</code></p>
</blockquote>
</aside>
<p>I haven’t noticed this and I’m sure I set things to <code>nil</code>.  Maybe jump on slack and post your code.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247418" 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/surface-a-component-based-library-for-phoenix-liveview/27671/211">Post #210</a>
	                </div>
	            </div>
              <div id="likers-container-247418" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247418"
                     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 #210"></div>
  </section>
</div>
    <div class="postbit" id="247441" data-post-id="247441">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="msaraiva" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/msaraiva/120/1214_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  msaraiva
                    <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 class="user-title">
									<span>Broadway Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi <a class="mention" href="/u/derek-zhou" rel="nofollow">@derek-zhou</a>!</p>
<aside class="quote no-group" data-username="derek-zhou" data-post="207" data-topic="27671">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<p>I am having a lot of problem porting my application from 0.6.x. Even simple stuff like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"> {#for n &lt;- 1..2}
 &lt;span :if={n &gt; 1}&gt;{n}&lt;/span&gt;
 {/for}
</code></pre>
</blockquote>
</aside>
<p>I tested that very same code in many different versions and they all work as expected.</p>
<aside class="quote no-group" data-username="derek-zhou" data-post="207" data-topic="27671">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<p>but gives me <code>undefined</code> in live rendering.</p>
</blockquote>
</aside>
<p>That sounds like a JS thing. Are you using <code>npm</code>? If so, have you tried to nuke your <code>node_modules</code> and run <code>npm install</code> again after updating the libs?</p>
<p>If that doesn’t work, please run <code>liveSocket.enableDebug()</code> in your browser’s console and check if there’s any error/warning message.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247441" 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/surface-a-component-based-library-for-phoenix-liveview/27671/212">Post #211</a>
	                </div>
	            </div>
              <div id="likers-container-247441" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247441"
                     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 #211"></div>
  </section>
</div>
    <div class="postbit" id="247454" data-post-id="247454">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>That’s was it. the js side and the elixir side of the Liveview got out of sync; I was basically using 0.16.x js on 0.17.x elixir. I thought about it, but was fooled by the live_dashboard working. It turns out the live_dashboard bundled everything inside. Thanks a lot!</p>
<p>However, I still have the map type check issue:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">** (exit) an exception was raised:
    ** (RuntimeError) invalid value for property "stat". Expected a :map, got: nil.


        (surface 0.7.3) lib/surface.ex:246: anonymous fn/6 in Surface.build_assigns/6
</code></pre>
<p>I know I can trn the data prop into an <code>:any</code> but it still is annoying. It is a legitimate usage case that some data assigns are not initialized, as long as the templates check for nil, because loading everything takes time. <code>nil</code> is a very convenient marker of uninitialized data.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"></code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247454" 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/surface-a-component-based-library-for-phoenix-liveview/27671/213">Post #212</a>
	                </div>
	            </div>
              <div id="likers-container-247454" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247454"
                     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 #212"></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/27671/load_more?page=22">Load more posts (4 remaining)</a>
</div></template></turbo-stream>