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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hologram preserves the original key : (see type.mjs)</p>
<pre data-code-wrap="javascript"><code class="lang-javascript"> static map(data = []) {
    const hashTableWithMetadata = data.reduce((acc, [key, value]) =&gt; {
      acc[Type.encodeMapKey(key)] = [key, value];
      return acc;
    }, {});

    return {type: "map", data: hashTableWithMetadata};
  }
</code></pre>
<p>So you should be good to go by going through Type <a class="mention" href="/u/tenkiller" rel="nofollow">@tenkiller</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="379202" 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/elixir-javascript-porting-initiative/73335/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-379202" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="379202"
                     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 #22"></div>
  </section>
</div>
    <div class="postbit" id="379207" data-post-id="379207">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I noticed that <code>Type.encodeMapKey()</code> does not support <code>string</code> data types. Is this intentional? I can extend it to support them in a separate PR, or would you rather I include that change in my upcoming <code>:sets.to_list/1</code> PR?</p>
<p>For reference, here is the test I would add to <code>type_test.mjs</code> after extending it:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">it("encodes boxed string value as map key", () =&gt; {
  const string = Type.string("Hologram");
  const result = Type.encodeMapKey(string);

  assert.equal(result, "string(Hologram)");
});
</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="379207" 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/elixir-javascript-porting-initiative/73335/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-379207" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="379207"
                     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 #23"></div>
  </section>
</div>
    <div class="postbit" id="379210" data-post-id="379210">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bartblast" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bartblast/120/17647_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bartblast
                    <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>Creator of Hologram</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Lucassifoni" data-post="22" data-topic="73335">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lucassifoni/48/39057_2.png" class="avatar"> Lucassifoni:</div>
<blockquote>
<p>I’d be glad if you looked (when you get the time) at the current test helpers I added in the open PR</p>
</blockquote>
</aside>
<p>Looking at your PRs now, <a class="mention" href="/u/lucassifoni" rel="nofollow">@Lucassifoni</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="379210" 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/elixir-javascript-porting-initiative/73335/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-379210" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="379210"
                     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 #24"></div>
  </section>
</div>
    <div class="postbit" id="379212" data-post-id="379212">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bartblast" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bartblast/120/17647_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bartblast
                    <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>Creator of Hologram</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="tenkiller" data-post="24" data-topic="73335">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tenkiller/48/39502_2.png" class="avatar"> tenkiller:</div>
<blockquote>
<p>I noticed that <code>Type.encodeMapKey()</code> does not support <code>string</code> data types. Is this intentional? I can extend it to support them in a separate PR, or would you rather I include that change in my upcoming <code>:sets.to_list/1</code> PR?</p>
</blockquote>
</aside>
<p>That’s intentional - there’s no separate primitive “string” type in Elixir at the VM level. Elixir strings are UTF-8 encoded binaries. <code>Type.string()</code> is only an internal helper Hologram uses for text segments inside bitstrings, not a public string type. You can use <code>Type.bitstring()</code> helper for text - it will convert the text to boxed bitstring type (which includes binaries and therefore UTF-8 strings).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="379212" 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/elixir-javascript-porting-initiative/73335/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-379212" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="379212"
                     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 #25"></div>
  </section>
</div>
    <div class="postbit" id="381340" data-post-id="381340">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bartblast" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bartblast/120/17647_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bartblast
                    <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>Creator of Hologram</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Quick update: I’ve gone through all the remaining TODO Erlang functions and reviewed them. With far fewer left now, this was much more manageable!</p>
<p>I’ve pushed some functions to phase 2 after analyzing which Elixir stdlib functions depend on them. These deferred functions are primarily used by process-related Elixir stdlib functions, which aren’t targets for phase 1. Most of the deferred functions were ETS-related, commonly used by modules like <code>PartitionSupervisor</code> and <code>Registry</code>.</p>
<p><strong>This is your last chance to contribute – only 40 functions left to port for phase 1!</strong></p>
<p>Thanks for all your contributions so far!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="381340" data-batch-url="/posts/batch_likers">
                        6
                      </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/elixir-javascript-porting-initiative/73335/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-381340" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="381340"
                     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 #27"></div>
  </section>
</div>
    <div class="postbit" id="381954" data-post-id="381954">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/bartblast" rel="nofollow">@bartblast</a> Concerning <code>os.type/0</code>, I know you said you’d like it to mimic Erlang’s behavior and detect the OS platform and family via the <code>navigator.userAgentData</code>, but how should I actually test this? What’s the best strategy for stubbing the <code>window.navigator</code> object in <code>os_test.mjs</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="381954" 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/elixir-javascript-porting-initiative/73335/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-381954" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="381954"
                     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 #28"></div>
  </section>
</div>
    <div class="postbit" id="381955" data-post-id="381955">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bartblast" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bartblast/120/17647_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bartblast
                    <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>Creator of Hologram</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/tenkiller" rel="nofollow">@tenkiller</a> For navigator, just swap out <code>globalThis.navigator</code> with a mock object in your tests:</p>
<pre data-code-wrap="javascript"><code class="lang-javascript">describe("type/0", () =&gt; {
  let originalNavigator;

  beforeEach(() =&gt; {
    originalNavigator = globalThis.navigator;
  });

  afterEach(() =&gt; {
    globalThis.navigator = originalNavigator;
  });

  it("detects macOS via userAgentData", () =&gt; {
    globalThis.navigator = {
      userAgentData: {platform: "macOS"},
    };
    // test returns {:unix, :darwin}
  });

  it("detects Windows via userAgentData", () =&gt; {
    globalThis.navigator = {
      userAgentData: {platform: "Windows"},
    };
    // test returns {:win32, :nt}
  });

  it("detects Linux via userAgentData", () =&gt; {
    globalThis.navigator = {
      userAgentData: {platform: "Linux"},
    };
    // test returns {:unix, :linux}
  });

  it("falls back to platform when userAgentData unavailable", () =&gt; {
    globalThis.navigator = {
      userAgentData: undefined,
      platform: "MacIntel",
    };
    // test returns {:unix, :darwin}
  });

  it("falls back to userAgent when platform unavailable", () =&gt; {
    globalThis.navigator = {
      userAgentData: undefined,
      platform: "",
      userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64)...",
    };
    // test returns {:win32, :nt}
  });
});
</code></pre>
<p>For the implementation, the recommended fallback order is:</p>
<ol>
<li><code>navigator.userAgentData.platform</code> - modern API with clean values (“macOS”, “Windows”, “Linux”)</li>
<li><code>navigator.platform</code> - legacy but widely supported (“MacIntel”, “Win32”, “Linux x86_64”)</li>
<li><code>navigator.userAgent</code> - last resort, requires string parsing</li>
</ol>
<p>The userAgentData API isn’t supported in Firefox or Safari, so the platform fallback will handle those browsers. You may find that parsing userAgent is rarely needed in practice.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="381955" 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/elixir-javascript-porting-initiative/73335/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-381955" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="381955"
                     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 #29"></div>
  </section>
</div>
    <div class="postbit" id="381988" data-post-id="381988">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>UserAgent parsing is rather complicated if we rolled our own. Do you have a library recommendation, like <a href="https://github.com/faisalman/ua-parser-js" rel="noopener nofollow ugc">ua-parser.js</a> perhaps? Also, testing consistency with the JS implementation in <code>os_test.exs</code> is not clear to me either.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="381988" 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/elixir-javascript-porting-initiative/73335/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-381988" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="381988"
                     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 #30"></div>
  </section>
</div>
    <div class="postbit" id="382000" data-post-id="382000">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bartblast" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bartblast/120/17647_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bartblast
                    <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>Creator of Hologram</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/tenkiller" rel="nofollow">@tenkiller</a> Using an external lib like <code>ua-parser.js</code> would be overkill IMO, especially when that package is ~12kb minzipped. We’re only detecting basic OS families here, not parsing detailed browser/device info.</p>
<p><code>:os.type/0</code> returns just a basic system type - in practice it’s one of these (though could you verify the complete list by checking the Erlang/OTP docs?):</p>
<p><strong>Unix family:</strong></p>
<ul>
<li><code>{:unix, :darwin}</code> - macOS</li>
<li><code>{:unix, :linux}</code> - Linux</li>
<li><code>{:unix, :freebsd}</code> - FreeBSD</li>
<li><code>{:unix, :openbsd}</code> - OpenBSD</li>
<li><code>{:unix, :netbsd}</code> - NetBSD</li>
<li><code>{:unix, :sunos}</code> - Solaris/SunOS</li>
<li><code>{:unix, :aix}</code> - IBM AIX</li>
</ul>
<p><strong>Windows family:</strong></p>
<ul>
<li><code>{:win32, :nt}</code> - Windows NT-based systems (includes Windows XP, Vista, 7, 8, 10, 11, and Server editions)</li>
</ul>
<p>We just need some simple heuristics for the <code>userAgent</code> string - probably looking for specific words/patterns would be enough. Check out the patterns from the Elixir <code>ua_parser</code> lib for ideas: <a href="https://github.com/beam-community/ua_parser/blob/main/priv/patterns.yml" class="inline-onebox" rel="noopener nofollow ugc">ua_parser/priv/patterns.yml at main · beam-community/ua_parser · GitHub</a></p>
<p>For example, you could check if the userAgent contains “Mac”, “Win”, “Linux”, etc. and map those to the appropriate tuples. Should be pretty straightforward!</p>
<p>Re: consistency testing - it’s mostly impossible in this case since the Elixir version runs on the server (returning the server’s OS) while the JS version runs in the browser (returning the client’s OS).</p>
<p>So for this one:</p>
<ul>
<li>Put your JS tests inside a “client-only behaviour” <code>describe</code> block in <code>os_test.mjs</code> and test various OS detections thoroughly there</li>
<li>In <code>os_test.exs</code>, just add a sanity test that calls the actual Erlang <code>:os.type/0</code> function and asserts the returned value is one of the tuples we support on the client-side</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="382000" 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/elixir-javascript-porting-initiative/73335/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-382000" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="382000"
                     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 #31"></div>
  </section>
</div>
    <div class="postbit" id="382354" data-post-id="382354">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bartblast" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bartblast/120/17647_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bartblast
                    <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>Creator of Hologram</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Closing the loop on the <code>:os.type/0</code> discussion for future reference (this reasoning applies to similar cases as well):</p>
<p>We decided to hardcode <code>{:unix, :web}</code> for the client-side implementation. This aligns with our approach in other modules like <code>:filename</code>, where we unify path handling and treat the Hologram client platform as Unix-based.</p>
<p>The reasoning is twofold:</p>
<ol>
<li>
<p><code>:os.type/0</code> in Erlang/Elixir is meant to return the OS of the machine running the BEAM VM - but on the client side, our code runs in a browser sandbox, not directly on the user’s OS. Returning the actual user’s OS would be semantically incorrect and could break code that relies on <code>:os.type/0</code> for platform-specific behavior (like path handling).</p>
</li>
<li>
<p>Web APIs provide a unified, platform-independent abstraction - the browser hides OS differences from JavaScript code. Since web conventions align with Unix (forward slashes for paths/URLs), choosing <code>{:unix, :web}</code> is a pragmatic decision that simplifies our implementation (e.g., consistent path handling in <code>:filename</code> and similar modules).</p>
</li>
</ol>
<p>For use cases where you actually need the user’s platform information (analytics, file downloaders offering platform-specific binaries, UI adaptations, etc.), we’ll expose this through a dedicated Hologram module that clearly indicates it’s about the end user’s environment rather than the execution platform.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="382354" 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/elixir-javascript-porting-initiative/73335/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-382354" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="382354"
                     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 #32"></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/73335/load_more?page=4">Load more posts (1 remaining)</a>
</div></template></turbo-stream>