<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="326793" data-post-id="326793">
  <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
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="blatyo" data-post="11" data-topic="63185">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/blatyo/48/4554_2.png" class="avatar"> blatyo:</div>
<blockquote>
<p>I don’t see anywhere in your examples anything about the pin operator (^), map update syntax <code>%{x | foo: 1}</code>, structs <code>%Foo{bar: 1}</code>, or struct update syntax <code>%Foo{baz | bar: 1}</code>. If they’re not supported, I’d argue they should be added.</p>
</blockquote>
</aside>
<p>I assume this part isn’t directed at me?</p>
<p>For the record I’m personally opposed to this making it into the language and think it’s better it exists in libraries.  I just wanted to share that thread as it has the most discussion and, in spite of my feelings, your proposal was an epic-good read and lesson in proposal writing.  I still think back to it when I try and outline tech concepts in writing <img src="https://forum.elixirforum.com/images/emoji/apple/joy.png?v=15" title=":joy:" class="emoji" alt=":joy:" 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="326793" 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/es6-maps-ecmascript6-style-shorthand-map-literals/63185/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-326793" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="326793"
                     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="326794" data-post-id="326794">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="blatyo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/blatyo/120/4554_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  blatyo
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Conduit Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="sodapopcan" data-post="12" data-topic="63185">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/48/34668_2.png" class="avatar"> sodapopcan:</div>
<blockquote>
<p>I assume this part isn’t directed at me?</p>
</blockquote>
</aside>
<p>No, not meant to be directed at you. Thanks for the kind words.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="326794" 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/es6-maps-ecmascript6-style-shorthand-map-literals/63185/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-326794" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="326794"
                     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="326797" data-post-id="326797">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’d really like to have that feature.</p>
<p>Did you think about adding sth to convert between normal and es6-maps-codebases.<br>
Would be easier to use in teams.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="326797" 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/es6-maps-ecmascript6-style-shorthand-map-literals/63185/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-326797" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="326797"
                     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="326800" data-post-id="326800">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kzemek" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kzemek/120/38341_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kzemek
                    <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="blatyo" data-post="11" data-topic="63185">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/blatyo/48/4554_2.png" class="avatar"> blatyo:</div>
<blockquote>
<p>Basically, instead of:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; foo = 1
iex&gt; %{hello, bar} = %{foo, hello: "world", bar: 2}
</code></pre>
<p>do:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; foo = 1
iex&gt; %{hello:, bar:} = %{foo:, hello: "world", bar: 2}
</code></pre>
</blockquote>
</aside>
<p>I’d personally be very happy with a solution like that built into the language.</p>
<aside class="quote no-group" data-username="blatyo" data-post="11" data-topic="63185">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/blatyo/48/4554_2.png" class="avatar"> blatyo:</div>
<blockquote>
<p>I don’t see anywhere in your examples anything about the pin operator (^), map update syntax <code>%{x | foo: 1}</code>, structs <code>%Foo{bar: 1}</code>, or struct update syntax <code>%Foo{baz | bar: 1}</code>. If they’re not supported, I’d argue they should be added.</p>
</blockquote>
</aside>
<p>Assuming you’re talking about <code>es6_maps</code>:</p>
<p>The pin operator support is something I’d like to see in the library in the future – the bigest impediment being that <code>%{^x, y: 1}</code> is not valid syntax and doesn’t make it to the AST stage, unlike <code>%{x, y: 1}</code>.</p>
<p>Map &amp; struct updates are supported and there’s a couple examples in the README.</p>
<aside class="quote no-group" data-username="sodapopcan" data-post="12" data-topic="63185">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/48/34668_2.png" class="avatar"> sodapopcan:</div>
<blockquote>
<p>For the record I’m personally opposed to this making it into the language and think it’s better it exists in libraries.</p>
</blockquote>
</aside>
<p>From my PoV the problem is, it’s really tricky to implement this as a library in a way that feels like a natural part of the language.</p>
<p>I was fine with requiring <code>use Es6Maps</code> in each module that wanted shorthands, but between <a href="https://hexdocs.pm/elixir/Module.html#module-on_definition" rel="noopener nofollow ugc"><code>@on_definition</code> deliberately not calling macros</a>, <code>@before_compile</code> actually happening after a compilation pass, and <a href="https://forum.elixirforum.com/t/how-to-change-ast-before-elixir-compilation/50326/2" rel="nofollow">this post from @josevalim</a>, there weren’t many options left aside from modifying the compiler in-flight to get this. It would be great to be able to create language extension PoCs that could make it into the standard implementation.</p>
<aside class="quote no-group" data-username="Sebb" data-post="14" data-topic="63185">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sebb/48/21818_2.png" class="avatar"> Sebb:</div>
<blockquote>
<p>Did you think about adding sth to convert between normal and es6-maps-codebases.<br>
Would be easier to use in teams.</p>
</blockquote>
</aside>
<p>Already added, there’s an <code>Es6Maps.Formatter</code> included in the library. You add it as <code>plugins: [Es6Maps.Formatter]</code> to <code>.formatters.exs</code>, call <code>mix format</code>, and all of your maps will be converted.</p>
<p>Unless you mean something like “display shorthand maps in the editor, save normal maps to disk”? That sounds like an interesting feature for ElixirLS.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="326800" 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/es6-maps-ecmascript6-style-shorthand-map-literals/63185/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-326800" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="326800"
                     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="361330" data-post-id="361330">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you! One of the few things I missed from JS.</p>
<p>Maybe the only thing, actually.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="361330" 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/es6-maps-ecmascript6-style-shorthand-map-literals/63185/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-361330" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="361330"
                     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="361331" data-post-id="361331">
  <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>Sis not know this lib so far. Just skimmed the thread.</p>
<aside class="quote no-group" data-username="kzemek" data-post="3" data-topic="63185">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kzemek/48/38341_2.png" class="avatar"> kzemek:</div>
<blockquote>
<p>That said, with the current implementation it might make sense to both have the task <strong>and</strong> an optional formatter for people to use, sharing the same code</p>
</blockquote>
</aside>
<p>Thinking out loud: having ‘—revert’ as formatter would enable auto-expansion while writing the code (format-on-save)? If so the writing becomes easier while its still k/v in the code base.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="361331" 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/es6-maps-ecmascript6-style-shorthand-map-literals/63185/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-361331" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="361331"
                     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="361602" data-post-id="361602">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kzemek" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kzemek/120/38341_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kzemek
                    <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="BartOtten" data-post="17" data-topic="63185">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bartotten/48/25440_2.png" class="avatar"> BartOtten:</div>
<blockquote>
<p>Thinking out loud: having ‘—revert’ as formatter would enable auto-expansion while writing the code (format-on-save)? If so the writing becomes easier while its still k/v in the code base.</p>
</blockquote>
</aside>
<p>Yep, technically you can skip adding <code>:es6_maps</code> to <code>compilers</code>, and add this to <code>.formatter.exs</code> to get that</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># .formatter.exs
[
  plugins: [Es6Maps.Formatter],
  inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"],
  es6_maps: [map_style: :vanilla]
]
</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="361602" 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/es6-maps-ecmascript6-style-shorthand-map-literals/63185/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-361602" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="361602"
                     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="365770" data-post-id="365770">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kzemek" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kzemek/120/38341_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kzemek
                    <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 have released the v1.0.0 version of <a href="https://github.com/kzemek/es6_maps" rel="noopener nofollow ugc">es6_maps</a>!</p>
<p>The major changes are:</p>
<ul>
<li><code>es6_maps</code> now amends the Elixir compiler at a different point (<code>:elixir.string_to_tokens/5</code>), which improves compatibility with other Elixir tools and happens to be a more stable API.</li>
<li>It can now be used at runtime, so we can paste in shorthand syntax to deployed shells</li>
<li>It includes an ElixirLS plugin to ensure it’s active while the language server analyzes the code.</li>
</ul>
<p>The v1.0.0 is also meant to signal production readiness. The library has been battle tested over the past year, and with the changes above I’m confident of its stability going forward.</p>
<p>GitHub: <a href="https://github.com/kzemek/es6_maps" class="inline-onebox" rel="noopener nofollow ugc">GitHub - kzemek/es6_maps: `%{foo, bar: 1}` — ES6-like shorthand syntax for Elixir maps and structs · GitHub</a><br>
Hex: <a href="https://hex.pm/packages/es6_maps" class="inline-onebox" rel="nofollow">es6_maps | Hex</a><br>
HexDocs: <a href="https://hexdocs.pm/es6_maps" class="inline-onebox" rel="noopener nofollow ugc">es6_maps v1.0.3 — Documentation</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="365770" data-batch-url="/posts/batch_likers">
                        10
                      </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/es6-maps-ecmascript6-style-shorthand-map-literals/63185/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-365770" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="365770"
                     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>