<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Web Development on Nalar</title>
    <link>https://nalar.dev/tags/web-development/</link>
    <description>Recent content in Web Development on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 01 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/web-development/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Choosing JavaScript Promise Combinators: all, allSettled, any, and race</title>
      <link>https://nalar.dev/promise-combinators-all-allsettled-any-race/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/promise-combinators-all-allsettled-any-race/</guid>
      <description>&lt;p&gt;JavaScript provides several Promise combinators that look similar but encode very different failure policies. Choosing between &lt;code&gt;Promise.all&lt;/code&gt;, &lt;code&gt;Promise.allSettled&lt;/code&gt;, &lt;code&gt;Promise.any&lt;/code&gt;, and &lt;code&gt;Promise.race&lt;/code&gt; is less about syntax and more about defining what &amp;ldquo;success&amp;rdquo; means for a group of asynchronous operations.&lt;/p&gt;&#xA;&lt;p&gt;The important question is not &amp;ldquo;which one runs in parallel?&amp;rdquo; Promises usually start when you create them. The combinator decides how to observe their outcomes.&lt;/p&gt;&#xA;&lt;h2 id=&#34;promiseall-every-result-is-required&#34;&gt;&lt;code&gt;Promise.all&lt;/code&gt;: every result is required&lt;/h2&gt;&#xA;&lt;p&gt;Use &lt;code&gt;Promise.all&lt;/code&gt; when the operation is successful only if every input fulfills.&lt;/p&gt;</description>
    </item>
    <item>
      <title>CSS Logical Properties for International and Flexible Layouts</title>
      <link>https://nalar.dev/css-logical-properties-for-international-layouts/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/css-logical-properties-for-international-layouts/</guid>
      <description>&lt;p&gt;CSS traditionally describes spacing and borders with physical directions such as &lt;code&gt;left&lt;/code&gt;, &lt;code&gt;right&lt;/code&gt;, &lt;code&gt;top&lt;/code&gt;, and &lt;code&gt;bottom&lt;/code&gt;. That works until a component must support right-to-left text or a writing mode where the inline direction is not horizontal.&lt;/p&gt;&#xA;&lt;p&gt;Logical properties describe layout relative to the flow of text. They make components more adaptable without maintaining a second set of directional overrides.&lt;/p&gt;&#xA;&lt;h2 id=&#34;physical-versus-logical-directions&#34;&gt;Physical versus logical directions&lt;/h2&gt;&#xA;&lt;p&gt;In a typical English document, the inline axis runs from left to right and the block axis runs from top to bottom. Logical properties name those axes instead of assuming screen directions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>HTTP Conditional Requests with ETag and Last-Modified</title>
      <link>https://nalar.dev/http-conditional-requests-with-etag-and-last-modified/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/http-conditional-requests-with-etag-and-last-modified/</guid>
      <description>&lt;p&gt;HTTP caching is not only about choosing a long &lt;code&gt;max-age&lt;/code&gt;. Applications often need clients to revalidate data because a resource can change, while still avoiding retransmitting the full representation when it has not changed.&lt;/p&gt;&#xA;&lt;p&gt;HTTP validators solve that problem. The two common validators are &lt;code&gt;ETag&lt;/code&gt; and &lt;code&gt;Last-Modified&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;freshness-and-validation-are-different&#34;&gt;Freshness and validation are different&lt;/h2&gt;&#xA;&lt;p&gt;A freshness directive can tell a cache that a response may be reused without contacting the server for a period:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Progressive Enhancement for Resilient Web Forms</title>
      <link>https://nalar.dev/progressive-enhancement-for-resilient-web-forms/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/progressive-enhancement-for-resilient-web-forms/</guid>
      <description>&lt;p&gt;A web form does not need JavaScript to submit data. That native capability is a useful reliability baseline.&lt;/p&gt;&#xA;&lt;p&gt;Progressive enhancement starts with semantic HTML and a server endpoint that can complete the operation, then adds JavaScript for faster feedback or richer interactions. If the enhancement fails, the core task still has a path to succeed.&lt;/p&gt;&#xA;&lt;p&gt;This approach is valuable even in highly interactive applications because JavaScript can fail for ordinary reasons: slow networks, stale cached chunks, browser extensions, runtime exceptions, or a partial deployment.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Use HTTP 103 Early Hints Without Breaking Page Delivery</title>
      <link>https://nalar.dev/http-103-early-hints-web-performance/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/http-103-early-hints-web-performance/</guid>
      <description>&lt;p&gt;A server may need time to produce an HTML response even though it already knows that the page will require a stylesheet or other critical resource. HTTP &lt;code&gt;103 Early Hints&lt;/code&gt; lets the server send selected &lt;code&gt;Link&lt;/code&gt; hints before the final response so a supporting client can begin useful work sooner.&lt;/p&gt;&#xA;&lt;p&gt;The optimization is optional: the final response still determines the page result.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understand-the-response-sequence&#34;&gt;Understand the response sequence&lt;/h2&gt;&#xA;&lt;p&gt;A simplified exchange looks like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Use JavaScript Import Maps for Browser Module Aliases</title>
      <link>https://nalar.dev/javascript-import-maps-browser-module-aliases/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/javascript-import-maps-browser-module-aliases/</guid>
      <description>&lt;p&gt;Native ES modules normally require browser-resolvable URLs such as &lt;code&gt;./math.js&lt;/code&gt; or &lt;code&gt;/vendor/lib.js&lt;/code&gt;. Import maps add a controlled indirection layer so application code can use stable bare specifiers such as &lt;code&gt;app/config&lt;/code&gt; without a bundler rewriting imports.&lt;/p&gt;&#xA;&lt;h2 id=&#34;define-a-map-before-modules-load&#34;&gt;Define a map before modules load&lt;/h2&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;script&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;type&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;importmap&amp;#34;&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;imports&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;app/&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/js/app/&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;vendor-utils&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/vendor/utils-v3.js&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;script&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;script&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;type&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;module&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;src&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/js/main.js&amp;#34;&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;script&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;Then &lt;code&gt;/js/main.js&lt;/code&gt; can use:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Use structuredClone for Safe Deep Copying in JavaScript</title>
      <link>https://nalar.dev/structured-clone-for-safe-deep-copying-in-javascript/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/structured-clone-for-safe-deep-copying-in-javascript/</guid>
      <description>&lt;p&gt;Copying JavaScript values is easy until nested objects, dates, maps, sets, binary data, or circular references appear. The common JSON round trip works only for a limited subset of values and silently changes some data.&lt;/p&gt;&#xA;&lt;p&gt;The built-in &lt;code&gt;structuredClone()&lt;/code&gt; API provides a defined deep-cloning algorithm for many JavaScript data types.&lt;/p&gt;&#xA;&lt;h2 id=&#34;spread-syntax-is-only-a-shallow-copy&#34;&gt;Spread syntax is only a shallow copy&lt;/h2&gt;&#xA;&lt;p&gt;Object spread copies the first level:&lt;/p&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;original&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;profile&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Ada&amp;#34;&lt;/span&gt; }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;};&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;copy&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; { ...&lt;span style=&#34;color:#a6e22e&#34;&gt;original&lt;/span&gt; };&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;copy&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;profile&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Grace&amp;#34;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;console&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;log&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;original&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;profile&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;); &lt;span style=&#34;color:#75715e&#34;&gt;// &amp;#34;Grace&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;Both objects still reference the same nested &lt;code&gt;profile&lt;/code&gt;. Spread syntax is useful when shallow copying is intentional, but it is not a general deep-copy mechanism.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
