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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                    <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">
								<aside class="quote no-group" data-username="D4no0" data-post="11" data-topic="54155">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/d4no0/48/33624_2.png" class="avatar"> D4no0:</div>
<blockquote>
<p>Sadly it won’t be either easy or smart to manipulate classical mix tasks code, so modifying them is out of the question.</p>
</blockquote>
</aside>
<p>I didn’t <em>think</em> that’s what you were saying but I wasn’t sure <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20"></p>
<aside class="quote no-group" data-username="D4no0" data-post="11" data-topic="54155">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/d4no0/48/33624_2.png" class="avatar"> D4no0:</div>
<blockquote>
<p>The use-case would be to make generic pluggable Vials, an example would be using your <code>phx_new</code> vial but having my custom spin on some things, without executing 10 different tasks, but just one.</p>
</blockquote>
</aside>
<p>That’s the idea!  I was thinking of having “recipes” or “extensions” or something where you can do something like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  recipes [:utc_datetime_usec]
</code></pre>
<p>Outside of this thread, <a class="mention" href="/u/bartotten" rel="nofollow">@BartOtten</a> suggested making them composable which is also a possibility.  I’m thinking on it happy for more suggestions.</p>
<p>I might offer some of these out of the box but also want to provide a DSL to make custom changes a little easier, though part of that is just to help myself level up my metaprogramming.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279648" 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/request-for-feedback-on-vials-wrappers-for-mix-tasks/54155/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-279648" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279648"
                     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="279651" data-post-id="279651">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The only thing I find it a very hard fit with a composable system like this is the file modification.</p>
<p>For example I want <code>phx_new</code> to generate a modified version of the layout with perhaps bootstrap alerts, in this case you will have to fully rewrite the template, witch might not work well on new versions of phoenix.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279651" 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/request-for-feedback-on-vials-wrappers-for-mix-tasks/54155/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-279651" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279651"
                     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="279659" data-post-id="279659">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Didn’t see this thread getting bigger. Here the content (slight tweaked) of my latest PM to <a class="mention" href="/u/sodapopcan" rel="nofollow">@sodapopcan</a></p>
<aside class="quote no-group">
<blockquote>
<p>Have a look at Plug. There are plenty of plugs but the official Plug team only maintains a few of them. It does require:</p>
<ul>
<li>a spec/behaviour to adhere to</li>
<li>use of callbacks</li>
</ul>
<p>Currently Routex is build with this approach in mind and I really like it so far. Much more than (also mine) Localized Routes which is a monolith. Kip liked what LR did, but wanted to accomplish the same with CLDR and a bit different. As a result there are now 2 full code bases….</p>
<p>An extension based system on the other hand allows devs to differ on partials, as most things are done by only-1-job-extensions. Routex currently includes ~8 extensions to mimic Localized Routes; replacing 1 of those with a CLDR variant (approx 80 lines) would be enough tot mimic CLDR.Routes (but then incl Verified Routes as that extension stays in place). “Two libs for the maintenance price of 1”</p>
<ul>
<li>For users the benefit is to only swap 1 or 2 lines to try both variant</li>
<li>For the framework maintainer that extensions can be maintained by others in their own repo</li>
<li>For those other devs that they don’t need to maintain all the plumbing and non-use-case-specific code.</li>
<li>For all: flexibility</li>
</ul>
<p>[…]</p>
<p>I guess there are a zillion ways people differ in the bootstrap of Phoenix too, so an extension system for Vials allows them to differ without bothering you with those details.</p>
</blockquote>
</aside> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279659" 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/request-for-feedback-on-vials-wrappers-for-mix-tasks/54155/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-279659" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279659"
                     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="279668" data-post-id="279668">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                    <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 see what you’re and yes, good point.  That would be tricky to get right there is always the chance of referencing a part of the file that has been removed (when it comes to composing a third party’s code).</p>
<p>I’m not super worried about this just yet as I don’t even know how much use this is going to get and people can just share certain actions and tweak them.  But I’ll keep this in mind when expanding the DSL.</p>
<p>I’m thinking something along the lines of (but by no means exactly like):</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">edit "lib/#{@target}_web/router.ex", fn contents -&gt;
  contents
  |&gt; insert_after_line_containing "PageController" do
    live "/", HomeLive, :index
  end
  |&gt; remove_line_containing("PageController")
end
</code></pre>
<p>So that would obviously break if you were to plug in another operation that references <code>PageController</code>.</p>
<p>For the first release I’m just going to focus on simple string manipulation with maybe a couple of helpers.  It also looks like there is some <a href="https://github.com/doorgan/sourceror/issues/64" rel="noopener nofollow ugc">good generalized code rewriting tools</a> coming down the pipes!</p>
<p>But ya, it’s definitely something to think about.</p>
<p>But <a class="mention" href="/u/bartotten" rel="nofollow">@BartOtten</a> yes I definitely want to make it extendable and avoid adding specific task-related code the project.  I’ll take a lot at how you did it with Routex.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279668" 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/request-for-feedback-on-vials-wrappers-for-mix-tasks/54155/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-279668" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279668"
                     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>