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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>So succinct, loving it!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="280023" 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/how-do-you-organize-your-components-with-phoenix-1-7/53901/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-280023" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="280023"
                     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="286147" data-post-id="286147">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Mhm I might non really see any gain on this. I still have a huge core_compenents and import it through separate modules. So more code for same implementation?</p>
<p>best</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286147" 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/how-do-you-organize-your-components-with-phoenix-1-7/53901/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-286147" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286147"
                     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="286148" data-post-id="286148">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Minor correction to this which I had to do to make it work:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule MyAppWeb.Components do
  defmacro __using__(_) do
    quote do
      import unquote(__MODULE__).{
        Form,
        Modal,
        Links,
        # ....
      }
    end
  end
end
</code></pre>
<p>Plus I added it to <code>html_helpers/0</code> since this is <code>unquoted</code> into <code>live_view/0</code> anyways.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286148" 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/how-do-you-organize-your-components-with-phoenix-1-7/53901/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-286148" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286148"
                     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="286163" data-post-id="286163">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>To simplify comparison of between version bug fixes, I ended up shortening my proxy to just one component file that delegates to either <code>core</code> or <code>fixed</code> components, which helps me visualize what changes I have brought in. Now when a new version hits, I’ll be able to perform a 3-way diff, in which what I really want to focus on, is bringing any bug fixes from core_component <strong>v2</strong> into what becomes my fixed <strong>v2</strong>, while simply overwriting the core components file.</p>
<p>I will still end up fixing 80% of components with my styling, so I’m not really happy with how much work there will be eventually, but I can’t influence core_compoment file organization to separate purely visual styling from any functional ones.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  @parent __MODULE__ |&gt; Module.split() |&gt; Enum.drop(-1) |&gt; Module.concat()
  @core Module.concat(@parent, CoreComponents)
  @fixed Module.concat(@parent, CoreModComponents)

  alias Phoenix.LiveView.JS

  # Modal Related

  defdelegate modal(assigns), to: @fixed

  defdelegate show_modal(js \\ %JS{}, id), to: @core
  defdelegate hide_modal(js \\ %JS{}, id), to: @core

  # Form Related

  defdelegate simple_form(assigns), to: @fixed
  defdelegate button(assigns), to: @core
  defdelegate input(assigns), to: @fixed
  defdelegate label(assigns), to: @fixed

  # Form Fields Related

  defdelegate header(assigns), to: @fixed
  defdelegate table(assigns), to: @fixed
  defdelegate list(assigns), to: @core
  defdelegate back(assigns), to: @core
  defdelegate icon(assigns), to: @core

  defdelegate show(js \\ %JS{}, selector), to: @core
  defdelegate hide(js \\ %JS{}, selector), to: @core

  # Flash Related

  defdelegate flash(assigns), to: @core
  defdelegate flash_group(assigns), to: @core

  # Error Related

  defdelegate error(assigns), to: @core

  defdelegate translate_error(params_tuple), to: @core
  defdelegate translate_errors(errors, field), to: @core

</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="286163" 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/how-do-you-organize-your-components-with-phoenix-1-7/53901/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-286163" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286163"
                     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 #14"></div>
  </section>
</div>
    <div class="postbit" id="286218" data-post-id="286218">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/aiwaiwa" rel="nofollow">@aiwaiwa</a> I really like your approach in your first comment. It seems to me that presents a really stable interface for future development in that you can adjust those core components by bringing them into your separate modules without having to change how they’re called. For example, if you start out using <code>ProjectWeb.ShowComponents.header</code> and then want to change it you can simply bring over most of the code from CoreComponents and create your own version in <code>ProjectWeb.ShowComponents</code> without having to update all of your views. Almost abstracting out from the default components to taste.</p>
<p>Thanks for the description. I am curious why you moved to a single file approach from that, what were the limitations you ran into?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286218" 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/how-do-you-organize-your-components-with-phoenix-1-7/53901/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-286218" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286218"
                     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 #15"></div>
  </section>
</div>
    <div class="postbit" id="286231" data-post-id="286231">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/asenchi" rel="nofollow">@asenchi</a> Honestly, that is a matter of taste mostly. I just felt it was too much of splitting for something that simple. I wanted to see an overall picture immediately and maintain it at one place.</p>
<p>But here’s a little fly in the ointment. Technically, it’s a naming clash. Core components use themselves, and some of what they will import will be among the fixed, and some among original. I ended up doing <code>import only:</code>, which is an extra housekeeping. In fact it’s only helping to resolve dependency issue within the fixed <code>CoreModComponents</code>. For example.</p>
<p>For the above mentioned configuration, I would have to do something like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule ProjectWeb.CoreModComponents do
  use Phoenix.Component

  alias Phoenix.LiveView.JS, warn: false
  import ProjectWeb.Gettext, warn: false

  import ProjectWeb.CoreComponentsDelegate,
    only: [show_modal: 1, hide_modal: 1, icon: 1, translate_error: 1, error: 1]

</code></pre>
<p>Let’s say, I want to add my own fixed version of the <code>&lt;.icon&gt;</code> component and retain its name.</p>
<p>From the core_component perspective, it’s still seeing its own local <code>icon</code> function as component to use in such components as <code>flash</code> and <code>flash_group</code>. So the naming issue is not the only issue here. I would have to bring all the functions that are using icon and also “fix” them.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286231" 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/how-do-you-organize-your-components-with-phoenix-1-7/53901/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-286231" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286231"
                     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 #16"></div>
  </section>
</div>
    <div class="postbit" id="286263" data-post-id="286263">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I see. I am relatively new to elixir and phoenix, but how do people typically manage upgrades with changes to important files like this? My take was that previously “default” work was confined to the PageController and then people moved that out of the way. I’m interested in understanding the upgrade path between versions if I start using these CoreComponents (please let me know if I am moving off topic here).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286263" 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/how-do-you-organize-your-components-with-phoenix-1-7/53901/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-286263" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286263"
                     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 #17"></div>
  </section>
</div>
    <div class="postbit" id="286335" data-post-id="286335">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m also relatively new! Just about a couple of months. Plus I’m always curious of all the changes between the versions, not being able to track bug fixes at github.</p>
<p><code>core_components</code> is one of those files that have to be diffed, to patch own core components if needed.</p>
<p>To help with that, I made a little script just to pull a desired Phoenix version, then create a project, then add extra steps, like <code>mix phx.gen.live Accounts User users name:string</code>, so that the generated output for those can be also compared. Online comparison tools tend not to disallow any such final steps, <em>understandably</em>.</p>
<p>Link to the script: <a href="https://gist.github.com/aiwaiwa/ac15f5d1019dfebfa342fafad4a9cb3d" class="inline-onebox" rel="noopener nofollow ugc">Compare Phoenix Versions with extra custom steps like mix phx.gen.live Accounts User users name:string · 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="286335" 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/how-do-you-organize-your-components-with-phoenix-1-7/53901/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-286335" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286335"
                     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 #18"></div>
  </section>
</div>
    <div class="postbit" id="288472" data-post-id="288472">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>One question – what do these two lines do?</p>
<aside class="quote no-group" data-username="aiwaiwa" data-post="9" data-topic="53901">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/aiwaiwa/48/30155_2.png" class="avatar"> aiwaiwa:</div>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">  @parent __MODULE__ |&gt; Module.split() |&gt; Enum.drop(-1) |&gt; Module.concat()
  @core Module.concat(@parent, CoreComponents)
</code></pre>
</blockquote>
</aside>
<p>Thank you so much for this!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="288472" 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/how-do-you-organize-your-components-with-phoenix-1-7/53901/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-288472" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="288472"
                     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 #19"></div>
  </section>
</div>
    <div class="postbit" id="288473" data-post-id="288473">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It’s pretty much to avoid mentioning my “WhateverWeb” module name and making it universal for any user to simply copy-paste into their module between <code>do</code> and <code>end</code>. It’s taking a current module name, splitting it so that you can get a parent module name and then concatenating it with a <code>CoreComponents</code> atom.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="288473" 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/how-do-you-organize-your-components-with-phoenix-1-7/53901/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-288473" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="288473"
                     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 #20"></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/53901/load_more?page=3">Load more posts (10 remaining)</a>
</div></template></turbo-stream>